mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-86219 - AIOOBE: AstPath$ChildPath.getNode: replace with assertion
to avoid it causing reindex (all IOOBEs do, according to FileBasedIndexImpl.getCauseToRebuildIndex)
This commit is contained in:
@@ -148,9 +148,15 @@ public abstract class AstPath extends SubstrateRef {
|
||||
@Override
|
||||
public CompositeElement getNode() {
|
||||
CompositeElement parentNode = myParent.getNode();
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
parentNode.getFirstChildNode(); // expand chameleons, populate PATH_CHILDREN array
|
||||
CompositeElement[] children = parentNode.getUserData(PATH_CHILDREN);
|
||||
assert children != null : parentNode + " of " + parentNode.getClass();
|
||||
if (children == null) {
|
||||
throw new AssertionError(parentNode + " of " + parentNode.getClass());
|
||||
}
|
||||
if (myIndex >= children.length) {
|
||||
throw new AssertionError(myIndex + " >= " + children.length + "; " + parentNode + " of " + parentNode.getClass());
|
||||
}
|
||||
return children[myIndex];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user