Issue #256966 - NullPointerException at com.sun.tools.javac.comp.Check.checkImportedPackagesObservable - fixed.
authorDusan Balek <dbalek@netbeans.org>
Fri, 22 Sep 2017 13:10:06 +0200
changeset 59620911c6d1f671
parent 5961 740e1ee04027
child 5963 9cc61f487a6d
Issue #256966 - NullPointerException at com.sun.tools.javac.comp.Check.checkImportedPackagesObservable - fixed.
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
     1.1 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Fri Sep 01 15:28:56 2017 +0200
     1.2 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Fri Sep 22 13:10:06 2017 +0200
     1.3 @@ -3722,7 +3722,7 @@
     1.4              if (!imp.staticImport && TreeInfo.name(imp.qualid) == names.asterisk
     1.5                      && ((JCFieldAccess)imp.qualid).selected.type != null) {
     1.6                  TypeSymbol tsym = ((JCFieldAccess)imp.qualid).selected.type.tsym;
     1.7 -                if (toplevel.modle.visiblePackages != null) {
     1.8 +                if (toplevel.modle != null && toplevel.modle.visiblePackages != null) {
     1.9                      //TODO - unclear: selects like javax.* will get resolved from the current module
    1.10                      //(as javax is not an exported package from any module). And as javax in the current
    1.11                      //module typically does not contain any classes or subpackages, we need to go through