Closed PavelTurk closed 4 months ago
Thanks. Multiple reports and I've seen this myself. Adding milestone but no priority at this stage.
Tried reinstalling Netbeans 13 against JDK 11 and I still get this problem. It makes NetBeans almost unusable for me, can't refactor anything reliably and can't search usages either.
I got the same error with Usage search when loading Keycloak project. Dump file is in the attached GroupLDAPStorageMapper.zip, originating from Keycloak project
Product Version: Apache NetBeans IDE 15 Java: 17.0.4.1; OpenJDK 64-Bit Server VM 17.0.4.1+1 System: Linux version 5.17.11-300.fc36.x86_64 running on amd64; UTF-8; en_US (nb)
OS: Fedora 36
An error occurred during parsing of '/.../keycloak/federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/membership/group/GroupLDAPStorageMapper.java'. Please report a bug against java/source and attach dump file ''.
Caused: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1458)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:219)
at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1584)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:1207)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:1173)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:1136)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1551)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1541)
at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:222)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1377)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379)
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379)
Caused: java.lang.IllegalStateException
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:770)
at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:426)
at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:88)
at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin$FindTask.run(JavaWhereUsedQueryPlugin.java:562)
at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin$FindTask.run(JavaWhereUsedQueryPlugin.java:540)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.lambda$processFiles$2(JavaRefactoringPlugin.java:330)
at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:169)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:140)
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:85)
at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:328)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:264)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.queryFiles(JavaRefactoringPlugin.java:254)
at org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin.prepare(JavaWhereUsedQueryPlugin.java:353)
[catch] at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:417)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:401)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:212)
at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare$2.run(ParametersPanel.java:1059)
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)
Same here, Netbeans 15, Win10, JDK17. About 1/3 of the rename/move refactorings are blocked by this bug, this is seriously annoying.
Annotation: An error occurred during parsing of 'D:\JeromeDocs\JJazzLab\src\JJazzLab-X\OutputSynth\src\org\jjazz\outputsynth\api\GMRemapTable.java'. Please report a bug against java/source and attach dump file 'C:\Users\Jerome\AppData\Roaming\NetBeans\15\var\log\GMRemapTable.dump'.
Annotation: An error occurred during parsing of 'D:\JeromeDocs\JJazzLab\src\JJazzLab-X\OutputSynth\src\org\jjazz\outputsynth\api\GMRemapTable.java'. Please report a bug against java/source and attach dump file 'C:\Users\Jerome\AppData\Roaming\NetBeans\15\var\log\GMRemapTable.dump'.
Annotation: An error occurred during parsing of 'D:\JeromeDocs\JJazzLab\src\JJazzLab-X\OutputSynth\src\org\jjazz\outputsynth\api\GMRemapTable.java'. Please report a bug against java/source and attach dump file 'C:\Users\Jerome\AppData\Roaming\NetBeans\15\var\log\GMRemapTable.dump'.
An error occurred during parsing of 'D:\JeromeDocs\JJazzLab\src\JJazzLab-X\OutputSynth\src\org\jjazz\outputsynth\api\GMRemapTable.java'. Please report a bug against java/source and attach dump file 'C:\Users\Jerome\AppData\Roaming\NetBeans\15\var\log\GMRemapTable.dump'.
An error occurred during parsing of 'D:\JeromeDocs\JJazzLab\src\JJazzLab-X\OutputSynth\src\org\jjazz\outputsynth\api\GMRemapTable.java'. Please report a bug against java/source and attach dump file 'C:\Users\Jerome\AppData\Roaming\NetBeans\15\var\log\GMRemapTable.dump'.
Caused: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1458)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:219)
at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1584)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:1207)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:1173)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:1136)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1551)
at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1541)
at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:222)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1377)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1341)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379)
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379)
Caused: java.lang.IllegalStateException
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:770)
at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:426)
at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:88)
at org.netbeans.api.java.source.WorkingCopy.toPhase(WorkingCopy.java:192)
at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.setWorkingCopy(RefactoringVisitor.java:111)
at org.netbeans.modules.refactoring.java.plugins.MoveTransformer.setWorkingCopy(MoveTransformer.java:74)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:437)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:420)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.lambda$processFiles$1(JavaRefactoringPlugin.java:325)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:675)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:665)
at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:169)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:140)
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:85)
at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:686)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:323)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:264)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:246)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:338)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:354)
at org.netbeans.modules.refactoring.java.plugins.MoveFileRefactoringPlugin.prepare(MoveFileRefactoringPlugin.java:576)
[catch] at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:417)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:401)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:212)
at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:1063)
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)
Is this still being worked on? This is a huge blocker on any sort of refactor work because none of other tests are operational either because this is failing :compileJava level
Any resolution is appreciated, if anyone has been able to resolve this:
https://github.com/apache/netbeans/issues/5642#issuecomment-1657288677
Sharing my logs here too, just in case:
Same issue with Gradle as well:
`An exception has occurred in the compiler (17.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include you
r program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1439)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitSelect(TreeScanner.java:331)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2450)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1437)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1438)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1797)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:219)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1584)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:1188)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:1154)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:1117)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:444)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1532)
at jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1522)
at jdk.compiler/com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:222)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1377)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1351)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:89)
at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:94)
at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:54)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:39)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:97)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
at org.gradle.api.internal.tasks.compile.ModuleApplicationNameWritingCompiler.execute(ModuleApplicationNameWritingCompiler.java:46)
at org.gradle.api.internal.tasks.compile.ModuleApplicationNameWritingCompiler.execute(ModuleApplicationNameWritingCompiler.java:36)
at org.gradle.jvm.toolchain.internal.DefaultToolchainJavaCompiler.execute(DefaultToolchainJavaCompiler.java:57)
at org.gradle.api.tasks.compile.JavaCompile.lambda$createToolchainCompiler$1(JavaCompile.java:232)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompiler.execute(CleaningJavaCompiler.java:53)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory.lambda$createRebuildAllCompiler$0(IncrementalCompilerFactory.java:52)
at org.gradle.api.internal.tasks.compile.incremental.SelectiveCompiler.execute(SelectiveCompiler.java:67)
at org.gradle.api.internal.tasks.compile.incremental.SelectiveCompiler.execute(SelectiveCompiler.java:41)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:66)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:52)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler.execute(CompileJavaBuildOperationReportingCompiler.java:51)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:279)
at org.gradle.api.tasks.compile.JavaCompile.performIncrementalCompilation(JavaCompile.java:165)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:146)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
at org.gradle.api.internal.project.taskfactory.IncrementalInputsTaskAction.doExecute(IncrementalInputsTaskAction.java:32)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:236)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:221)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:204)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:187)
at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:165)
at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89)
at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40)
at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53)
at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40)
at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.executeDelegateBroadcastingChanges(CaptureStateAfterExecutionStep.java:124)
at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:80)
at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:58)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:181)
at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:71)
at org.gradle.internal.Either$Right.fold(Either.java:175)
at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:69)
at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:47)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:110)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNoEmptySources(SkipEmptyWorkStep.java:254)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNoEmptySources(SkipEmptyWorkStep.java:209)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:88)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:56)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:281)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:139)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:69)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:327)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:314)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:307)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:293)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:420)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:342)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)`
So, I found a fix that worked for me - not sure if this will help others. Originally, I was on Amazon Corretto Java 17.0.2 and now I upgraded it Amazon Corretto Java 17.0.8 and it did the trick - able to have a successful build now.
I hope this helps someone if they're still blocked by this error. Happy Coding!
@gg-happyhour https://github.com/apache/netbeans/issues/3725#issuecomment-1657299246 this exception you posted is from Gradle and not from NetBeans.
However, it is interesting that updating to the latest JDK 17 release did fix it for you.
This might indicate that it was fixed in javac itself at some point. (NB 18 ships with a javac based on JDK 20)
Product Version: Apache NetBeans IDE 19 Java: 21.0.1; OpenJDK 64-Bit Server VM 21.0.1+12-29 Runtime: OpenJDK Runtime Environment 21.0.1+12-29 System: Linux version 5.11.0-38-generic running on amd64; UTF-8; en_US (nb)
Renaming gives the following error. So, the problem is not in javac?
Caused: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Symbol.getDeclarationAttributes()" because "sym" is null
at com.sun.tools.javac.code.Lint.augment(Lint.java:75)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitVarDef(Flow.java:596)
at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1018)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:446)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.scanStat(Flow.java:506)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.scanStats(Flow.java:514)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitBlock(Flow.java:606)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1088)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:446)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.scanStat(Flow.java:506)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitMethodDef(Flow.java:570)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:912)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:446)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitClassDef(Flow.java:550)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:810)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:446)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.analyzeTree(Flow.java:1097)
at com.sun.tools.javac.comp.Flow$AliveAnalyzer.analyzeTree(Flow.java:1089)
at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:223)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1391)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1355)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379)
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379)
Caused: java.lang.IllegalStateException
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:770)
at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:426)
at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:90)
at org.netbeans.api.java.source.WorkingCopy.toPhase(WorkingCopy.java:192)
at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.setWorkingCopy(RefactoringVisitor.java:111)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:437)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:420)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.lambda$processFiles$1(JavaRefactoringPlugin.java:325)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:675)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:665)
at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:169)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:140)
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:85)
at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:686)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:323)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:264)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:246)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:338)
at org.netbeans.modules.refactoring.java.plugins.RenameRefactoringPlugin.prepare(RenameRefactoringPlugin.java:627)
[catch] at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:417)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:401)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:212)
at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:1063)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1419)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2034)
Product Version: Apache NetBeans IDE 19 Java: 21.0.1; OpenJDK 64-Bit Server VM 21.0.1+12-29 Runtime: OpenJDK Runtime Environment 21.0.1+12-29 System: Linux version 5.11.0-38-generic running on amd64; UTF-8; en_US (nb)
I work on Maven project with 15 JPMS modules. Renaming doesn't work. After every renaming I have to manually fix code in all modules. That's terrible and takes a lot of time. I cleared NB cache multiple times - it didn't help.
Please, solve this problem as soon as possible because it is not possible to work normally.
The problem occurs and with moving classes/interfaces from package in one module to package in another module:
Caused by: java.lang.IllegalStateException: java.lang.NullPointerException
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:770)
at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:426)
at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:90)
at org.netbeans.api.java.source.WorkingCopy.toPhase(WorkingCopy.java:192)
at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.setWorkingCopy(RefactoringVisitor.java:111)
at org.netbeans.modules.refactoring.java.plugins.MoveTransformer.setWorkingCopy(MoveTransformer.java:74)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:437)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:420)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.lambda$processFiles$1(JavaRefactoringPlugin.java:325)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:675)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:665)
at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:169)
at org.netbeans.modules.parsing.api.ParserManager$MultiUserTaskAction.run(ParserManager.java:140)
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:85)
at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:686)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:323)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:264)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:246)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:338)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:354)
at org.netbeans.modules.refactoring.java.plugins.MoveFileRefactoringPlugin.prepare(MoveFileRefactoringPlugin.java:576)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:417)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:401)
at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:212)
at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:1063)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1419)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2034)
Caused by: java.lang.NullPointerException
@neilcsmith-net Can you explain why this issue wasn't fixed again? Nobody can reproduce it? Or there are other problems? I asked in dev mailing list a few days ago but my message was ignored.
@PavelTurk short answer, because nobody worked on it. I've certainly seen this issue, as I mentioned earlier, which seems related to JPMS.
@neilcsmith-net Yes, I also think it is related with to JPMS. If I can give exact steps to reproduce it can you fix the issue? I am asking because I once spent several hours trying to reproduce it, but failed. So, it can require N hours.
the stacktrace is from javac, so it is unlikely to be fixable within NB. But having minimal NB reproducer might help to create a javac reproducer and file a bug against openjdk.
NB 22 which is baking in master will also have a newer javac based on jdk 22, so the stack traces might differ slightly between NB 21 which was just released and future 22.
@mbien I think it is related to JPMS, NB cache and refactoring. I will explain why I think so. I've noticed that when I clear NB cache and everything is OK, no errors are shown in NB, all code is compiled and works. Then I start refactoring. If I change key classes/interfaces I can get something like this in my tests:
NB says that some modules are not imported, but it is false as if I clear cache again, then everything is OK. Besides renaming stops working at some point. I work only with JPMS.
I even opened this issue https://github.com/apache/netbeans/issues/6750 because I need to clear NB cache sometimes 3-4 times a day. That's really very serious problem for me.
i also noticed some oddities while using modules: https://github.com/apache/netbeans/issues/6725
those things might be related, however IMO javac should not throw NPEs, there might be also something wrong there.
i also noticed some oddities while using modules: #6725
those things might be related, however IMO javac should not throw NPEs, there might be also something wrong there.
@mbien Yes, that is true. I thought that it is NB algorithm - to refresh the cache after code building.
I think I found a way how to reproduce this bug:
Product Version: Apache NetBeans IDE 21
Java: 21.0.1; OpenJDK 64-Bit Server VM 21.0.1+12-29
Runtime: OpenJDK Runtime Environment 21.0.1+12-29
System: Linux version 5.15.0-88-generic running on amd64; UTF-8; en_US (nb)
git clone https://github.com/PavelTurk/nb-3725
Open API and Imp1 module:
In module API delete class Foo3
:
In module API open and rename interface Interface3
:
Right click on Interface3
-> Refactor -> Rename. Enter new name Interface100
. Click Refactor.
Ok. We deleted class that is used, of course we will have an error. Create in the same package class NewClass
with the following content:
Try to rename NewClass
to NewClass2
. It is renamed.
Conclusion. As I understand the problem is in the following factors: 1) when there is a class that is heavy used by other classes and this class is refactored then NB has the problems with renaming and moving classes. 2) The reason of the problem can be linked to the factor that when JPMS modules are used NB doesn't update internal information in time.
@mbien How do you think, is this enough to fix the issue?
@PavelTurk thanks for taking your time and creating a reproducer. We had many duplicates but not one which showed how to replicate it.
we have now a PR https://github.com/apache/netbeans/pull/7153 open which tries to resolve the issue, the workflow there should produce dev-builds for easy testing. (e.g build, expires in 7 days)
I did also go through the duplicates and linked everything to the PR.
@mbien I tested the build you provided:
Product Version: Apache NetBeans IDE DEV (Build dev-ed979ecbdedb3fa1309bb80aa169b24323d08246)
Java: 21.0.1; OpenJDK 64-Bit Server VM 21.0.1+12-29
Runtime: OpenJDK Runtime Environment 21.0.1+12-29
System: Linux version 5.15.0-88-generic running on amd64; UTF-8; en_US (nb)
Foo4
to Foo100
Foo4
file. In all other files that use Foo4
it is not renamed:@PavelTurk it worked for me, i tried it twice and it renamed it correctly. First time I opened all projects and it got renamed everywhere, second time I only opened api and impl1 and it got only renamed in those two modules.
@mbien That's very strange. Maybe we use different java versions? Please see this peek:
https://github.com/apache/netbeans/assets/10261361/a966ba78-75c9-4914-b1fb-e981c8386379
I was using JDK 21.0.2 too as NB runtime. The same JDK was used for the project since that is the default (I haven't modified anything after starting or opening the project, however I did build it once first).
can you try to reset the project and run again from a fresh user directory. E.g:
nb-dev-build/bin/netbeans --userdir /tmp/nbtestdir1
this reminds me, since your project uses java modules, building before refactoring might be required as workaround at the moment due to https://github.com/apache/netbeans/issues/6725
@mbien I did two tests. Both tests failed - class was renamed only in one file and wasn't renamed in files that use it.
Test 1.
Test 2.
Reactor Summary for NB-3725 1.0.0:
5. Rename Foo4 to Foo100.
6. Renamed only in one file
@mbien I also tried to use JDK 21.0.2 instead of JDK 21.0.1 - didn't help. I increased minimum memory to 3GB - didn't help.
we are likely going to merge https://github.com/apache/netbeans/pull/7153 soon, this will close a bunch of bug reports including this one here.
The fact that @PavelTurk is still experiencing issues which I can't reproduce unfortunately, indicates that there is likely a second problem somewhere, additional to the javac NPEs which this was about.
In a week or so there will be NB 22 rc1 out, if it is still reproducible I would recommend to file a fresh bug report against NB 22, essentially pasting the reproducer of https://github.com/apache/netbeans/issues/3725#issuecomment-1957875703 into the form so that it is not lost.
@mbien I am using now Apache NetBeans IDE 22-rc1. Unfortunately as I noticed earlier sometimes (not always) renaming happens only in main file (that declares class/enum), but not in files that use them. Although situation became much better.
Should I open a new issue? As I see #7331 is not about this problem.
@PavelTurk yes please file a fresh bug report based on your post at https://github.com/apache/netbeans/issues/3725#issuecomment-1957875703. I suppose you could copy/paste most of the post.
Apache NetBeans version
Apache NetBeans 13
What happened
I have maven projects with modules. Evey module is also a JPMS module (contains module-info). So, I have api modues, impl modules etc. I often get the following error when I try to rename classes/interfaces/packages. So, every severe refactoring goes with pain.
This is the log
How to reproduce
Unfortunately I can't provide a solid example how to reproduce this error. It often happens but I can get it when I need. Sometimes it works well, sometime gives the error.
Did this work correctly in an earlier version?
No
Operating System
Ubuntu 20.04.3 LTS, Linux version 5.11.0-38-generic running on amd64; UTF-8; en_US (nb)
JDK
Java: 17.0.2; OpenJDK 64-Bit Server VM 17.0.2+8-86
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No
Code of Conduct
Yes