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

Get wrong result using XXX Assign operator on byte array

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.7, 2.1.3, 2.1.4
    • Fix Version/s: 2.1.6
    • Component/s: class generator
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: