Skip to content

Commit 2876e97

Browse files
committed
Fix testBug148215_Messages
Signed-off-by: Rob Stryker <[email protected]>
1 parent 77b3e0d commit 2876e97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/core/search/matching/DOMMethodLocator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,9 @@ public void reportSearchMatch(MatchLocator locator, ASTNode node, SearchMatch ma
13281328
this.pattern instanceof DeclarationOfReferencedMethodsPattern &&
13291329
nodeBinding instanceof IMethodBinding binding &&
13301330
binding.getJavaElement() instanceof IMethod meth) {
1331-
MethodDeclarationMatch declMatch = new MethodDeclarationMatch(meth, refMatch.getAccuracy(), -1, -1, refMatch.getParticipant(), meth.getResource());
1331+
ISourceRange sr = meth.getNameRange();
1332+
MethodDeclarationMatch declMatch = new MethodDeclarationMatch(meth, refMatch.getAccuracy(),
1333+
sr == null ? -1 : sr.getOffset(), sr == null ? -1 : sr.getLength(), refMatch.getParticipant(), meth.getResource());
13321334
if (meth instanceof SourceMethod sourceMeth) {
13331335
ISourceRange nameRange = sourceMeth.getNameRange();
13341336
declMatch.setOffset(nameRange.getOffset());

0 commit comments

Comments
 (0)