Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.

Fix NPE in FindImplementersHandler #71

Merged
merged 2 commits into from
Aug 27, 2018
Merged

Fix NPE in FindImplementersHandler #71

merged 2 commits into from
Aug 27, 2018

Conversation

svor
Copy link
Contributor

@svor svor commented Aug 22, 2018

Signed-off-by: Valeriy Svydenko [email protected]
Sets source range with values: length == 0 and offset == 0 if it is not possible to calculate for source member.

Related issue: eclipse-che/che#10857

@svor svor self-assigned this Aug 22, 2018
@svor svor requested a review from tsmaeder August 22, 2018 12:09
offset = nameRange.getOffset();
length = nameRange.getLength();
}
if (cf == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"if (unit != null) {" would be clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -85,6 +94,55 @@ static SymbolKind mapKind(IJavaElement element) {
return DocumentSymbolHandler.mapKind(element);
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move this here? It's only ever used in FindImplementersHandler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be useful to solve: eclipse-che/che#10874

}
}

@SuppressWarnings("restriction")
private static SymbolInformation convertToSymbolInformation(IJavaElement javaElement)
throws JavaModelException {
private static SymbolInformation convertToSymbolInformation(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand it correctly, both call sites us the same method to compute the location. Why not just move it inside the "convertToSymbolInformation" method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Signed-off-by: Valeriy Svydenko <[email protected]>
@svor svor merged commit 4c8217e into master Aug 27, 2018
@svor svor deleted the 10857 branch August 27, 2018 15:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants