Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6197

Get wrong result using XXX Assign operator on byte array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.7, 2.1.3, 2.1.4
    • 2.1.6
    • class generator
    • None
    • Groovy lib 2.1.3
      jdk 1.7

    Description

      Run this script:

      byte[] b = new byte[1]
      b[0] = 16
      b[0] |= 2
      println b[0]

      Got result: 16
      Right result is 18

      This bug only occurs when using xxx Assign operator, e.g. |=, += , -=.
      And Int array works fine.

      Attachments

        Activity

          People

            melix C├ędric Champeau
            lusxiao Eddie Lu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: