Goto action didn't work. This seems to be specific to records since other classes worked. The exception mentions "first" which is a record component of the class I wanted to jump to, see reproducer.
Once the source was downloaded, goto worked fine. So this might have something to do with the javap-esque "decompiler" of NB which generates classfile outlines.
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.progress.ui.RunOffEDTImpl$1
javax.lang.model.element.UnknownElementException: Unknown element: "first"
at javax.lang.model.util.AbstractElementVisitor6.visitUnknown(AbstractElementVisitor6.java:124)
at javax.lang.model.element.ElementVisitor.visitRecordComponent(ElementVisitor.java:223)
at javax.lang.model.util.AbstractElementVisitor6.visitRecordComponent(AbstractElementVisitor6.java:160)
at com.sun.tools.javac.code.Symbol$RecordComponent.accept(Symbol.java:1897)
at javax.lang.model.util.AbstractElementVisitor6.visit(AbstractElementVisitor6.java:106)
at org.netbeans.modules.java.classfile.CodeGenerator$TreeBuilder.visitType(CodeGenerator.java:396)
at org.netbeans.modules.java.classfile.CodeGenerator$TreeBuilder.visitType(CodeGenerator.java:308)
at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:1620)
at javax.lang.model.util.AbstractElementVisitor6.visit(AbstractElementVisitor6.java:106)
at org.netbeans.modules.java.classfile.CodeGenerator.generateCode(CodeGenerator.java:297)
at org.netbeans.modules.java.classfile.CodeGenerator$1.run(CodeGenerator.java:250)
at org.netbeans.modules.java.classfile.CodeGenerator$1.run(CodeGenerator.java:157)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:671)
at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:661)
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$UserTaskAction.run(ParserManager.java:197)
at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:180)
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:83)
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:680)
at org.netbeans.modules.java.classfile.CodeGenerator.generateCode(CodeGenerator.java:157)
at org.netbeans.modules.java.classfile.BinaryElementOpenImpl.open(BinaryElementOpenImpl.java:45)
at org.netbeans.api.java.source.ui.ElementOpen.binaryOpen(ElementOpen.java:137)
at org.netbeans.api.java.source.ui.ElementOpen.open(ElementOpen.java:131)
at org.netbeans.api.java.source.ui.ElementOpen.open(ElementOpen.java:120)
at org.netbeans.modules.editor.java.GoToSupport$7.open(GoToSupport.java:1263)
at org.netbeans.modules.editor.java.GoToSupport.performGoToImpl(GoToSupport.java:285)
at org.netbeans.modules.editor.java.GoToSupport.access$100(GoToSupport.java:125)
at org.netbeans.modules.editor.java.GoToSupport$3.run(GoToSupport.java:224)
at org.netbeans.modules.progress.ui.RunOffEDTImpl$1.run(RunOffEDTImpl.java:146)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
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:2018)
Language / Project Type / NetBeans Component
java maven project
How to reproduce
public static void main(String[] args) {
new org.eclipse.jetty.http.ByteRange(0, 0);
// ^^^^^^ ctrl click while having no sources of the artifact in the local .m2 repo
}
Apache NetBeans version
Apache NetBeans 22
What happened
Goto action didn't work. This seems to be specific to records since other classes worked. The exception mentions "first" which is a record component of the class I wanted to jump to, see reproducer.
Once the source was downloaded, goto worked fine. So this might have something to do with the javap-esque "decompiler" of NB which generates classfile outlines.
Language / Project Type / NetBeans Component
java maven project
How to reproduce
Did this work correctly in an earlier version?
No / Don't know
Operating System
linux
JDK
21.0.3
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
Yes