mbien commented on code in PR #9173:
URL: https://github.com/apache/netbeans/pull/9173#discussion_r2741144068
##########
java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java:
##########
@@ -5996,7 +5996,7 @@ private Set<? extends TypeMirror> getSmartTypesImpl(Env
env) throws IOException
path = new TreePath(path, mid);
TypeMirror typeMirror =
controller.getTrees().getTypeMirror(path);
final ExecutableType midTM = typeMirror != null &&
typeMirror.getKind() == TypeKind.EXECUTABLE ? (ExecutableType) typeMirror :
null;
- final ExecutableElement midEl = midTM == null ? null :
(ExecutableElement) controller.getTrees().getElement(path);
+ final ExecutableElement midEl = midTM != null &&
controller.getTrees().getElement(path) instanceof ExecutableElement ee ? ee :
null;
Review Comment:
`midEl` and `midTM` are only used in
https://github.com/apache/netbeans/blob/2fba977d4a4114ee346f34b0213a19948481a1dd/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java#L6427
which is ok with any combination of null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists