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

Symbol.packge() NPEs on ModuleSymbols

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: tools
    • Labels:
      None

      Description

      The implementation walks enclosing symbols using sym.owner and looking at sym.kind until it sees a package, so it NPEs if called on a symbol that does not have an enclosing package (i.e. a module).

      I don't have a repro for this that uses public/supported APIs, but it might be worth fixing regardless.

      http://hg.openjdk.java.net/jdk/jdk/file/ff45c1bf8129/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#l510

        Attachments

          Activity

            People

            Assignee:
            asotona Adam Sotona
            Reporter:
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: