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:
peter
2016-11-21 12:31:59 +01:00
parent fb22becd6c
commit 97d53e6f9e
@@ -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];
}