Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2980

NPE when opening file

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.1
    • Fix Version/s: 11.2
    • Component/s: None

      Description

      Open a project.
      Don't have the dependent project(s) open.
      Press ^1, ^O, type a class name.
      Get this:

      java.lang.NullPointerException
      at org.netbeans.modules.java.source.pretty.ImportAnalysis2.getPackageOf(ImportAnalysis2.java:393)
      at org.netbeans.modules.java.source.pretty.ImportAnalysis2.resolveImport(ImportAnalysis2.java:310)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitMemberSelect(ImmutableTreeTranslator.java:475)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitMemberSelect(ImmutableTreeTranslator.java:74)
      at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2203)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:123)
      at org.netbeans.api.java.source.WorkingCopy$5.translate(WorkingCopy.java:871)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translateClassRef(ImmutableTreeTranslator.java:135)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translateClassRef(ImmutableTreeTranslator.java:144)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.rewriteChildren(ImmutableTreeTranslator.java:595)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitClass(ImmutableTreeTranslator.java:335)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitClass(ImmutableTreeTranslator.java:74)
      at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:818)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:123)
      at org.netbeans.api.java.source.WorkingCopy$5.translate(WorkingCopy.java:871)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:198)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.rewriteChildren(ImmutableTreeTranslator.java:545)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitCompilationUnit(ImmutableTreeTranslator.java:322)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitCompilationUnit(ImmutableTreeTranslator.java:74)
      at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:599)
      at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:123)
      at org.netbeans.api.java.source.WorkingCopy$5.translate(WorkingCopy.java:871)
      at org.netbeans.api.java.source.WorkingCopy$5.translate(WorkingCopy.java:867)
      at org.netbeans.api.java.source.WorkingCopy.processCurrentCompilationUnit(WorkingCopy.java:899)
      at org.netbeans.api.java.source.WorkingCopy.getChanges(WorkingCopy.java:1326)
      at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:676)
      at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:663)
      at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:502)
      at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
      at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:130)
      at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114)
      at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
      at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
      at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
      at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
      at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
      at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
      at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
      at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:81)
      at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:452)
      at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:423)
      at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:684)
      at org.netbeans.modules.java.classfile.CodeGenerator.generateCode(CodeGenerator.java:152)
      at org.netbeans.modules.java.classfile.BinaryElementOpenImpl.open(BinaryElementOpenImpl.java:44)
      at org.netbeans.api.java.source.ui.ElementOpen.binaryOpen(ElementOpen.java:118)
      at org.netbeans.api.java.source.ui.ElementOpen.open(ElementOpen.java:99)
      at org.netbeans.modules.java.source.ui.JavaTypeDescription.open(JavaTypeDescription.java:121)
      at org.netbeans.modules.jumpto.type.GoToTypeAction.actionPerformed(GoToTypeAction.java:153)
      at org.openide.windows.TopComponent.processKeyBinding(TopComponent.java:1151)
      at javax.swing.JComponent.processKeyBindings(JComponent.java:2943)
      at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
      at org.openide.explorer.view.TreeView$ExplorerTree.processKeyEvent(TreeView.java:1870)
      at java.awt.Component.processEvent(Component.java:6316)
      at java.awt.Container.processEvent(Container.java:2239)
      at java.awt.Component.dispatchEventImpl(Component.java:4889)
      at java.awt.Container.dispatchEventImpl(Container.java:2297)
      at java.awt.Component.dispatchEvent(Component.java:4711)
      at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:834)
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1102)
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:973)
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:799)
      at java.awt.Component.dispatchEventImpl(Component.java:4760)
      at java.awt.Container.dispatchEventImpl(Container.java:2297)
      at java.awt.Window.dispatchEventImpl(Window.java:2746)
      at java.awt.Component.dispatchEvent(Component.java:4711)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
      at java.awt.EventQueue.access$500(EventQueue.java:97)
      at java.awt.EventQueue$3.run(EventQueue.java:709)
      at java.awt.EventQueue$3.run(EventQueue.java:703)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
      at java.awt.EventQueue$4.run(EventQueue.java:733)
      at java.awt.EventQueue$4.run(EventQueue.java:731)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
      at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
      [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

      Opening the dependent project manually, then repeating the ^1 ^O process works fine.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sdedic Svatopluk Dedic
                Reporter:
                arren Shevek
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m