Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Oct 31, 2024
1 parent 9303eda commit e25332f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,9 @@ private SearchMatch toMatch(org.eclipse.jdt.core.dom.ASTNode node, int accuracy,
}
if (node instanceof MethodInvocation method) {
IJavaElement enclosing = DOMASTNodeUtils.getEnclosingJavaElement(node.getParent());
return new MethodReferenceMatch(enclosing, accuracy, method.getName().getStartPosition(), method.getStartPosition() + method.getLength() - method.getName().getStartPosition(), false, method.resolveMethodBinding().isSynthetic(), false, insideDocComment(node), getParticipant(), resource);
IMethodBinding mb = method.resolveMethodBinding();
boolean isSynthetic = mb != null && mb.isSynthetic();
return new MethodReferenceMatch(enclosing, accuracy, method.getName().getStartPosition(), method.getStartPosition() + method.getLength() - method.getName().getStartPosition(), false, isSynthetic, false, insideDocComment(node), getParticipant(), resource);
}
if (node instanceof SuperMethodInvocation method) {
return new MethodReferenceMatch(DOMASTNodeUtils.getEnclosingJavaElement(node.getParent()), accuracy, method.getName().getStartPosition(), method.getStartPosition() + method.getLength() - method.getName().getStartPosition(), false, method.resolveMethodBinding().isSynthetic(), true, insideDocComment(node), getParticipant(), resource);
Expand Down

0 comments on commit e25332f

Please sign in to comment.