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

JShell: variable declaration with unicode type name gets garbled result

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 15
    • tools
    • None
    • b08
    • generic
    • generic

      jshell> class \u00AA {}
      | created class \u00AA

      jshell> \u00AA x
      | created variable x, however, it cannot be referenced until class A is declared

      --------------

      Inspection determines that the source range is accessed from the compiler API, and that it gives a start position of 5 and end position of 6.

      It will need to be determined if this is a compiler bug or intended behavior. If the later, than a different mechanism will need to be used.

      ------------
      Note: There are no issues with method, classes, and expressions...

      jshell> \u00AA m() { return null;}
      | created method m()

      jshell> class C extends \u00AA {}
      | created class C

      jshell> new \u00AA()
      $9 ==> ?@1d56ce6a

            rfield Robert Field (Inactive)
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: