diff --git a/platform/core-api/src/com/intellij/psi/tree/IElementType.java b/platform/core-api/src/com/intellij/psi/tree/IElementType.java index 1212d5dc8465..b64d76112220 100644 --- a/platform/core-api/src/com/intellij/psi/tree/IElementType.java +++ b/platform/core-api/src/com/intellij/psi/tree/IElementType.java @@ -194,8 +194,8 @@ public class IElementType { IElementType[] copy; ourRegistryReadLock.lock(); try { - copy = new IElementType[ourCounter]; - System.arraycopy(ourRegistry, 0, copy, 0, ourCounter); + copy = new IElementType[ourCounter - FIRST_TOKEN_INDEX]; + System.arraycopy(ourRegistry, 0, copy, 0, ourCounter - FIRST_TOKEN_INDEX); } finally { ourRegistryReadLock.unlock(); }