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

JShell: variable declaration with unicode type name gets garbled result

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: