crbench//

← all cases

Extract the source file name from the .class and use it to locate the source

Tier 2 medium java · local · real merged PR from apache/netbeans #5152

Ground-truth defects

d1 · correctness · medium
`SourceUtils.findMatchingChild` iterates a folder's children and returns the first name match without excluding directories (no `isFolder()` / file-vs-folder check). A directory whose name equals the class name (e.g. a package dir `Test/` next to `Test.java`) is returned as the "source file", so go-to-source resolves to a folder instead of the file. The fix skips folders when matching.

The change under review

diff (truncated — full diff)
diff --git a/java/java.editor/nbproject/project.xml b/java/java.editor/nbproject/project.xml
index 9f2b262cd125..4270767b7a54 100644
--- a/java/java.editor/nbproject/project.xml
+++ b/java/java.editor/nbproject/project.xml
@@ -248,7 +248,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>2.23</specification-version>
+                        <specification-version>2.60</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
diff --git a/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java b/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java
index 8b85ae292e46..95f30da04e2b 100644
--- a/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java
+++ b/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java
@@ -123,17 +123,17 @@
  * @author Jan Lahoda
  */
 public class GoToSupport {
-    
+
     /** Creates a new instance of GoToSupport */
     public GoToSupport() {
     }
-    
+
     private static FileObject getFileObject(Document doc) {
         DataObject od = (DataObject) doc.getProperty(Document.StreamDescriptionProperty);
-        
+
         return od != null ? od.getPrimaryFile() : null;
     }
-    
+
     public static String getGoToElementTooltip(final Document doc, final int offset, final boolean goToSource, final HyperlinkType type) {
         try {
             final FileObject fo = getFileObject(doc);
@@ -186,7 +186,7 @@ public void run(ResultIterator resultIterator) throws Exception {
                         Context resolved = resolveContext(controller, doc, offset, goToSource, false);
 
                         if (resolved == null) {
-                            target[0] = new GoToTarget(-1, -1, null, null, null, null, null, false);
+                            target[0] = new GoToTarget(-1, -1, null, null, null, null, null, null, false);
                         } else {
                             target[0] = computeGoToTarget(controller, resolved, offset);
                         }
@@ -196,7 +196,7 @@ public void run(ResultIterator resultIterator) throws Exception {
                 });
                 if (target[0] != null && target[0].success) {
                     if (target[0].offsetToOpen < 0) {
-                        CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName);
+                        CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName, target[0].fileName);
                         return future.thenApply(location -> {
                             return location != null ? HyperlinkLocationProvider.createHyperlinkLocation(location.getFileObject(), location.getStartOffset(), location.getEndOffset()) : null;
                         });
@@ -211,11 +211,11 @@ public void run(ResultIterator resultIterator) throws Exception {
             throw new IllegalStateException(ex);
         }
     }
-    
+
     private static boolean isError(Element el) {
         return el == null || el.asType() == null || el.asType().getKind() == TypeKind.ERROR;
     }
-    
+
     private static void performGoTo(final Document doc, final int offset, final boolean goToSource, final boolean javadoc) {
         final AtomicBoolean cancel = new AtomicBoolean();
         ProgressUtils.runOffEventDispatchThread(new Runnable() {
@@ -229,11 +229,11 @@ public void run() {
     private static void performGoToImpl (final Document doc, final int offset, final boolean goToSource, final boolean javadoc, final AtomicBoolean cancel) {
         try {
             final FileObject fo = getFileObject(doc);
-            
+
             if (fo == null) {
                 return ;
             }
-            
+
             GoToTarget[] target = new GoToTarget[1];
 
             ParserManager.parse(Collections.singleton (Source.create(doc)), new UserTask() {
@@ -251,23 +251,23 @@ public void run(ResultIterator resultIterator) throws Exception {
                     Context resolved = resolveContext(controller, doc, offset, goToSource, false);
 
                     if (resolved == null) {
-                        target[0] = new GoToTarget(-1, -1, null, null, null, null, null, false);
+                        target[0] = new GoToTarget(-1, -1, null, null, null, null, null, null, false);
                         return;
                     }
-                    
+
                     if (javadoc) {
                         final URL url = SourceUtils.getPreferredJavadoc(resolved.resolved);
                         if (url != null) {
                             HtmlBrowser.URLDisplayer.getDefault().showURL(url);
                         } else {
-                            target[0] = new GoToTarget(-1, -1, null, null, null, null, null, false);
+                            target[0] = new GoToTarget(-1, -1, null, null, null, null, null, null, false);
                         }
                     } else {
                         target[0] = computeGoToTarget(controller, resolved, offset);
                     }
                 }
             });
-            
+
             if (target[0] != null) {
                 boolean openSucceeded = false;
 
@@ -282,7 +282,7 @@ public void run(ResultIterator resultIterator) throws Exception {
                         openSucceeded = CALLER.open(fo, target[0].offsetToOpen);
                     } else {
                         if (target[0].elementToOpen != null) {
-                            openSucceeded = CALLER.open(target[0].cpInfo, target[0].elementToOpen);
+                            openSucceeded = CALLER.open(target[0].cpInfo, target[0].elementToOpen, target[0].fileName);
                         }
                     }
                     if (!openSucceeded) {
@@ -294,7 +294,7 @@ public void run(ResultIterator resultIterator) throws Exception {
             throw new IllegalStateException(ex);
         }
     }
-    
+
     public static GoToTarget computeGoToTarget(CompilationController controller, Context resolved, int offset) {
         TreePath elpath = getPath(controller, resolved.resolved);
 
@@ -305,7 +305,7 @@ public static GoToTarget computeGoToTarget(CompilationController controller, Con
             if (startPos != (-1)) {
                 //check if the caret is inside the declaration itself, as jump in this case is not very usefull:
                 if (isCaretInsideDeclarationName(controller, tree, elpath, offset)) {
-                    return new GoToTarget(-1, -1, null, null, null, null, null, false);
+                    return new GoToTarget(-1, -1, null, null, null, null, null, null, false);
                 } else {
                     long endPos = controller.getTrees().getSourcePositions().getEndPosition(controller.getCompilationUnit(), tree);
                     //#71272: it is necessary to translate the offset:
@@ -315,20 +315,24 @@ public static GoToTarget computeGoToTarget(CompilationController controller, Con
                                           null,
                                           null,
                                           null,
+                                          null,
                                           controller.getElementUtilities().getElementName(resolved.resolved, false).toString(),
                                           true);
                 }
             } else {
-                return new GoToTarget(-1, -1, null, null, null, null, null, false);
+                return new GoToTarget(-1, -1, null, null, null, null, null, null, false);
             }
         } else {
             TypeElement te = resolved.resolved != null ? controller.getElementUtilities().outermostTypeElement(resolved.resolved) : null;
+            String resourceName = te != null ? te.getQualifiedName().toString().replace('.', '/') + ".class" : null;
+            String fileName = findFileName(resolved.resolved);
             return new GoToTarget(-1,
                                   -1,
                                   null,
                                   controller.getClasspathInfo(),
                                   ElementHandle.create(resolved.resolved),
-                                  te != null ? te.getQualifiedName().toString().replace('.', '/') + ".class" : null,
+                                  fileName,
+                                  resourceName,
                                   controller.getElementUtilities().getElementName(resolved.resolved, false).toString(),
                                   true);
         }
@@ -360,26 +364,31 @@ public static final class GoToTarget {
         public final ClasspathInfo cpInfo;
         public final ElementHandle elementToOpen;
         public final String resourceName;
+        public final String fileName;
         public final String displayNameForError;
         public final boolean success;
 
         public GoToTarget(int offsetToOpen, int endPos, int[] nameSpan, ClasspathInfo cpInfo, ElementHandle elementToOpen, String resourceName, String displayNameForError, boolean success) {
+            this(offsetToOpen, endPos, nameSpan, cpInfo, elementToOpen, null, resourceName, displayNameForError, success);
+        }
+
+        GoToTarget(int offsetToOpen, int endPos, int[] nameSpan, ClasspathInfo cpInfo, ElementHandle elementToOpen, String fileName, String resourceName, String displayNameForError, boolean success) {
             this.offsetToOpen = offsetToOpen;
             this.endPos = endPos;
             this.nameSpan = nameSpan;
             this.cpInfo = cpInfo;
             this.elementToOpen = elementToOpen;
+            this.fileName = fileName;
             this.resourceName = resourceName;
             this.displayNameForError = displayNameForError;
             this.success = success;
         }
-
     }
 
     public static void goTo(final Document doc, final int offset, final boolean goToSource) {
         performGoTo(doc, offset, goToSource, false);
     }
-    
+
     public static void goToJavadoc(Document doc, int offset) {
         performGoTo(doc, offset, false, true);
     }
@@ -553,14 +562,14 @@ private static String computeTooltip(final CompilationInfo controller, final Doc
             // attempt to cancel the background task once the tooltip waiting period is over
             class Ctrl implements Callable<Boolean> {
                 private volatile boolean cancel;
-                
+
                 @Override
                 public Boolean call() throws Exception {
                     return cancel;
                 }
-                
+
             };
-            
+
             final Ctrl control = new Ctrl();
             // #240060: if non-null cancel is passed, the actual URL fetch is done on background, allowing us to proceed without blocking
             final ElementJavadoc jdoc = ElementJavadoc.create(controller, resolved.resolved, control);
@@ -582,7 +591,7 @@ public Boolean call() throws Exception {
                 }
                 doc.putProperty("TooltipResolver.hyperlinkListener", new HyperlinkListener() { //NOI18N
                     @Override
-                    public void hyperlinkUpdate(HyperlinkEvent e) {                    
+                    public void hyperlinkUpdate(HyperlinkEvent e) {
                         if (e != null && HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
                             String desc = e.getDescription();
                             if (desc != null) {
@@ -605,12 +614,12 @@ public void hyperlinkUpdate(HyperlinkEvent e) {
             }
             control.cancel = true;
         } catch (Exception ex) {}
-        
-        
+
+
         if (result == null || result.isEmpty()) {
             result = v.result.toString();
         }
-        
+
         int overridableKind = overridableKind(resolved.resolved);
 
         if (overridableKind != (-1) && type != null) {
@@ -627,15 +636,15 @@ public void hyperlinkUpdate(HyperlinkEvent e) {
 
         return result;
     }
-    
+
     private static final Set<JavaTokenId> USABLE_TOKEN_IDS = EnumSet.of(JavaTokenId.IDENTIFIER, JavaTokenId.THIS, JavaTokenId.SUPER, JavaTokenId.ARROW);
-    
+
     public static int[] getIdentifierOrLambdaArrowSpan(final Document doc, final int offset, final Token<JavaTokenId>[] token) {
         if (getFileObject(doc) == null) {
             //do nothing if FO is not attached to the document - the goto would not work anyway:
             return null;
         }
-        final int[][] ret = new int[][] {null}; 
+        final int[][] ret = new int[][] {null};
         doc.render(new Runnable() {
             @Override
             public void run() {
@@ -687,11 +696,11 @@ public void run() {
         });
         return ret[0];
     }
-    
+
     private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, final Element el) {
         Element encl = el.getEnclosingElement();
         Element doubleEncl = encl != null ? encl.getEnclosingElement() : null;
-        
+
         if (   doubleEncl != null
             && !doubleEncl.getKind().isClass()
             && !doubleEncl.getKind().isInterface()
@@ -699,26 +708,26 @@ private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, f
             && encl.getKind() == ElementKind.CLASS) {
             TreePath enclTreePath = info.getTrees().getPath(encl);
             Tree enclTree = enclTreePath != null ? enclTreePath.getLeaf() : null;
-            
+
             if (enclTree != null && TreeUtilities.CLASS_TREE_KINDS.contains(enclTree.getKind()) && enclTreePath.getParentPath().getLeaf().getKind() == Tree.Kind.NEW_CLASS) {
                 NewClassTree nct = (NewClassTree) enclTreePath.getParentPath().getLeaf();
-                
+
                 if (nct.getClassBody() != null) {
                     Element parentElement = info.getTrees().getElement(new TreePath(enclTreePath, nct.getIdentifier()));
-                    
+
                     if (parentElement == null || parentElement.getKind().isInterface()) {
                         return parentElement;
                     } else {
                         //annonymous innerclass extending a class. Find out which constructor is used:
                         TreePath superConstructorCall = new FindSuperConstructorCall().scan(enclTreePath, null);
-                        
+
                         if (superConstructorCall != null) {
                             return info.getTrees().getElement(superConstructorCall);
                         }
                     }
                 }
             }
-            
+
             return null;//prevent jumps to incorrect positions
         } else {
             if (encl != null) {
@@ -728,7 +737,7 @@ private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, f
             }
         }
     }
-    
+
     /**
      * Tries to guess element referenced by static import. It may not be deterministic
      * as in <code>import static java.awt.Color.getColor</code>.
@@ -738,7 +747,7 @@ private static Element handleStaticImport(CompilationInfo javac, ImportTree impt
         if (!impt.isStatic() || impIdent == null || impIdent.getKind() != Kind.MEMBER_SELECT) {
             return null;
         }
-        
+
         // resolve type element containing imported element
         Trees trees = javac.getTrees();
         MemberSelectTree select = (MemberSelectTree) impIdent;
@@ -749,7 +758,7 @@ private static Element handleStaticImport(CompilationInfo javac, ImportTree impt
         if (isError(selectElm)) {
             return null;
         }
-        
+
         // resolve class to determine scope
         TypeMirror clazzMir = null;
         TreePath clazzPath = null;
@@ -768,9 +777,9 @@ private static Element handleStaticImport(CompilationInfo javac, ImportTree impt
         if (clazzMir == null) {
             return null;
         }
-        
+
         Scope clazzScope = trees.getScope(clazzPath);
-        
+
         // choose the first acceptable member
         for (Element member : selectElm.getEnclosedElements()) {
             if (member.getModifiers().contains(Modifier.STATIC)
@@ -781,7 +790,7 @@ private static Element handleStaticImport(CompilationInfo javac, ImportTree impt
         }
         return null;
     }
-    
+
     private static boolean isCaretInsideDeclarationName(CompilationInfo info, Tree t, TreePath path, int caret) {
         try {
             switch (t.getKind()) {
@@ -832,7 +841,7 @@ private static int overridableKind(Element el) {
 
         return -1;
     }
-    
+
     private static TreePath adjustPathForModuleName(TreePath path) {
         TreePath tp = path;
         while (tp != null && (tp.getLeaf().getKind() == Kind.IDENTIFIER || tp.getLeaf().getKind() == Kind.MEMBER_SELECT)) {
@@ -917,16 +926,16 @@ public Void visitTypeParameter(TypeParameterTree node, Void p) {
     }
 
     private static final class FindSuperConstructorCall extends ErrorAwareTreePathScanner<TreePath, Void> {
-        
+
         @Override
         public TreePath visitMethodInvocation(MethodInvocationTree tree, Void v) {
             if (tree.getMethodSelect().getKind() == Kind.IDENTIFIER && "super".equals(((IdentifierTree) tree.getMethodSelect()).getName().toString())) {
                 return getCurrentPath();
             }
-            
+
             return null;
         }
-        
+
         @Override
         public TreePath reduce(TreePath first, TreePath second) {
             if (first == null) {
@@ -935,9 +944,9 @@ public TreePath reduce(TreePath first, TreePath second) {
                 return first;
             }
         }
-        
+
     }
-    
+
     private static final class DisplayNameElementVisitor extends AbstractElementVisitor9<Void, Boolean> {
 
         private final CompilationInfo info;
@@ -945,15 +954,15 @@ private static final class DisplayNameElementVisitor extends AbstractElementVisi
         public DisplayNameElementVisitor(CompilationInfo info) {
             this.info = info;
         }
-        
+
         private StringBuffer result        = new StringBuffer();
-        
+
         private void boldStartCheck(boolean highlightName) {
             if (highlightName) {
                 result.append("<b>");
             }
         }
-        
+
         private void boldStopCheck(boolean highlightName) {
             if (highlightName) {
                 result.append("</b>");
@@ -963,18 +972,18 @@ private void boldStopCheck(boolean highlightName) {
         @Override
         public Void visitModule(ModuleElement e, Boolean highlightName) {
             result.append("module ");
-            boldStartCheck(highlightName);            
-            result.append(e.getQualifiedName());            
-            boldStopCheck(highlightName);            
+            boldStartCheck(highlightName);
+            result.append(e.getQualifiedName());
+            boldStopCheck(highlightName);
             return null;
         }
-        
+
         @Override
         public Void visitPackage(PackageElement e, Boolean highlightName) {
-            result.append("package ");                   
-            boldStartCheck(highlightName);            
-            result.append(e.getQualifiedName());            
-            boldStopCheck(highlightName);            
+            result.append("package ");
+            boldStartCheck(highlightName);
+            result.append(e.getQualifiedName());
+            boldStopCheck(highlightName);
             return null;
         }
 
@@ -982,7 +991,7 @@ public Void visitPackage(PackageElement e, Boolean highlightName) {
         public Void visitType(TypeElement e, Boolean highlightName) {
             return printType(e, null, highlightName);
         }
-        
+
         Void printType(TypeElement e, DeclaredType dt, Boolean highlightName) {
             modifier(e.getModifiers());
             switch (e.getKind()) {
@@ -1000,7 +1009,7 @@ Void printType(TypeElement e, DeclaredType dt, Boolean highlightName) {
                     break;
             }
             Element enclosing = e.getEnclosingElement();
-            
+
             if (enclosing == SourceUtils.getEnclosingTypeElement(e)) {
                 result.append(((TypeElement) enclosing).getQualifiedName());
                 result.append('.');
@@ -1010,7 +1019,7 @@ Void printType(TypeElement e, DeclaredType dt, Boolean highlightName) {
             } else {
                 result.append(e.getQualifiedName());
             }
-            
+
             if (dt != null) {
                 dumpRealTypeArguments(dt.getTypeArguments());
             }
@@ -1021,25 +1030,25 @@ Void printType(TypeElement e, DeclaredType dt, Boolean highlightName) {
         @Override
         public Void visitVariable(VariableElement e, Boolean highlightName) {
             modifier(e.getModifiers());
-            
+
             result.append(getTypeName(info, e.asType(), true));
-            
+
             result.append(' ');
-            
+
             boldStartCheck(highlightName);
 
             result.append(e.getSimpleName());
-            
+
             boldStopCheck(highlightName);
-            
+
             if (highlightName) {
                 if (e.getConstantValue() != null) {
                     result.append(" = ");
                     result.append(StringEscapeUtils.escapeHtml(e.getConstantValue().toString()));
                 }
-                
+
                 Element enclosing = e.getEnclosingElement();
-                

Leaderboard for this case

medium · 4 of 9 bots fully caught it (44% solve rate) · 44% avg coverage.

#BotResultCaughtCoverageFindingsFalse alarms
1 Claude Code (Opus 5.5) solved 1/1 100.0% 6 0
2 Drape (Deep Review) solved 1/1 100.0% 5 0
3 Drape (Review) solved 1/1 100.0% 7 0
4 greptile solved 1/1 100.0% 3 0
5 Cubic miss 0/1 0.0% 7 0
6 cursor miss 0/1 0.0% 6 0
7 Mjolnir (Opus 5.5) miss 0/1 0.0% 6 0
8 Mjolnir (Sonnet 5.5) miss 0/1 0.0% 4 0
9 qodo miss 0/1 0.0% 5 0

Bot results

Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✓ off by one
valid · impact high
For methods, fields and constructors, findFileName returns null, and passing that single null String to the varargs open/getLocation produces {null}. findSourceForBinary adds the null to fnames, so the list has two or more entries and the loop reaches findMatchingChild(null). Match.apply then throws an NPE whenever the class-name candidate didn't match, for example a library or JDK class with no source. [grounded: tree java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java] [consensus 3/3: valid=3]
valid · impact medium
The new public varargs getFile adds caller-supplied names without filtering out nulls, and the new Match.apply calls name.equals with no null guard, so a null entry causes an NPE. [grounded: tree java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java] [consensus 3/3: valid=3]
valid · impact medium
findSourceFileName only handles ClassSymbol, so when the resolved element is a member the hint is null, even though the outermost type `te` is already available one line above. The feature therefore does nothing when navigating to members. [grounded: tree java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java] [consensus 3/3: valid=3]
valid · impact low
The removed lines required openInfo[1] and openInfo[2] to be != -1 before returning a Location. Now a file whose element cannot be resolved yields a Location clamped to 0, which changes behavior for existing callers of getLocation. The change may be intentional, but the behavior difference is real. [grounded: diff-section java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java] [consensus 3/3: valid=3]
valid · matches d1 · impact medium
valid · impact low
getFutureOpenInfo receives `names` but the retry after source attachment passes null, so the hint is lost on that path. This is an incomplete change. [grounded: diff-section java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java] [consensus 3/3: valid=3]
raw comments (6)
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:1263
`fileName` is a single `String` that is often null: `findSourceFileName` returns null for any element that is not a ClassSymbol. Passing it to the varargs `ElementOpen.open(info, el, fileName)` builds `new String[]{null}`, not an empty array. In `SourceUtils.findSourceForBinary` that null is added to `fnames`, so the list has 2+ entries and the loop calls `findMatchingChild(null, ...)`. That creates a `Match` whose `name` is null, and `Match.apply` throws an NPE at `name.equals(fo.getNameExt())`. This happens whenever the class name itself doesn't match, for example Go To Declaration on a method or field of a JDK or library class with no attached source. `getFile` only catches IOException, so the NPE escapes and Go To fails instead of falling back to binary open. The same thing happens through `ElementOpen.getLocation(..., target[0].fileName)` in the hyperlink-location path. Pass an empty array when the name is null, or skip null entries.
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:612
`fnames.addAll(Arrays.asList(names))` adds caller-supplied names without filtering out nulls. Because `names` is a public varargs parameter, `getFile(handle, cp, (String) null)` or any array containing a null crashes in `Match.apply` with an NPE. Null or empty entries should be ignored.
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328
`findFileName(resolved.resolved)` is passed the resolved element, which is usually a method, field or constructor. `SourceUtils.findSourceFileName` only handles ClassSymbol, so for those targets the file name hint is null and the new feature does nothing. The name should come from the outermost type element (`te`, already computed on the line above).
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:322
`getLocation` used to return null when the element's offsets could not be found (`openInfo[1]`/`openInfo[2]` == -1). It now returns a Location anyway, clamping the offsets to 0. This changes existing behavior for all callers, including the old 3-argument overload and the LSP hyperlink path: an element that cannot be resolved now navigates to the start of the file with a 0-length range instead of reporting that no location was found.
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:686
`Match.apply` now accepts any child whose full name equals the candidate, without the `isJava`/`isData` check. Candidates built from class names have no extension, so for class `Foo` a folder or extension-less file named `Foo` in the package directory now matches. `getFile` then returns a folder or non-Java file instead of `Foo.java`. The exact-name shortcut should only apply to the explicitly suggested names, or should still require `isData()`.
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
After sources are attached, the retry in `attachmentSucceeded` calls `getOpenInfo(cpInfo, el, null, cancel)` and drops the suggested `names`. So the file name hint is not used in exactly the case this feature targets, where the source file name differs from the class name.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✗ —
valid · impact high
A null String passed to the String... parameter becomes {null}. fnames then contains null, findMatchingChild(null, ...) builds a Match with name==null, and name.equals(...) throws an NPE whenever the class-derived candidates don't match first. fileName is null for every member element and for the public-constructor path. [grounded: tree java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java] [consensus 5/5: valid=5]
valid · impact medium
The removed -1 checks used to return null for unresolved handles and for packages. Now an unresolved handle gives a Location of (0,0), and a package gives start=m.start() with end=0, so end comes before start. [grounded: diff] [consensus 4/5: valid=4, uncertain=1]
valid · impact low
The new test mutates a global static and never resets it, while JavaSourceTest resets the same field in a finally block. This is a real but minor test-isolation issue. [grounded: diff] [consensus 4/5: valid=4, uncertain=1]
valid · impact low
getFutureOpenInfo receives names but drops them in the attachmentSucceeded callback. This is an incomplete change: lookups after source attachment lose the file-name hint. [grounded: diff] [consensus 5/5: valid=5]
uncertain
The ordering does put class-derived names before the hints. The claimed wrong result needs an unusual setup (both files present in an unindexed root), and the FQN2Files check guards indexed roots, so the impact can't be confirmed from what is shown. [uncertain: no evidence quoted] [consensus 3/5: uncertain=3, valid=2]
valid · impact medium
computeGoToTarget passes resolved.resolved, which is often a method or field. findSourceFileName returns null for those, so the SourceFile hint never reaches member navigation. [grounded: diff] [consensus 5/5: valid=5]
minor · impact low
This is test cleanliness (a redundant latch and an opaque failure message), not a behavior defect in the code under test. [grounded: diff] [consensus 5/5: minor=5]
raw comments (8)
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:199
<!-- cubic:v=7dfd1361-03a8-4d1a-ae7b-8841bb1c3437 --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":9} --> P1: When `fileName` is null and the source file does not use the binary class name, these calls pass `{null}` to the `String... names` parameter and binary navigation can fail with a `NullPointerException`. Call the overload without a filename when the hint is null, in both `getGoToLocation` and `performGoToImpl`. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java, line 199: <comment>When `fileName` is null and the source file does not use the binary class name, these calls pass `{null}` to the `String... names` parameter and binary navigation can fail with a `NullPointerException`. Call the overload without a filename when the hint is null, in both `getGoToLocation` and `performGoToImpl`.</comment> <file context> @@ -196,7 +196,7 @@ public void run(ResultIterator resultIterator) throws Exception { if (target[0] != null && target[0].success) { if (target[0].offsetToOpen < 0) { - CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName); + CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName, target[0].fileName); return future.thenApply(location -> { return location != null ? HyperlinkLocationProvider.createHyperlinkLocation(location.getFileObject(), location.getStartOffset(), location.getEndOffset()) : null; </file context> ``` </details>
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:325
<!-- cubic:v=04d7fa85-af62-427b-a455-105d4d0bd152 --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":9} --> P1: When the file is found but the handle cannot resolve, or when opening a package declaration, `getLocation` now returns an invalid `Location` instead of `null`. Require valid declaration offsets before applying the name-span fallback. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java, line 325: <comment>When the file is found but the handle cannot resolve, or when opening a package declaration, `getLocation` now returns an invalid `Location` instead of `null`. Require valid declaration offsets before applying the name-span fallback.</comment> <file context> @@ -291,17 +305,32 @@ public void run(CompilationController cc) throws Exception { + final CompletableFuture<Object[]> future = getFutureOpenInfo(cpInfo, el, resourceName, new AtomicBoolean(), true, names); return future.thenApply(openInfo -> { - if (openInfo != null && openInfo[0] != null && (int) openInfo[1] != (-1) && (int) openInfo[2] != (-1)) { + if (openInfo != null && openInfo[0] != null) { FileObject file = (FileObject) openInfo[0]; int start = (int) openInfo[3]; </file context> ``` </details> ```suggestion if (openInfo != null && openInfo[0] != null && (int) openInfo[1] != (-1) && (int) openInfo[2] != (-1)) { ```
java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java:488
<!-- cubic:v=ac10873c-e69f-4d3c-a42a-9cd29426ef48 --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":6} --> P2: The new test sets the global static SourceLevelQueryImpl.sourceLevel to "1.8" and never restores it. Source level is shared per JVM, so this leaks into whichever tests run after this one in the same fork; other tests in this area (e.g. JavaSourceTest.testIncrementalReparseErrors231280) reset it to null in a finally block. Wrap the test body so the source level is restored, or set it only within a scoped try/finally. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java, line 488: <comment>The new test sets the global static SourceLevelQueryImpl.sourceLevel to "1.8" and never restores it. Source level is shared per JVM, so this leaks into whichever tests run after this one in the same fork; other tests in this area (e.g. JavaSourceTest.testIncrementalReparseErrors231280) reset it to null in a finally block. Wrap the test body so the source level is restored, or set it only within a scoped try/finally.</comment> <file context> @@ -458,14 +462,57 @@ public void testGetBound() throws Exception { + assertNotNull(workFO); + + FileObject target = FileUtil.createFolder(workFO, "target"); + JavaSourceTest.SourceLevelQueryImpl.sourceLevel = "1.8"; + FileObject clazz = FileUtil.createData(target, "my/hello/Hello.class"); + try (OutputStream os = clazz.getOutputStream()) { </file context> ``` </details>
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
<!-- cubic:v=32f1917a-d557-402b-a664-1572efc630ba --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":8} --> P2: When source attachment succeeds after the initial lookup misses, this callback discards the suggested `names`, so attached-source lookup can select the wrong source file or fail to locate the intended one. Pass `names` through the callback. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java, line 410: <comment>When source attachment succeeds after the initial lookup misses, this callback discards the suggested `names`, so attached-source lookup can select the wrong source file or fail to locate the intended one. Pass `names` through the callback.</comment> <file context> @@ -378,7 +407,7 @@ static CompletableFuture<Object[]> getFutureOpenInfo(final ClasspathInfo cpInfo, public void attachmentSucceeded() { try { - Object[] openInfo = getOpenInfo(cpInfo, el, cancel); + Object[] openInfo = getOpenInfo(cpInfo, el, null, cancel); if (openInfo != null && (int) openInfo[1] != (-1) && (int) openInfo[2] != (-1) && openInfo[5] != null) { future.complete(openInfo); </file context> ``` </details> ```suggestion Object[] openInfo = getOpenInfo(cpInfo, el, names, cancel); ```
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:605
<!-- cubic:v=ce730800-0936-45ce-97d8-6f7d8c9d1a1c --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":8} --> P2: When a binary's `SourceFile` name differs from its class name and both files exist in an unindexed source root, `findSourceForBinary` returns the class-derived match before trying the hint. Try caller-supplied names before class-derived candidates. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java, line 602: <comment>When a binary's `SourceFile` name differs from its class name and both files exist in an unindexed source root, `findSourceForBinary` returns the class-derived match before trying the hint. Try caller-supplied names before class-derived candidates.</comment> <file context> @@ -555,34 +574,38 @@ public static FileObject getFile (final ElementHandle<? extends Element> handle, final boolean caseSensitive = isCaseSensitive (); - final Object fnames = getSourceFileNames(className); + final List<String> fnames = new ArrayList<>(); + fnames.addAll(getSourceFileNames(className)); + if (names != null) { + fnames.addAll(Arrays.asList(names)); </file context> ``` </details> ```suggestion if (names != null) { fnames.addAll(Arrays.asList(names)); } fnames.addAll(getSourceFileNames(className)); ```
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:290
<!-- cubic:v=37d74c17-6baf-4945-a0f2-84e1d317ee92 --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":9} --> P2: When Go To Source resolves a method or field from a class file, `findSourceFileName` returns null because it reads `sourcefile` only from a direct `ClassSymbol`. Read the enclosing class symbol before reading `sourcefile`, so renamed `SourceFile` targets work for members too. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java, line 284: <comment>When Go To Source resolves a method or field from a class file, `findSourceFileName` returns null because it reads `sourcefile` only from a direct `ClassSymbol`. Read the enclosing class symbol before reading `sourcefile`, so renamed `SourceFile` targets work for members too.</comment> <file context> @@ -266,23 +252,44 @@ public static List<? extends Completion> getAttributeValueCompletions(Compilatio + * @since 2.60 + */ + public static String findSourceFileName(Element element) { + if (element instanceof ClassSymbol) { + ClassSymbol s = (ClassSymbol) element; + if (s.sourcefile != null) { </file context> ``` </details> ```suggestion ClassSymbol s = element instanceof ClassSymbol ? (ClassSymbol) element : element instanceof Symbol ? ((Symbol) element).enclClass() : null; if (s != null && s.sourcefile != null) { return s.sourcefile.getName(); } return null; ```
java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportFileNameTest.java:64
<!-- cubic:v=41ed877e-1423-4289-afdb-465c9356577a --> <!-- cubic:review-run=d8c1f6c3-9889-548f-8405-5d9e368380a4 --> <!-- metadata:{"confidence":8} --> P3: The CountDownLatch/await here is dead code: `runUserActionTask` blocks until the task finishes, so `arr` is already populated and the latch counted down before `cdl.await` runs, and its boolean result is ignored. Drop the latch or, if you want a guard, assert that the task actually ran and that `arr` is non-empty before `arr.get(0)`, otherwise a slow/empty parse fails with an opaque IndexOutOfBoundsException. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportFileNameTest.java, line 64: <comment>The CountDownLatch/await here is dead code: `runUserActionTask` blocks until the task finishes, so `arr` is already populated and the latch counted down before `cdl.await` runs, and its boolean result is ignored. Drop the latch or, if you want a guard, assert that the task actually ran and that `arr` is non-empty before `arr.get(0)`, otherwise a slow/empty parse fails with an opaque IndexOutOfBoundsException.</comment> <file context> @@ -0,0 +1,69 @@ + } + }, true); + + cdl.await(1, TimeUnit.SECONDS); + + String name = GoToSupport.findFileName(arr.get(0)); </file context> ``` </details>
PR-level
<!-- cubic:review-summary:start --> **7 issues found** across 10 files <!-- cubic:review-summary:end --> <details> <summary>Prompt for AI agents (unresolved issues)</summary> ```text Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately. <file name="java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java"> <violation number="1" location="java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:199"> P1: When `fileName` is null and the source file does not use the binary class name, these calls pass `{null}` to the `String... names` parameter and binary navigation can fail with a `NullPointerException`. Call the overload without a filename when the hint is null, in both `getGoToLocation` and `performGoToImpl`.</violation> </file> <file name="java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java"> <violation number="1" location="java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java:488"> P2: The new test sets the global static SourceLevelQueryImpl.sourceLevel to "1.8" and never restores it. Source level is shared per JVM, so this leaks into whichever tests run after this one in the same fork; other tests in this area (e.g. JavaSourceTest.testIncrementalReparseErrors231280) reset it to null in a finally block. Wrap the test body so the source level is restored, or set it only within a scoped try/finally.</violation> </file> <file name="java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java"> <violation number="1" location="java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:325"> P1: When the file is found but the handle cannot resolve, or when opening a package declaration, `getLocation` now returns an invalid `Location` instead of `null`. Require valid declaration offsets before applying the name-span fallback.</violation> <violation number="2" location="java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410"> P2: When source attachment succeeds after the initial lookup misses, this callback discards the suggested `names`, so attached-source lookup can select the wrong source file or fail to locate the intended one. Pass `names` through the callback.</violation> </file> <file name="java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java"> <violation number="1" location="java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:284"> P2: When Go To Source resolves a method or field from a class file, `findSourceFileName` returns null because it reads `sourcefile` only from a direct `ClassSymbol`. Read the enclosing class symbol before reading `sourcefile`, so renamed `SourceFile` targets work for members too.</violation> <violation number="2" location="java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:602"> P2: When a binary's `SourceFile` name differs from its class name and both files exist in an unindexed source root, `findSourceForBinary` returns the class-derived match before trying the hint. Try caller-supplied names before class-derived candidates.</violation> </file> <file name="java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportFileNameTest.java"> <violation number="1" location="java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportFileNameTest.java:64"> P3: The CountDownLatch/await here is dead code: `runUserActionTask` blocks until the task finishes, so `arr` is already populated and the latch counted down before `cdl.await` runs, and its boolean result is ignored. Drop the latch or, if you want a guard, assert that the task actually ran and that `arr` is non-empty before `arr.get(0)`, otherwise a slow/empty parse fails with an opaque IndexOutOfBoundsException.</violation> </file> ``` </details> <sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/59/ai_pr_review_github_delivery_5f858d55916de13f40998ddf01ed979647815b9a643443dc550d4f9d7483690a?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F59)</sub> <!-- cubic:review-post:ai_pr_review_github_delivery_5f858d55916de13f40998ddf01ed979647815b9a643443dc550d4f9d7483690a:025de041cc540e9908a90f9bd2db3c94cd9f0ddb:d8c1f6c3-9889-548f-8405-5d9e368380a4 -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✗ —
valid · impact medium
findSourceFileName returns null for any non-ClassSymbol, and computeGoToTarget passes resolved.resolved (often a method/field) rather than the outermost type te, so members never get the SourceFile hint. [grounded: diff] [consensus 5/5: valid=5]
valid · impact high
A null String fileName (e.g. for members) passed to ElementOpen.open(info, el, fileName) gets wrapped as {null}. It is added to fnames, which makes fnames.size()>1, so the loop eventually calls findMatchingChild(null, ...) and NPEs on name.equals when no earlier candidate matched (e.g. a binary folder without sources). [grounded: diff] [consensus 5/5: valid=5]
valid · impact low
The new names parameter is in scope but isn't threaded into the attachmentSucceeded path, so the suggested filenames are dropped after sources get attached. [grounded: diff] [consensus 5/5: valid=5]
valid · impact low
The removed check rejected -1 offsets and returned null. Now unresolved elements return a Location clamped to offset 0, which changes what existing getLocation callers receive. [grounded: diff] [consensus 5/5: valid=5]
valid · impact low
The full-name match is always case-sensitive, and the fallback compares an extensionless name to a hint that includes .java. So on case-insensitive filesystems a case-differing file is missed. This is an edge case. [grounded: diff] [consensus 5/5: valid=5]
valid · impact low
GoToSupport now uses the 1.67 ElementOpen overloads. The change bumped the java.source.base dependency to 2.60 but left the java.sourceui run-dependency at 1.63, which is an incomplete change. [grounded: tree java/java.editor/nbproject/project.xml] [consensus 5/5: valid=5]
raw comments (7)
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:291
### Source filename lookup skips non-class elements **High Severity** <!-- DESCRIPTION START --> `findSourceFileName` only inspects `ClassSymbol`, so methods, fields, and constructors always yield `null`. `computeGoToTarget` then passes that unresolved element into `findFileName` even though the enclosing `te` type is already available, so Go to Declaration cannot use the `SourceFile` hint for the common case of navigating to a member. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 651eea1f-f41b-483a-96bc-6efeefafdd07 --> <!-- LOCATIONS START java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java#L282-L291 java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java#L325-L328 LOCATIONS END --> <details> <summary>Additional Locations (1)</summary> - [`java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java#L325-L328`](https://github.com/drape-io/crbench-cursor-2026-09/blob/776ca1d90bbc167308ff7b6f02009798809d5f52/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java#L325-L328) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjdjNDkzOTI3LTVlNmEtNGMwMS1hMDM5LTkxNGE4MDhmNTAxMiIsImVuY3J5cHRpb25LZXkiOiIxX29QOWFPa3ZiLTE0cjl0bDN6TmdqU1c3RzlGdFhWQUh2cDEwWUxlV2xnIiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjdjNDkzOTI3LTVlNmEtNGMwMS1hMDM5LTkxNGE4MDhmNTAxMiIsImVuY3J5cHRpb25LZXkiOiIxX29QOWFPa3ZiLTE0cjl0bDN6TmdqU1c3RzlGdFhWQUh2cDEwWUxlV2xnIiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjYxLCJjb21taXRTaGEiOiI3NzZjYTFkOTBiYmMxNjczMDhmZjdiNmYwMjAwOTc5ODgwOWQ1ZjUyIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:608
### Null suggested name can crash matching **High Severity** <!-- DESCRIPTION START --> A null `fileName` is passed as a varargs `String`, becoming `{null}` rather than an empty list. That null is appended to `fnames` and later used in `name.equals(...)`, which throws a `NullPointerException` instead of falling back to the previous source search. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 40787b44-1023-49d1-b9cf-236fc3f21f3e --> <!-- LOCATIONS START java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java#L602-L614 java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java#L684-L688 java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java#L1261-L1263 LOCATIONS END --> <details> <summary>Additional Locations (2)</summary> - [`java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java#L684-L688`](https://github.com/drape-io/crbench-cursor-2026-09/blob/776ca1d90bbc167308ff7b6f02009798809d5f52/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java#L684-L688) - [`java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java#L1261-L1263`](https://github.com/drape-io/crbench-cursor-2026-09/blob/776ca1d90bbc167308ff7b6f02009798809d5f52/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java#L1261-L1263) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjZjOWQzZWRiLWRjNTQtNGE1ZS1hMjA0LTZkZjUzMTFiNTdjZSIsImVuY3J5cHRpb25LZXkiOiJzbWtQWkVEX0dJY0xURTJyN1BTRGRBbW03OHJyMXNiUFFOcW1XOUFFdXkwIiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjZjOWQzZWRiLWRjNTQtNGE1ZS1hMjA0LTZkZjUzMTFiNTdjZSIsImVuY3J5cHRpb25LZXkiOiJzbWtQWkVEX0dJY0xURTJyN1BTRGRBbW03OHJyMXNiUFFOcW1XOUFFdXkwIiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjYxLCJjb21taXRTaGEiOiI3NzZjYTFkOTBiYmMxNjczMDhmZjdiNmYwMjAwOTc5ODgwOWQ1ZjUyIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
### Attached sources ignore suggested filenames **Medium Severity** <!-- DESCRIPTION START --> After sources are attached, `getOpenInfo` is called with `null` for `names` instead of the suggested filenames already in scope. A source file whose name does not match the class name still cannot be found once the user attaches sources. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 0ccd4576-5755-4463-af28-fe1686533355 --> <!-- LOCATIONS START java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java#L407-L410 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojg3Y2IzM2RkLTA0MjMtNDU2My04MGNhLWJkMDg3MWQ1OGI1OSIsImVuY3J5cHRpb25LZXkiOiJxOEJWUmtrc1EwSmlCYVozcVpvbzk3YXdvdkxGRWlWME9CQkNfNTlHMlg0IiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90Ojg3Y2IzM2RkLTA0MjMtNDU2My04MGNhLWJkMDg3MWQ1OGI1OSIsImVuY3J5cHRpb25LZXkiOiJxOEJWUmtrc1EwSmlCYVozcVpvbzk3YXdvdkxGRWlWME9CQkNfNTlHMlg0IiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjYxLCJjb21taXRTaGEiOiI3NzZjYTFkOTBiYmMxNjczMDhmZjdiNmYwMjAwOTc5ODgwOWQ1ZjUyIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:333
### Missing element yields zero hyperlink offsets **Medium Severity** <!-- DESCRIPTION START --> `getLocation` no longer treats start/end offsets of `-1` as "element not found". Those values are clamped to `0`, so callers receive a location at the beginning of the file instead of `null` when the declaration cannot be resolved. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 80784a2d-76e9-4b14-8fa7-cdc23d9fd164 --> <!-- LOCATIONS START java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java#L323-L335 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjY3YmQ0NWQzLWRlYzUtNDAyMS1iNDQ0LWZlZWFkZGM1NTRjYSIsImVuY3J5cHRpb25LZXkiOiJ2aEtXMVNFQkRnYlpaVm5lVHFsUHh4QVVVU2NrMnVrMVVHb1ZLT2xsRU04IiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjY3YmQ0NWQzLWRlYzUtNDAyMS1iNDQ0LWZlZWFkZGM1NTRjYSIsImVuY3J5cHRpb25LZXkiOiJ2aEtXMVNFQkRnYlpaVm5lVHFsUHh4QVVVU2NrMnVrMVVHb1ZLT2xsRU04IiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjYxLCJjb21taXRTaGEiOiI3NzZjYTFkOTBiYmMxNjczMDhmZjdiNmYwMjAwOTc5ODgwOWQ1ZjUyIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:688
### Filename match is case-sensitive **Medium Severity** <!-- DESCRIPTION START --> The new `name.equals(fo.getNameExt())` check is always case-sensitive. On case-insensitive filesystems the fallback then compares the unextended `fo.getName()` to a name that includes `.java`, so a SourceFile hint such as `Hello.java` does not match `hello.java`. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: eae8a489-8d4d-444d-984e-e8a4856a94ea --> <!-- LOCATIONS START java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java#L684-L690 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmVhMjliYzkwLWYyYmQtNDY2OS04MDJlLWQzNDQyMDAyMjMxNSIsImVuY3J5cHRpb25LZXkiOiJnRlhQWEJkSTVNSnVsRDhudnJUV01LYTBnbGltYW9MRDhodEIzNl9LaEdNIiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmVhMjliYzkwLWYyYmQtNDY2OS04MDJlLWQzNDQyMDAyMjMxNSIsImVuY3J5cHRpb25LZXkiOiJnRlhQWEJkSTVNSnVsRDhudnJUV01LYTBnbGltYW9MRDhodEIzNl9LaEdNIiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjYxLCJjb21taXRTaGEiOiI3NzZjYTFkOTBiYmMxNjczMDhmZjdiNmYwMjAwOTc5ODgwOWQ1ZjUyIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
java/java.editor/nbproject/project.xml:251
### Editor module requires outdated sourceui version **Low Severity** <!-- DESCRIPTION START --> `GoToSupport` calls the new `ElementOpen.open` and `getLocation` overloads added in java.sourceui 1.67, but the module still declares a run-dependency on specification version `1.63`. The module system can therefore enable java.editor against an older java.sourceui and fail at runtime with `NoSuchMethodError`. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: da548dda-978f-4706-87f6-a1a4f3f17e21 --> <!-- LOCATIONS START java/java.editor/nbproject/project.xml#L254-L261 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmVkOGY0MmRhLWVjMWMtNDcwNC05NzEyLTc4ZThhYjg5ODI4YSIsImVuY3J5cHRpb25LZXkiOiJzWTBNaHMzRjhZTWpNZDNpMXA5NEdwZlFnYUxJWnhRcWR2TmpPc21pbFB3IiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmVkOGY0MmRhLWVjMWMtNDcwNC05NzEyLTc4ZThhYjg5ODI4YSIsImVuY3J5cHRpb25LZXkiOiJzWTBNaHMzRjhZTWpNZDNpMXA5NEdwZlFnYUxJWnhRcWR2TmpPc21pbFB3IiwiYnJhbmNoIjoidDItbmV0YmVhbnMtNTE1MiIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjYxLCJjb21taXRTaGEiOiI3NzZjYTFkOTBiYmMxNjczMDhmZjdiNmYwMjAwOTc5ODgwOWQ1ZjUyIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PR-level
<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes using default effort and found 6 potential issues. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTplY2M0MTJmMS1iN2JkLTRmYzEtOWFlZi1kODdiYzY1ZjM4Y2YiLCJlbmNyeXB0aW9uS2V5IjoiN3VkLTBTNVZJM190UTU4T2RKeUpuVWF3aUtlQ1FaVFFrT0RHMTdSYzBDUSIsImJyYW5jaCI6InQyLW5ldGJlYW5zLTUxNTIiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776ca1d90bbc167308ff7b6f02009798809d5f52. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✓ off by one
valid · impact medium
findSourceFileName returns a value only for ClassSymbol. Passing the resolved member element gives a null hint for methods, fields and constructors, so the new file-name lookup works only when the target is a type. `te` is already computed and could be passed instead. [grounded: tree java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java] [consensus 3/3: valid=3]
valid · impact low
The change threads `names` into the first getOpenInfo call but passes null in the attachmentSucceeded retry. After sources are attached, a source file whose name differs from the class name is not found, and the code falls back to generated code. [grounded: tree java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java] [consensus 3/3: valid=3]
valid · impact low
The removed line required openInfo[1] and openInfo[2] to differ from -1. Now an unresolved element yields a Location clamped to offset 0 rather than null, and this applies to every existing caller of getLocation. The change may be intentional, but the behaviour has changed. [grounded: diff] [consensus 3/3: valid=3]
valid · matches d1 · impact medium
valid · impact high
fileName is a String, so a null value passed to the String... parameter becomes names={null}. findSourceForBinary adds null to fnames, so the list size is above 1 and the loop runs. When the class-derived name matches nothing (for example a library method with no source, where only .class children exist), findMatchingChild(null) builds a Match with a null name. Match.apply then calls name.equals and throws a NullPointerException. findFileName returns null for any method or field, so this path is common. [grounded: tree java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java] [consensus 3/3: valid=3]
raw comments (5)
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328
**File-name hint lost when jumping to methods/fields** `findFileName` is given `resolved.resolved`, but `SourceUtils.findSourceFileName` only answers for class symbols. For a method, field or constructor reference the hint is null, so the new lookup by source-file name only works when you click on a type name. Pass the outermost type element `te` to `findFileName`. ``` java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328 String fileName = findFileName(resolved.resolved); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:283 public static String findSourceFileName(Element element) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:284 if (element instanceof ClassSymbol) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:285 ClassSymbol s = (ClassSymbol) element; java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:286 if (s.sourcefile != null) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:287 return s.sourcefile.getName(); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:288 } java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:289 } java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:290 return null; java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:291 } ```
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
**Suggested file names dropped after sources attach** In `attachmentSucceeded`, the retry calls `getOpenInfo` with null instead of `names`. For classes whose source file name differs from the class name, the newly attached sources are not found, and the code falls back to generated code. Pass `names` to the retry `getOpenInfo` call. ``` java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410 Object[] openInfo = getOpenInfo(cpInfo, el, null, cancel); java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:390 Object[] openInfo = getOpenInfo(cpInfo, el, names, cancel); java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:411 if (openInfo != null && (int) openInfo[1] != (-1) && (int) openInfo[2] != (-1) && openInfo[5] != null) { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:412 future.complete(openInfo); java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:413 } else { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:414 attachmentFailed(); ```
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:323
**getLocation returns file start when element missing** `getLocation` used to return null when the element's offsets were -1 (element not found in the file). Now it returns a Location at offset 0 for every caller of this public API, not only the new overload. Was dropping the -1 check intended for all callers? If not, keep it. ``` java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:324 return future.thenApply(openInfo -> { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:325 if (openInfo != null && openInfo[0] != null) { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:326 FileObject file = (FileObject) openInfo[0]; java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:327 int start = (int) openInfo[3]; java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:389 static CompletableFuture<Object[]> getFutureOpenInfo(final ClasspathInfo cpInfo, final ElementHandle<? extends Element> el, String resourceName, AtomicBoolean cancel, boolean acquire, String... names) { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:390 Object[] openInfo = getOpenInfo(cpInfo, el, names, cancel); java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:391 if (openInfo != null) { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:392 return CompletableFuture.completedFuture(openInfo); java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:393 } ```
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:686
**Folder or non-Java file returned as source** The new exact-name shortcut in `Match.apply` skips the `isJava` check. So a child folder or extensionless file named like the class (e.g. `Foo`) now matches the class-name candidate. Apply the exact-name shortcut only to the suggested names, and require `fo.isData()`. ``` java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:686 if (name.equals(fo.getNameExt())) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:687 return true; java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:688 } java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:695 private boolean isJava(final FileObject fo) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:696 return "java".equalsIgnoreCase(fo.getExt()) && fo.isData(); //NOI18N java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:697 } java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:445 if (fo != null && fo.isFolder()) { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:446 fo = fo.getFileObject("package-info.java"); // NOI18N java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:447 } ```
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:1263
**Go to declaration can crash with NullPointerException** When `fileName` is null (any method/field target, or a class with no SourceFile), passing it to the varargs `ElementOpen.open` makes `names = {null}`. If the class-derived name finds no source, `findMatchingChild(null, …)` calls `null.equals(...)` in `Match.apply`. Pass no names when `fileName` is null, and have `findSourceForBinary` skip null entries. The same mistake is at `java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:199`. ``` java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:1262 public boolean open(ClasspathInfo info, ElementHandle<?> el, String fileName) { java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:1263 return ElementOpen.open(info, el, fileName); java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:1264 } java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:285 openSucceeded = CALLER.open(target[0].cpInfo, target[0].elementToOpen, target[0].fileName); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:283 public static String findSourceFileName(Element element) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:284 if (element instanceof ClassSymbol) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:285 ClassSymbol s = (ClassSymbol) element; java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:286 if (s.sourcefile != null) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:287 return s.sourcefile.getName(); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:288 } ```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✓ off by one
valid · impact low
The old guard returned null when offsets were -1. The new code always builds a Location and clamps -1 to 0, so an element that cannot be found now resolves to the top of the file. This may be intentional, but it is a real behaviour change. [grounded: diff] [consensus 3/3: valid=3]
valid · impact high
fileName is null for any element that is not a ClassSymbol (for example methods and fields). Passing it to String... gives {null}, which is added to fnames. Because size>1, the loop calls findMatchingChild(null), and Match.apply then throws an NPE on name.equals. This happens whenever the earlier candidates did not return a match. [grounded: diff] [consensus 3/3: valid=3]
valid · impact medium
GoToSupport now calls ElementOpen overloads marked @since 1.67, but java.editor's run-dependency on java.sourceui still requires only 1.63. [grounded: tree java/java.editor/nbproject/project.xml] [consensus 3/3: valid=3]
valid · matches d1 · impact medium
valid · impact low
The first lookup passes names, but the retry after sources are attached passes null, so the hint is dropped on that path. This is an incomplete threading of the new parameter. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
getGoToLocation in GoToSupport was updated to pass fileName, but the parallel LSP consumer of GoToTarget was not. LSP go-to-definition therefore does not get the new behaviour (incomplete change). [grounded: tree java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java] [consensus 3/3: valid=3]
valid · impact low
findSourceFileName returns null for anything that is not a ClassSymbol. For methods, fields and constructors in binary classes the new hint is therefore always null, even though the enclosing class carries a SourceFile attribute. [grounded: diff] [consensus 3/3: valid=3]
raw comments (7)
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:326
**getLocation returns offset 0 for missing elements** The guard that returned null when the element offsets were -1 was removed from `getLocation`. The -1 offsets are now clamped to 0. Keep the -1 check, or confirm that returning offset 0 is the intended behavior. ``` java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:326 FileObject file = (FileObject) openInfo[0]; java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:327 int start = (int) openInfo[3]; java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:328 if (start < 0) { java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:329 start = Math.max(0, (int) openInfo[1]); ```
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:285
**Null file name becomes {null} and causes NPE** `fileName` is null for methods, fields and classes without SourceFile. Passed to a `String...` parameter it becomes `{null}`, and `Match.apply` then calls `name.equals` on null. Skip null entries when building `fnames`. ``` java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:285 openSucceeded = CALLER.open(target[0].cpInfo, target[0].elementToOpen, target[0].fileName); java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:199 CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName, target[0].fileName); java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:1262 public boolean open(ClasspathInfo info, ElementHandle<?> el, String fileName) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:601 final List<String> fnames = new ArrayList<>(); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:603 if (names != null) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:604 fnames.addAll(Arrays.asList(names)); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:605 } ```
java/java.editor/nbproject/project.xml:260
**java.sourceui dependency not bumped to 1.67** `GoToSupport` now calls `ElementOpen.open(info, el, fileName)` and `ElementOpen.getLocation(..., fileName)`, which exist only since java.sourceui 1.67. The java.editor manifest still requires 1.63, so it can load against an older java.sourceui. Raise the java.sourceui run-dependency specification-version to 1.67. ``` java/java.editor/nbproject/project.xml:248 <build-prerequisite/> java/java.editor/nbproject/project.xml:249 <compile-dependency/> java/java.editor/nbproject/project.xml:250 <run-dependency> java/java.editor/nbproject/project.xml:251 <specification-version>2.60</specification-version> java/java.sourceui/nbproject/project.properties:21 spec.version.base=1.67.0 ```
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:686
**Name match skips the Java file check** `Match.apply` now returns true when `name.equals(fo.getNameExt())` before the `isJava && isData` check. For the default candidate (plain class name, no extension) this matches any child with exactly that name, including a directory. Apply the data-file check to the exact-name match too, or only use exact-name matching for the suggested names. ``` java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:686 if (name.equals(fo.getNameExt())) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:687 return true; java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:688 } ```
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
**Suggested names dropped after source attach** In `getFutureOpenInfo`, the `attachmentSucceeded` callback calls `getOpenInfo(cpInfo, el, null, cancel)`, so the suggested names are lost on the retry after sources are attached. The first lookup used them. Pass `names` in the retry. ``` java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410 Object[] openInfo = getOpenInfo(cpInfo, el, null, cancel); java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:390 Object[] openInfo = getOpenInfo(cpInfo, el, names, cancel); ```
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java:1733
**LSP go-to-definition ignores new source file name** The change adds `GoToTarget.fileName` so a binary class can be opened via its SourceFile name. The LSP `gotoTarget2Location` builds the same GoToTarget but still calls `getLocation` without `target.fileName`. Pass `target.fileName` as the last argument to `ElementOpen.getLocation`. ``` java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:199 CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName, target[0].fileName); java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:327 String resourceName = te != null ? te.getQualifiedName().toString().replace('.', '/') + ".class" : null; java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328 String fileName = findFileName(resolved.resolved); java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:329 return new GoToTarget(-1, java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java:1733 final CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target.cpInfo, target.elementToOpen, target.resourceName); ```
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328
**File name hint only found for classes** `findFileName` calls `SourceUtils.findSourceFileName`, which only handles `ClassSymbol`. For methods, fields and constructors in a binary class, the hint is null even though the enclosing class has a SourceFile name. Use the outermost enclosing class when computing the file name. ``` java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328 String fileName = findFileName(resolved.resolved); java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:283 public static String findSourceFileName(Element element) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:284 if (element instanceof ClassSymbol) { java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:285 ClassSymbol s = (ClassSymbol) element; ```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✓ off by one
valid · impact medium
The change passes `names` into the first getOpenInfo lookup in getFutureOpenInfo but passes null in the retry after source attachment succeeds. If the source file name differs from the class name, the retry cannot find the attached source and falls back to generated code. The change wired the hint through only part of the path, so this counts as an incomplete change. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The removed lines returned null when the offsets were -1. The new code clamps those offsets to 0 and returns a Location. So an element that cannot be resolved now produces a Location at the start of the file instead of null, which changes behaviour for every getLocation caller. [grounded: diff] [consensus 3/3: valid=3]
valid · matches d1 · impact medium
raw comments (4)
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Filename Hint Is Dropped** When source attachment succeeds, this retry passes `null` instead of the caller-provided `names`. For a binary whose source filename differs from its class-derived filename, the retry can miss the attached source and fall back to generated code instead of opening the real file. ```suggestion Object[] openInfo = getOpenInfo(cpInfo, el, names, cancel); ```
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:336
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Unresolved Locations Become Valid** `getOpenInfo` can return a file while its declaration offsets remain `-1`, such as when the element cannot be resolved or no declaration tree is found. This code clamps those offsets to zero and returns a non-null location, so editor and LSP callers navigate to the start of an unresolved or unrelated file instead of treating the location as unavailable. ```suggestion if (openInfo != null && openInfo[0] != null && (int) openInfo[1] != (-1) && (int) openInfo[2] != (-1)) { FileObject file = (FileObject) openInfo[0]; int start = (int) openInfo[3]; if (start < 0) { start = (int) openInfo[1]; } int end = (int) openInfo[4]; if (end < 0) { end = (int) openInfo[2]; } return new Location(file, start, end); } ```
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:691
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Exact Match Bypasses Filtering** The exact-name shortcut returns before checking that the child is a Java data file. Because class-derived candidates omit the `.java` extension, an extensionless child named after the class can be returned as the element's source, causing navigation to use a non-Java file. ```suggestion final boolean apply(final FileObject fo) { if (name.equals(fo.getNameExt())) { return isJava(fo); } final String foName = fo.getName(); return match(foName,name) && isJava(fo); } ```
PR-level
<h3>Greptile Summary</h3> This PR adds source-filename hints derived from class-file `SourceFile` metadata and threads them through Java navigation APIs so declarations can be located when source filenames differ from binary class names. - Adds `SourceUtils.findSourceFileName` and a filename-aware `getFile` overload. - Adds filename-aware `ElementOpen.open` and `getLocation` overloads. - Passes source filenames through editor go-to-definition behavior and adds focused tests. - Raises the Java editor dependency on the updated source API. <h3>Confidence Score: 2/5</h3> This PR is not yet safe to merge because source attachment can discard filename hints, unresolved declarations can become misleading zero-offset locations, and source lookup can return non-Java files. Three navigation regressions remain in the new lookup path: filename hints are lost during attachment retry, invalid declaration offsets are exposed as successful locations, and exact matching bypasses Java-file validation. **Files Needing Attention:** java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java; java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java | Adds source-filename extraction and hinted source lookup, but exact filename matching can return non-Java files. | | java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java | Adds filename-aware opening and location lookup, while dropping hints after attachment and converting unresolved offsets into valid-looking locations. | | java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java | Extracts source filenames from resolved binary elements and forwards them through editor navigation. | | java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportFileNameTest.java | Adds coverage for extracting the original Java filename from a compiled test class. | | java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java | Adds coverage for source filenames from ordinary, nested, dollar-named, and class-file elements. | </details> <details open><summary><h3>Flowchart</h3></summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart LR A[Resolved binary element] --> B[Read SourceFile attribute] B --> C[GoToSupport target] C --> D[ElementOpen] D --> E[SourceUtils.getFile] E --> F{Source available?} F -->|Yes| G[Resolve declaration offsets] F -->|No| H[Attach sources] H --> E G --> I[Open editor or return Location] ``` </details> <!-- greptile_other_comments_section --> <sub>Reviews (1): Last reviewed commit: ["Update java/java.editor/nbproject/projec..."](https://github.com/drape-io/crbench-greptile-2026-09/commit/d5d658df5b47e212e6b83a0cdc49a4fcb039a73a) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=64284679)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✗ —
valid · impact high
GoToSupport passes a String-typed fileName (null for members or classes without a SourceFile) to the varargs method, which produces {null}. findSourceForBinary adds that null to fnames, so the list branch runs. When the class name doesn't match (binary-only class), findMatchingChild(null) builds a Match whose apply calls name.equals(...) and throws an NPE. getFile does not catch it. [grounded: diff] [consensus 3/3: valid=3]
valid · impact medium
findSourceFileName only handles ClassSymbol, so the new file-name hint is always null for methods, fields and constructors, and the feature does not work for member navigation. [grounded: diff] [consensus 3/3: valid=3]
valid · impact high
Same as finding 0: a null hint wrapped by varargs is added as a candidate and causes an NPE in Match.apply via name.equals. [grounded: diff] [consensus 3/3: valid=3]
valid · impact medium
Duplicate of finding 1: the hint is taken from the member element, not from the te type element, so it is null for members. [grounded: tree java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java] [consensus 3/3: valid=3]
valid · impact low
The retry after source attachment passes null rather than the names parameter, so the hint is dropped exactly when sources become available. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
GoToSupport now uses the ElementOpen overloads marked @since 1.67, but the java.sourceui dependency in java.editor was left at 1.63. Only java.source.base was bumped. [grounded: tree java/java.editor/nbproject/project.xml] [consensus 3/3: valid=3]
raw comments (6)
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:602
[P1] A null file name reaches SourceUtils and causes an NPE in Match.apply `GoToSupport` passes `target[0].fileName` as a single `String` into the varargs `ElementOpen.open(info, el, fileName)` and `ElementOpen.getLocation(..., resourceName, fileName)`. When `fileName` is null, Java wraps it as `new String[]{null}`. `findFileName` returns null for every element that is not a `ClassSymbol`, such as methods, fields and constructors, and also for classes that have no `SourceFile` attribute. The array is passed through `SourceUtils.getFile`, and `findSourceForBinary` adds the null to `fnames` with `Arrays.asList(names)`. Because the list then has 2 entries, the multi-candidate loop runs. If the class-name candidate does not match (for example, a library or JDK class with no attached sources), `findMatchingChild(null, ...)` builds `CaseSensitiveMatch(null)`. `apply()` then calls `name.equals(fo.getNameExt())` on the first child of the package folder and throws a `NullPointerException`. `getFile` only catches `IOException`, so Ctrl+click or Go to Declaration on a method or field of a binary-only class fails. Before this change it fell back to `findSource` and source generation. Null entries should be skipped when building `fnames`, or callers should not wrap a null name.
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328
[P2] The file-name hint is computed from the resolved member, not its enclosing class `findFileName(resolved.resolved)` uses `SourceUtils.findSourceFileName`, which only returns a value for a `ClassSymbol`. When the target is a method, field or constructor, the hint is always null. The new lookup by `SourceFile` name, used when the class lives in a file with a different name, therefore only works when the user navigates to the type itself, not to its members. The outermost type element `te`, already computed on the line above, is probably what should be passed. That would also make the hint match the type that `resourceName` refers to.
PR-level
[P1] A null file-name hint is added as a candidate and causes an NPE in `Match.apply` java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:602-605 `GoToSupport` passes `target[0].fileName` as a single `String` argument to the varargs `ElementOpen.open(..., String...)` and `getLocation(..., String...)`, so a null `fileName` turns into `names = {null}` and not an empty array. `findSourceForBinary` only checks whether the array itself is null, so it adds the null element to `fnames`, which forces the list branch. When the class-name candidates don't match anything, it then calls `findMatchingChild(null, ...)`, and `Match.apply` throws an NPE on `name.equals(fo.getNameExt())`. `fileName` is null whenever the resolved element is not a `ClassSymbol`, for example a method, field or constructor, or whenever `sourcefile` is unset. So Ctrl+click on a member of a class from a jar without attached sources, or on a member of a secondary class whose file name differs from the class name, now crashes instead of falling back to the binary/index lookup. The fix is to filter out null entries here, or to avoid passing null from `GoToSupport`.
PR-level
[P2] The source file-name hint is only computed for type elements, never for members java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:328 `findFileName(resolved.resolved)` delegates to `SourceUtils.findSourceFileName`, and that method only handles a `ClassSymbol`. When the user navigates to a method, field or constructor, which is the most common go-to case, the hint is therefore null. The new lookup by file name then never applies, so a member of a class declared in a file with a different name still can't be opened. The `te` (outermost type element) computed just above is the natural element to take the source file name from.
PR-level
[P3] Retry after source attachment drops the suggested file names java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410 `getFutureOpenInfo` uses `names` for its first `getOpenInfo` call. After sources are attached, however, the retry in `attachmentSucceeded` passes `null`. The lookup that runs once sources are actually available ignores the hint, so a class whose source file name differs from its class name may still fail to resolve, or resolve less reliably, in exactly the case this change targets.
PR-level
[P3] java.editor doesn't raise its java.sourceui dependency for the new ElementOpen API java/java.editor/nbproject/project.xml:251 `GoToSupport` now calls the new `ElementOpen.open(ClasspathInfo, ElementHandle, String...)` and `getLocation(..., String...)` overloads, which are documented `@since 1.67`. Only the java.source.base dependency was bumped (to 2.60); the java.sourceui dependency still declares `‹specification-version›1.63‹/specification-version›`. As a result, the module system would accept a java.sourceui that lacks these methods, which would fail at runtime with `NoSuchMethodError`.
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✗ —
valid · impact high
For a method or field, findSourceFileName returns null. GoToSupport passes it as the single varargs argument, so names becomes [null]. That makes fnames.size() at least 2, which sends execution into the candidate loop. If the class-name candidate doesn't match (for example, a binary class with no attached sources), findMatchingChild(null) runs Match.apply, and name.equals(...) throws an NPE. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The java.sourceui run-dependency is still 1.63, while GoToSupport now calls ElementOpen overloads marked @since 1.67. The module system therefore permits an older sourceui that lacks these methods. [grounded: tree java/java.editor/nbproject/project.xml] [consensus 3/3: valid=3]
valid · impact high
This is the same real NPE path as finding 0: a null fileName is wrapped into [null] varargs and later dereferenced in Match.apply. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
This duplicates finding 1: the java.sourceui dependency was not bumped to 1.67 even though the change uses the new 1.67 API. [grounded: tree java/java.editor/nbproject/project.xml] [consensus 3/3: valid=3]
raw comments (4)
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:601
[P1] Null file name leads to NPE when opening declarations `findSourceFileName` returns null for every non-`ClassSymbol` element (methods, fields, etc.) and for class symbols with no `sourcefile`. `GoToSupport` passes that null `String` straight into the `String... names` varargs, in `ElementOpen.open(info, el, fileName)` and `ElementOpen.getLocation(..., fileName)`. Java wraps it as `new String[]{null}`, so the `names != null` guard doesn't help. `findSourceForBinary` then adds the null entry to `fnames` and reaches `Match.apply`, where `name.equals(fo.getNameExt())` throws an NPE. This happens in the multi-candidate loop whenever an earlier candidate doesn't match, or the match fails the `FQN2Files` check. Ctrl-click or Go To Source on a method or field of a binary class would hit this. Filter out null (and empty) names, or make `GoToSupport` pass `new String[0]` when `fileName` is null.
java/java.editor/nbproject/project.xml:251
[P2] java.editor still declares sourceui 1.63 while calling the 1.67 API `GoToSupport` now calls `ElementOpen.open(ClasspathInfo, ElementHandle, String...)` and `ElementOpen.getLocation(..., String...)`. Both are marked `@since 1.67`, but the `java.sourceui` run-dependency in this `project.xml` stays at 1.63. Only the `java.source.base` dependency was bumped, to 2.60. With a 1.63–1.66 `java.sourceui` at runtime, the module still loads and then fails with `NoSuchMethodError` the first time go-to is used. The dependency should be raised to 1.67.
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:285
[P1] Null file name becomes `[null]` varargs and causes NPE in source lookup `target[0].fileName` is a `String`, so passing it to the new `String...` overloads (`ElementOpen.open(info, el, fileName)` here, and `ElementOpen.getLocation(..., resourceName, target[0].fileName)` at line ~199) wraps a null into `new String[]{null}` rather than passing a null/empty array. `SourceUtils.findSourceFileName` returns null whenever the element isn't a `ClassSymbol`, which is the usual case for Go To on methods and fields, and also for classes with no `SourceFile` attribute. `findSourceForBinary` then adds that null to `fnames`, and `Match.apply` calls `name.equals(...)` on a null name. For a binary element whose class file has a source root with children, Go To Source throws an NPE instead of opening. `findSourceForBinary` should ignore null entries, or `GoToSupport` should pass an empty array when `fileName` is null. Separately, `findFileName(resolved.resolved)` should probably look at the outermost enclosing class, otherwise the new hint never applies to members.
java/java.editor/nbproject/project.xml:260
[P2] java.editor still declares java.sourceui ›= 1.63 but now calls the 1.67 API This change bumps the java.source.base run dependency to 2.60, but GoToSupport now calls `ElementOpen.open(ClasspathInfo, ElementHandle, String...)` and `ElementOpen.getLocation(..., String...)`. Both are `@since 1.67`, and the declared dependency on java.sourceui is still `1.63`. Against an older java.sourceui, the module loads but throws `NoSuchMethodError` when Go To runs. The java.sourceui specification-version in this dependency should be raised to 1.67.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 medium ✗ —
valid · impact medium
java.editor's project.xml still declares java.sourceui spec 1.63 (verified in repo) while GoToSupport now calls the ElementOpen.open/getLocation varargs overloads added in 1.67; the diff only bumped java.source.base. [grounded: diff] [consensus 3/3: valid=3]
valid · impact high
findSourceFileName returns null for non-ClassSymbol elements; GoToSupport passes that single null as varargs, so names={null}; fnames gets a null candidate and findMatchingChild(null) builds a Match whose apply calls name.equals(...) → NPE whenever earlier candidates don't match. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The new names parameter is used for the initial lookup but dropped in the attachmentSucceeded retry, so hints are lost after source attachment. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The removed check rejected openInfo[1]/[2] == -1; now unresolved offsets are clamped to 0 and a Location is returned, changing failed lookups into navigation to file start. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
Class-derived candidates are added before the hint names and the loop returns the first match when FQN2Files is unavailable, so a same-named file wins over the SourceFile hint in unindexed roots. [grounded: diff] [consensus 3/3: valid=3]
raw comments (7)
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java:199
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 1\. Partial updates break editor navigation <code>🐞 Bug</code> <code>☼ Reliability</code> <pre> <b><i>GoToSupport</i></b> now invokes the filename-aware <b><i>ElementOpen</i></b> overload introduced at source UI version 1.67, while java.editor still declares a minimum runtime version of 1.63. An installation retaining any compatible 1.63–1.66 source UI module can load java.editor but then fail the changed navigation paths with a missing-method linkage error. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description java.editor calls APIs introduced in java.sourceui 1.67 without raising its declared runtime dependency from 1.63, permitting an incompatible module combination. ## Fix Focus Areas - java/java.editor/nbproject/project.xml[255-260] - java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[199-199] - java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[1262-1263] ## Recommended Fix Raise java.editor's `org.netbeans.modules.java.sourceui` specification-version dependency to 1.67 so the module system rejects installations lacking the invoked overloads. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:287
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 2\. Member navigation misses renamed sources <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>SourceUtils.findSourceFileName</i></b> reads <b><i>sourcefile</i></b> only when the supplied element is itself a <b><i>ClassSymbol</i></b>, while <b><i>GoToSupport.computeGoToTarget</i></b> passes resolved methods, constructors, fields, and other members directly, yielding a null filename hint. When the conventional class-derived filename is absent—particularly for a binary compiled from a differently named source file—the lookup adds that null to its candidates and dereferences it during matching, so both navigation and tooltip location lookup can terminate with an uncaught exception. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description `SourceUtils.findSourceFileName` returns a filename only for a direct `ClassSymbol`, but Go To Definition and tooltip location lookup supply arbitrary resolved elements such as methods, fields, and constructors. This can produce a null filename that is later dereferenced during source matching, especially when the conventional class-derived filename is unavailable. ## Fix Focus Areas - java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[283-290] - java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[325-337] - java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-605] ## Recommended Fix Walk `element.getEnclosingElement()` until reaching the owning `ClassSymbol`, then read its `sourcefile` name. Preserve `null` only when no enclosing class symbol or source-file attribute exists, defensively exclude null suggested names before constructing filename matchers, and add coverage for a member of a class compiled from a differently named source file. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:410
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 3\. Attached sources ignore filename hints <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>getFutureOpenInfo</i></b> uses <b><i>names</i></b> for its initial lookup but passes <b><i>null</i></b> to <b><i>getOpenInfo</i></b> after <b><i>attachmentSucceeded</i></b>, discarding the suggested source filenames. When an archive must first be attached and its source is discoverable only through the <b><i>SourceFile</i></b> name, the retry can select a different file or fail and fall through to generated-source fallback instead of returning the attached declaration. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description The asynchronous source-attachment retry drops the suggested filename hints received by the new `ElementOpen` overload, preventing it from locating attached sources whose filenames differ from the inferred class name. ## Fix Focus Areas - java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[389-410] - java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-620] ## Recommended Fix Capture and pass the original `names` array to `getOpenInfo(cpInfo, el, names, cancel)` inside `attachmentSucceeded`, preserving the same lookup inputs used before attachment. Add a test covering an initially unattached source whose source filename can only be selected through the supplied hint. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java:335
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 4\. Failed lookups navigate to file start <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>ElementOpen.getLocation</i></b> constructs a <b><i>Location</i></b> whenever a file is found, accepting unresolved declaration offsets initialized to <b><i>-1</i></b> and clamping them to <b><i>0</i></b>. When handle resolution or declaration scanning fails but <b><i>getOpenInfo</i></b> still returns a file, Java editor hyperlinks and other non-null-location consumers navigate to or highlight the first character of an unrelated or unlocatable file instead of reporting no target. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description `ElementOpen.getLocation` turns unresolved declaration offsets into `(0,0)`, causing failed symbol resolution to appear as a valid declaration location at the beginning of a file. ## Fix Focus Areas - java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[322-338] - java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[451-458] - java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[506-576] ## Recommended Fix Restore the validity requirement for declaration offsets: return `null` when neither a valid name span nor declaration span was resolved, and only construct a `Location` from verified nonnegative offsets. If a file-level fallback is required for a specific caller, expose it separately rather than representing it as a declaration location at offset zero. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java:605
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended"> 5\. Unindexed sources open the wrong file <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>findSourceForBinary</i></b> appends the supplied <b><i>SourceFile</i></b> name after class-name-derived candidates and returns the first candidate not contradicted by <b><i>FQN2Files</i></b>. When an attached source root has no usable FQN index and contains a same-named <b><i>Outer.java</i></b>, an inner class compiled from a differently named source is opened in that file before its <b><i>SourceFile</i></b> hint is considered. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` Issue description The new source filename hint is checked only after inferred binary-class filenames, so it loses whenever an unindexed source root contains an earlier matching fallback file. Fix Focus Areas - java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-624] - java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[1132-1143] Recommended Fix Add non-null caller-supplied names to the candidate list before inferred class-name candidates, preferably de-duplicating the combined list. Add a test with an unindexed attached root containing both an inferred-name file and the distinct `SourceFile`-named source. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
PR-level
<h3>PR Summary by Qodo</h3> Use class-file source names for Java declaration navigation <code>🐞 Bug fix</code> <code>✨ Enhancement</code> <code>🧪 Tests</code> <code>📝 Documentation</code> <code>⚙️ Configuration changes</code> <code>🕐 40+ Minutes</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <details> <summary>AI Description</summary> <dl> <dd> <br/> ><pre> >• Add source-file metadata APIs and hinted declaration lookup across Java modules. >• Pass class-file SourceFile names through editor navigation to open attached sources. >• Cover source, nested, dollar-named, and binary element resolution with tests. ></pre> </dd> </dl> </details> <details> <summary>Diagram</summary> <dl> <dd> <br/> ```mermaid sequenceDiagram actor User participant Editor as Java Editor participant GoTo as GoToSupport participant Source as SourceUtils participant Open as ElementOpen participant File as Source File User->>Editor: Invoke Go To Editor->>GoTo: Resolve element GoTo->>Source: Read source filename Source-->>GoTo: SourceFile name GoTo->>Open: Open with hint Open->>Source: Locate hinted file Source-->>Open: FileObject Open->>File: Open declaration ``` </dd> </dl> </details> <details> <summary>High-Level Assessment</summary> <dl> <dd> <br/> >The following are alternative approaches to this PR: <details> <summary><b>1. Resolve metadata only in the editor</b></summary> <dl> <dd> - ➕ Would avoid adding public APIs to java.source.base and java.sourceui. - ➕ Could reduce the immediate cross-module change surface. - ➖ Would duplicate source lookup and class-file metadata logic. - ➖ Would couple the editor directly to javac implementation details. - ➖ Other declaration-opening clients could not reuse filename hints. </dd> </dl> </details> <details> <summary><b>2. Store source names in ElementHandle</b></summary> <dl> <dd> - ➕ The filename would travel automatically with every resolved element. - ➕ Callers would not need new filename parameters. - ➖ Would change a foundational handle representation and serialization contract. - ➖ Introduces broader compatibility and persistence risks. - ➖ Source filenames are optional lookup hints rather than element identity. </dd> </dl> </details> >**Recommendation:** Keep the PR&#x27;s approach. SourceUtils is the appropriate shared layer for extracting and applying source filenames, while backward-compatible ElementOpen overloads expose the capability without changing element identity or existing callers. The editor can provide metadata when available and retain current fallback behavior otherwise. </dd> </dl> </details> <details> <summary> Files changed (10) <code> +626 / -407 </code> </summary> <dl> <dd> <br/> <details> <summary>Enhancement (2) <code> +193 / -138 </code></summary> <dl> <dd> <details> <summary>SourceUtils.java<code>Add source metadata and hinted file lookup</code> <code>+125/-99</code></summary> <br/> >Add source metadata and hinted file lookup > ><pre> >• Adds findSourceFileName to read javac ClassSymbol source metadata and a getFile overload accepting candidate filenames. Source attachment lookup now considers supplied names, supports full filename matches, and preserves existing overload behavior. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-750a3a26f00f9dd6a587a69ef9aea85eda5f387ba696059afa4833f8830433e4'>java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java</a> </details> <details> <summary>ElementOpen.java<code>Accept filename hints when opening elements</code> <code>+68/-39</code></summary> <br/> >Accept filename hints when opening elements > ><pre> >• Adds backward-compatible open and getLocation overloads that pass candidate filenames to SourceUtils. Location resolution can now return a file with offsets clamped to zero when an exact declaration span is unavailable. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-f3caea3592386c36b60fd8f63b6cfdde6d72ea96457344153d2417f5201bcddd'>java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java</a> </details> </dd> </dl> </details> <details> <summary>Bug fix (1) <code> +113 / -100 </code></summary> <dl> <dd> <details> <summary>GoToSupport.java<code>Forward source filenames during declaration navigation</code> <code>+113/-100</code></summary> <br/> >Forward source filenames during declaration navigation > ><pre> >• Captures an element&#x27;s originating source filename in GoToTarget and passes it to ElementOpen for synchronous opens and hyperlink locations. The existing constructor remains available while internal callers populate the new filename field. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-ff4a05911df7365e4b65292685dfcdb0c532e77523fc523418b8e487c4566068'>java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java</a> </details> </dd> </dl> </details> <details> <summary>Tests (4) <code> +291 / -168 </code></summary> <dl> <dd> <details> <summary>GoToSupportFileNameTest.java<code>Test filename extraction from compiled editor classes</code> <code>+69/-0</code></summary> <br/> >Test filename extraction from compiled editor classes > ><pre> >• Adds an integration-style unit test that parses the compiled test class and verifies GoToSupport recovers its original Java filename. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-4013dc0dc7f62f934fc6c39339eabadf4c26608bb9e745158582dc218b9372ee'>java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportFileNameTest.java</a> </details> <details> <summary>GoToSupportTest.java<code>Adapt navigation tests to filename-aware opens</code> <code>+96/-98</code></summary> <br/> >Adapt navigation tests to filename-aware opens > ><pre> >• Updates UiUtilsCaller test implementations for the new filename parameter and removes an unused import. Existing navigation assertions and scenarios remain intact. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-84ff03521a16e90c752b39341f4007c78769d4ce3742f633b0371e660dd82c79'>java/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java</a> </details> <details> <summary>SourceUtilsTest.java<code>Cover source filenames across source and class elements</code> <code>+117/-70</code></summary> <br/> >Cover source filenames across source and class elements > ><pre> >• Verifies filename extraction for normal sources, dollar-named classes, nested classes, and a compiled class carrying a SourceFile attribute. Existing source lookup assertions are clarified with separate outer and inner elements. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-5ff476dfd42c8b233d1d2e8279379bcedcca7506fdfacb4371444626efe4e997'>java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java</a> </details> <details> <summary>SourceUtilsTestUtil.java<code>Enable class-file parsing in SourceUtils tests</code> <code>+9/-0</code></summary> <br/> >Enable class-file parsing in SourceUtils tests > ><pre> >• Registers ClassParserFactory and class-file MIME detection in the test lookup so compiled class metadata can be resolved through JavaSource. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-b05566afb4b0089ea50b32e177ac4d3cd9f562c2eceea03f8815787e3ab25dce'>java/java.source.base/test/unit/src/org/netbeans/api/java/source/SourceUtilsTestUtil.java</a> </details> </dd> </dl> </details> <details> <summary>Documentation (2) <code> +28 / -0 </code></summary> <dl> <dd> <details> <summary>apichanges.xml<code>Document source-filename lookup APIs</code> <code>+14/-0</code></summary> <br/> >Document source-filename lookup APIs > ><pre> >• Records the 2.60 API additions for suggested SourceUtils.getFile names and SourceUtils.findSourceFileName. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-154691b787751ab5477f1fc74782a95a8696091937a2ece9e046479f2d0a92d2'>java/java.source.base/apichanges.xml</a> </details> <details> <summary>apichanges.xml<code>Document filename-aware ElementOpen overloads</code> <code>+14/-0</code></summary> <br/> >Document filename-aware ElementOpen overloads > ><pre> >• Records the 1.67 API additions allowing clients to suggest source filenames when opening or locating elements. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-f61320594c5c05ec80beeb7d4923d1db7a324dbf81695cfff187799916c96247'>java/java.sourceui/apichanges.xml</a> </details> </dd> </dl> </details> <details> <summary>Other (1) <code> +1 / -1 </code></summary> <dl> <dd> <details> <summary>project.xml<code>Require Java Source Base 2.60</code> <code>+1/-1</code></summary> <br/> >Require Java Source Base 2.60 > ><pre> >• Raises the runtime dependency to the version introducing source-filename lookup APIs used by the editor. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-5524f74d3d78fb3bd6ec0f94b4a7bdfde751e3479fa7fd210aa8859f4e3a577d'>java/java.editor/nbproject/project.xml</a> </details> </dd> </dl> </details> </dd> </dl> </details>
PR-level
<h3>Code Review by Qodo</h3> <code>🐞 Bugs (5)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <br/> <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> <details> <summary> 1. Partial updates break editor navigation <code>🐞 Bug</code> <code>☼ Reliability</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>GoToSupport</i></b> now invokes the filename-aware <b><i>ElementOpen</i></b> overload introduced at source UI version >1.67, while java.editor still declares a minimum runtime version of 1.63. An installation retaining >any compatible 1.63–1.66 source UI module can load java.editor but then fail the changed navigation >paths with a missing-method linkage error. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[199]](https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-ff4a05911df7365e4b65292685dfcdb0c532e77523fc523418b8e487c4566068R199-R199)</code> > >```diff >+ CompletableFuture<ElementOpen.Location> future = ElementOpen.getLocation(target[0].cpInfo, target[0].elementToOpen, target[0].resourceName, target[0].fileName); >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The new overloads are documented as available since 1.67 and are invoked by the editor, but the >editor module metadata only requires specification version 1.63. ></pre> > > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[85-95]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L85-L95)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[311-323]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L311-L323)</code> > <code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[196-201]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java/#L196-L201)</code> > <code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[1262-1263]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java/#L1262-L1263)</code> > <code>[java/java.editor/nbproject/project.xml[255-260]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/nbproject/project.xml/#L255-L260)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >java.editor calls APIs introduced in java.sourceui 1.67 without raising its declared runtime dependency from 1.63, permitting an incompatible module combination. > >## Fix Focus Areas >- java/java.editor/nbproject/project.xml[255-260] >- java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[199-199] >- java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[1262-1263] > >## Recommended Fix >Raise java.editor's `org.netbeans.modules.java.sourceui` specification-version dependency to 1.67 so the module system rejects installations lacking the invoked overloads. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <details> <summary> 2. Member navigation misses renamed sources <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>SourceUtils.findSourceFileName</i></b> reads <b><i>sourcefile</i></b> only when the supplied element is itself a ><b><i>ClassSymbol</i></b>, while <b><i>GoToSupport.computeGoToTarget</i></b> passes resolved methods, constructors, fields, >and other members directly, yielding a null filename hint. When the conventional class-derived >filename is absent—particularly for a binary compiled from a differently named source file—the >lookup adds that null to its candidates and dereferences it during matching, so both navigation and >tooltip location lookup can terminate with an uncaught exception. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[R284-287]](https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-750a3a26f00f9dd6a587a69ef9aea85eda5f387ba696059afa4833f8830433e4R284-R287)</code> > >```diff >+ if (element instanceof ClassSymbol) { >+ ClassSymbol s = (ClassSymbol) element; >+ if (s.sourcefile != null) { >+ return s.sourcefile.getName(); >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The editor passes the exact element resolved under the cursor to <b><i>findSourceFileName</i></b>, but that API >reads <b><i>ClassSymbol.sourcefile</i></b> only for direct class symbols and therefore returns null for methods, >fields, constructors, and other members. The result is forwarded as a source lookup hint, where null >values can enter the candidate list and <b><i>Match.apply</i></b> invokes <b><i>name.equals</i></b>; because <b><i>getFile</i></b> has >no runtime-exception handler, the citations establish the full path from member resolution to the >uncaught dereference. ></pre> > > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[272-290]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L272-L290)</code> > <code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[298-337]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java/#L298-L337)</code> > <code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[442-480]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java/#L442-L480)</code> > <code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[326-335]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java/#L326-L335)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[283-290]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L283-L290)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-605]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L601-L605)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[627-632]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L627-L632)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[677-690]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L677-L690)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >`SourceUtils.findSourceFileName` returns a filename only for a direct `ClassSymbol`, but Go To Definition and tooltip location lookup supply arbitrary resolved elements such as methods, fields, and constructors. This can produce a null filename that is later dereferenced during source matching, especially when the conventional class-derived filename is unavailable. > >## Fix Focus Areas >- java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[283-290] >- java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[325-337] >- java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-605] > >## Recommended Fix >Walk `element.getEnclosingElement()` until reaching the owning `ClassSymbol`, then read its `sourcefile` name. Preserve `null` only when no enclosing class symbol or source-file attribute exists, defensively exclude null suggested names before constructing filename matchers, and add coverage for a member of a class compiled from a differently named source file. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <details> <summary> 3. Attached sources ignore filename hints <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>getFutureOpenInfo</i></b> uses <b><i>names</i></b> for its initial lookup but passes <b><i>null</i></b> to <b><i>getOpenInfo</i></b> after ><b><i>attachmentSucceeded</i></b>, discarding the suggested source filenames. When an archive must first be >attached and its source is discoverable only through the <b><i>SourceFile</i></b> name, the retry can select a >different file or fail and fall through to generated-source fallback instead of returning the >attached declaration. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[R407-410]](https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-f3caea3592386c36b60fd8f63b6cfdde6d72ea96457344153d2417f5201bcdddR407-R410)</code> > >```diff > @Override > public void attachmentSucceeded() { > try { >- Object[] openInfo = getOpenInfo(cpInfo, el, cancel); >+ Object[] openInfo = getOpenInfo(cpInfo, el, null, cancel); >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The public location API forwards <b><i>names</i></b> into <b><i>getFutureOpenInfo</i></b>, and the initial lookup preserves >them, while the successful source-attachment callback explicitly calls <b><i>getOpenInfo</i></b> with <b><i>null</i></b>; >that value is then forwarded to <b><i>SourceUtils.getFile</i></b>, and failure of the retry invokes >generated-source fallback. ></pre> > > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[322-335]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L322-L335)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[389-410]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L389-L410)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[443-448]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L443-L448)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-624]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L601-L624)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[322-323]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L322-L323)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[411-425]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L411-L425)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >The asynchronous source-attachment retry drops the suggested filename hints received by the new `ElementOpen` overload, preventing it from locating attached sources whose filenames differ from the inferred class name. > >## Fix Focus Areas >- java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[389-410] >- java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-620] > >## Recommended Fix >Capture and pass the original `names` array to `getOpenInfo(cpInfo, el, names, cancel)` inside `attachmentSucceeded`, preserving the same lookup inputs used before attachment. Add a test covering an initially unattached source whose source filename can only be selected through the supplied hint. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <details><summary><ins><strong>View high (1)</strong></ins></summary><br/> <details> <summary> 4. Failed lookups navigate to file start <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>ElementOpen.getLocation</i></b> constructs a <b><i>Location</i></b> whenever a file is found, accepting unresolved >declaration offsets initialized to <b><i>-1</i></b> and clamping them to <b><i>0</i></b>. When handle resolution or >declaration scanning fails but <b><i>getOpenInfo</i></b> still returns a file, Java editor hyperlinks and other >non-null-location consumers navigate to or highlight the first character of an unrelated or >unlocatable file instead of reporting no target. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[R325-335]](https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-f3caea3592386c36b60fd8f63b6cfdde6d72ea96457344153d2417f5201bcdddR325-R335)</code> > >```diff >+ if (openInfo != null && openInfo[0] != null) { > FileObject file = (FileObject) openInfo[0]; > int start = (int) openInfo[3]; > if (start < 0) { >- start = (int) openInfo[1]; >+ start = Math.max(0, (int) openInfo[1]); > } > int end = (int) openInfo[4]; > if (end < 0) { >- end = (int) openInfo[2]; >+ end = Math.max(0, (int) openInfo[2]); > } > return new Location(file, start, end); >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >Offset extraction initializes all relevant positions to <b><i>-1</i></b> and may return without changing them >when handle resolution or declaration scanning fails, while <b><i>getOpenInfo</i></b> can still return the >selected file. The changed mapping accepts that file, clamps the sentinel offsets to zero, >constructs a seemingly valid location, and allows the Java editor to publish it as a hyperlink. ></pre> > > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[322-338]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L322-L338)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[451-458]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L451-L458)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[506-576]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L506-L576)</code> > <code>[java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java[197-202]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java/#L197-L202)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[325-335]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L325-L335)</code> > <code>[java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[506-526]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java/#L506-L526)</code> > <code>[groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/java/ElementDeclaration.java[44-45]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/java/ElementDeclaration.java/#L44-L45)</code> > <code>[enterprise/micronaut/src/org/netbeans/modules/micronaut/hyperlink/MicronautConfigHyperlinkProvider.java[196-199]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/enterprise/micronaut/src/org/netbeans/modules/micronaut/hyperlink/MicronautConfigHyperlinkProvider.java/#L196-L199)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >`ElementOpen.getLocation` turns unresolved declaration offsets into `(0,0)`, causing failed symbol resolution to appear as a valid declaration location at the beginning of a file. > >## Fix Focus Areas >- java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[322-338] >- java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[451-458] >- java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java[506-576] > >## Recommended Fix >Restore the validity requirement for declaration offsets: return `null` when neither a valid name span nor declaration span was resolved, and only construct a `Location` from verified nonnegative offsets. If a file-level fallback is required for a specific caller, expose it separately rather than representing it as a declaration location at offset zero. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> </details> <br/> <img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended"> <details> <summary> 5. Unindexed sources open the wrong file <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>findSourceForBinary</i></b> appends the supplied <b><i>SourceFile</i></b> name after class-name-derived candidates and >returns the first candidate not contradicted by <b><i>FQN2Files</i></b>. When an attached source root has no >usable FQN index and contains a same-named <b><i>Outer.java</i></b>, an inner class compiled from a differently >named source is opened in that file before its <b><i>SourceFile</i></b> hint is considered. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[R601-605]](https://github.com/drape-io/crbench-qodo-2026-09/pull/57/files#diff-750a3a26f00f9dd6a587a69ef9aea85eda5f387ba696059afa4833f8830433e4R601-R605)</code> > >```diff >+ final List<String> fnames = new ArrayList<>(); >+ fnames.addAll(getSourceFileNames(className)); >+ if (names != null) { >+ fnames.addAll(Arrays.asList(names)); >+ } >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >The API documents the new value as the binary class&#x27;s SourceFile attribute, but lookup inserts >inferred <b><i>$</i></b>-stripped class-name candidates first and accepts the first match when no FQN mapping >contradicts it. ></pre> > > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[272-290]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L272-L290)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-624]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L601-L624)</code> > <code>[java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[1132-1143]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java/#L1132-L1143)</code> > <code>[java/java.source.base/src/org/netbeans/modules/java/source/indexing/FQN2Files.java[63-66]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/modules/java/source/indexing/FQN2Files.java/#L63-L66)</code> > <code>[java/java.source.base/src/org/netbeans/modules/java/source/indexing/FQN2Files.java[146-159]](https://github.com/drape-io/crbench-qodo-2026-09/blob/036312e5d2b13758bd331e131370375acf18a180/java/java.source.base/src/org/netbeans/modules/java/source/indexing/FQN2Files.java/#L146-L159)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >Issue description >The new source filename hint is checked only after inferred binary-class filenames, so it loses whenever an unindexed source root contains an earlier matching fallback file. > >Fix Focus Areas >- java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[601-624] >- java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java[1132-1143] > >Recommended Fix >Add non-null caller-supplied names to the candidate list before inferred class-name candidates, preferably de-duplicating the combined list. Add a test with an unindexed attached root containing both an inferred-name file and the distinct `SourceFile`-named source. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-context:start --> <details><summary><strong>Context sources</strong></summary> <div>Review mode: <code>🧠 Deep</code>: This is a bug-dense cross-module behavioral change spanning public APIs, source/class-file resolution, editor navigation, asynchronous opening, and extensive tests, with many independent logic sites where redundant review could catch subtle defects.</div> <!-- qodo-context:end --> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:start --> <details> <summary><strong>Tip of the day</strong></summary> <br/> <pre>💡 Did you know, you can reply &#x27;qodo&#x27; on any finding to push back, ask questions, or dig deeper</pre> <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:end --> <!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/036312e5d2b13758bd331e131370375acf18a180 --> <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>