diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.java index 92fe0bf6fe8..05bce5e4f53 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.java @@ -18,12 +18,24 @@ package org.jetbrains.jet.lang.psi; import com.intellij.lang.ASTNode; import com.intellij.psi.stubs.IStubElementType; +import com.intellij.util.ArrayFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub; public class JetDelegationSpecifier extends JetElementImplStub> { + + private static final JetDelegationSpecifier[] EMPTY_ARRAY = new JetDelegationSpecifier[0]; + + public static ArrayFactory ARRAY_FACTORY = new ArrayFactory() { + @NotNull + @Override + public JetDelegationSpecifier[] create(int count) { + return count == 0 ? EMPTY_ARRAY : new JetDelegationSpecifier[count]; + } + }; + public JetDelegationSpecifier(@NotNull ASTNode node) { super(node); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.java index 3618abcd6cb..3d989fadd06 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.java @@ -17,12 +17,11 @@ package org.jetbrains.jet.lang.psi; import com.intellij.lang.ASTNode; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.util.PsiTreeUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; +import java.util.Arrays; import java.util.List; public class JetDelegationSpecifierList extends JetElementImplStub> { @@ -40,6 +39,6 @@ public class JetDelegationSpecifierList extends JetElementImplStub getDelegationSpecifiers() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, JetDelegationSpecifier.class); + return Arrays.asList(getStubOrPsiChildren(JetStubElementTypes.DELEGATION_SPECIFIER_TYPES, JetDelegationSpecifier.ARRAY_FACTORY)); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java index 554e5a83043..ac0ce0f7f27 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java @@ -98,4 +98,6 @@ public interface JetStubElementTypes { TokenSet DECLARATION_TYPES = TokenSet.create(CLASS, OBJECT_DECLARATION, CLASS_OBJECT, FUNCTION, PROPERTY, ANONYMOUS_INITIALIZER, ENUM_ENTRY); + + TokenSet DELEGATION_SPECIFIER_TYPES = TokenSet.create(DELEGATOR_BY, DELEGATOR_SUPER_CALL, DELEGATOR_SUPER_CLASS, THIS_CALL); }