-
Notifications
You must be signed in to change notification settings - Fork 13
Fix NPE in FindImplementersHandler #71
Conversation
Signed-off-by: Valeriy Svydenko <[email protected]>
offset = nameRange.getOffset(); | ||
length = nameRange.getLength(); | ||
} | ||
if (cf == null) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]>
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