junichi11 commented on a change in pull request #3597:
URL: https://github.com/apache/netbeans/pull/3597#discussion_r805219160
##########
File path: ide/csl.api/src/org/netbeans/modules/csl/navigation/ElementNode.java
##########
@@ -242,7 +243,15 @@ public ElementNode getNodeForOffset(int offset) {
Node[] children = ch.getNodes();
for (int i = 0; i < children.length; i++) {
ElementNode c = (ElementNode) children[i];
- if (this.getFileObject() !=
c.getDescription().getElementHandle().getFileObject()) {
+ // The promise of the API is broken at several places in the
+ // codebase and thus this needs to be guarded. The assert is in
+ // place to find the violating places.
+ assert c.getDescription().getElementHandle() != null;
Review comment:
Nice!
--
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