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

Defining generic method throws Exception on without nbjavac

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.0
    • Fix Version/s: 9.0
    • Component/s: java - Editor
    • Environment:
      release-302-on-20180517 without nbjavac

      Description

      Defining a generic method throws NPE.

      After inputing `<T>`, NPE is thrown.
       

      class Foo {
        <T>
      }
      java.lang.NullPointerException
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.visitErroneous(SourceAnalyzerFactory.java:752)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.visitErroneous(SourceAnalyzerFactory.java:274)
      	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCErroneous.accept(JCTree.java:2927)
      	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.scan(SourceAnalyzerFactory.java:385)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.scan(SourceAnalyzerFactory.java:274)
      	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
      	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.visitClass(SourceAnalyzerFactory.java:716)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.visitClass(SourceAnalyzerFactory.java:274)
      	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
      	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.scan(SourceAnalyzerFactory.java:385)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.scan(SourceAnalyzerFactory.java:274)
      	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.visitCompilationUnit(SourceAnalyzerFactory.java:402)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.visitCompilationUnit(SourceAnalyzerFactory.java:274)
      	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
      	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$UsagesVisitor.scan(SourceAnalyzerFactory.java:385)
      	at org.netbeans.modules.java.source.usages.SourceAnalyzerFactory$SimpleAnalyzer.analyseUnit(SourceAnalyzerFactory.java:242)
      	at org.netbeans.modules.java.source.usages.PersistentClassIndex$IndexPatch.lambda$updateDirty$0(PersistentClassIndex.java:575)
      	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:501)
      	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:451)
      	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:422)
      	at org.netbeans.modules.java.source.usages.PersistentClassIndex$IndexPatch.updateDirty(PersistentClassIndex.java:568)
      	at org.netbeans.modules.java.source.usages.PersistentClassIndex$IndexPatch.getPatch(PersistentClassIndex.java:530)
      	at org.netbeans.modules.java.source.usages.PersistentClassIndex.search(PersistentClassIndex.java:220)
      	at org.netbeans.api.java.source.ClassIndex.searchImpl(ClassIndex.java:499)
      	at org.netbeans.api.java.source.ClassIndex.getElements(ClassIndex.java:342)
      	at org.netbeans.modules.java.editor.overridden.ComputeOverriders.computeUsers(ComputeOverriders.java:284)
      	at org.netbeans.modules.java.editor.overridden.ComputeOverriders.computeUsers(ComputeOverriders.java:265)
      	at org.netbeans.modules.java.editor.overridden.ComputeOverriders.computeUsers(ComputeOverriders.java:427)
      	at org.netbeans.modules.java.editor.overridden.ComputeOverriders.processImpl(ComputeOverriders.java:203)
      	at org.netbeans.modules.java.editor.overridden.ComputeOverriders.process(ComputeOverriders.java:154)
      	at org.netbeans.modules.java.editor.overridden.ComputeAnnotations.computeAnnotations(ComputeAnnotations.java:104)
      	at org.netbeans.modules.java.editor.overridden.ComputeAnnotations.run(ComputeAnnotations.java:85)
      	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
      [catch] at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
      	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
      	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
      	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
      	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
      	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
      	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kishida Naoki Kishida
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Time Tracking

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