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

NPE on editing code out of gradle project scope

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: projects - Gradle
    • Labels:
      None
    • Environment:
      Product Version: Apache NetBeans IDE DEV (Build dev-12d0e2d43f10e70cdc90c26e3b65d0aa946282e3)
      Java: 13.0.1; Java HotSpot(TM) 64-Bit Server VM 13.0.1+9

      Description

      Steps to reproduce:

      Open gradle project

      Perform some Usages search in project so Usages View is opened with some contents

      Close project (all opened classes are closed)

      Now open file from usages View and try to edit it

      the NPE is thrown:

      java.lang.NullPointerException
      at org.netbeans.modules.gradle.java.queries.GradleCompilerOptionsQuery.getOptions(GradleCompilerOptionsQuery.java:68)
      at org.netbeans.modules.java.project.ProjectCompilerOptionsQueryImplementation.lambda$getOptions$1(ProjectCompilerOptionsQueryImplementation.java:38)
      at java.base/java.util.Optional.map(Optional.java:258)
      at org.netbeans.modules.java.project.ProjectCompilerOptionsQueryImplementation.getOptions(ProjectCompilerOptionsQueryImplementation.java:38)
      at org.netbeans.api.java.queries.CompilerOptionsQuery.getOptions(CompilerOptionsQuery.java:58)
      at org.netbeans.modules.java.source.parsing.JavacParser.createJavacTask(JavacParser.java:795)
      at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.getJavacTask(CompilationInfoImpl.java:409)
      at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.getJavacTask(CompilationInfoImpl.java:391)
      at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:492)
      at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:145)
      at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:608)
      at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:239)
      at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:775)
      at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
      at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
      [catch] 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

          Issue Links

            Activity

              People

              • Assignee:
                lkishalmi Laszlo Kishalmi
                Reporter:
                Khramov mkhramov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: