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

Symbol.packge() NPEs on ModuleSymbols

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • 15
    • None
    • tools
    • None

      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

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

              Created:
              Updated:
              Resolved: