Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4770188

byte to char a narrowing conversion?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0
    • specification
    • None
    • tiger
    • generic
    • solaris_8
    • Verified

      JLS 5.1.3 defines the byte to char conversion as a narrowing
      conversion that simply discards bits. That doesn't work because the
      conversion adds bits, not removes bits. Is the sign extended before
      discarding bits or is the value padded with zeroes? This is
      completely unspecified in the JLS and implementations could differ.

            gbrachasunw Gilad Bracha (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: