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

Qualified name of a type element depends on its origin (source vs class)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • None
    • tools
    • b21

      Looking specifically at `javax.lang.model.SourceVersion.valueOf(Runtime.Version)`
      the form of the qualified names depends on the source vs.class origin.

      When reading from .class files, `Runtime$Version` is seen.
      When reading from .java files, `Runtime.Version` is seen.

      This makes it hard to compare types across versions when one comes from class files and the other from source files.

      There is no reason to believe that this is specific to `SourceVersion` or `Runtime.Version`. It's probably a general characteristic of nested classes and their origin.

      Attached is an annotation processor to dump the methods of any given class.

            asotona Adam Sotona
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: