From 97d53e6f9ee191349288cd8041ca0429b40af0d0 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 21 Nov 2016 12:30:27 +0100 Subject: [PATCH] EA-86219 - AIOOBE: AstPath$ChildPath.getNode: replace with assertion to avoid it causing reindex (all IOOBEs do, according to FileBasedIndexImpl.getCauseToRebuildIndex) --- .../src/com/intellij/psi/impl/source/tree/AstPath.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/AstPath.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/AstPath.java index 19c4d03e30c3..86bdee26bbc2 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/AstPath.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/AstPath.java @@ -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]; }