From e3e1219147b25d93559b4b45330849a9a1a9f9f0 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Fri, 15 Jun 2012 12:36:41 +0400 Subject: [PATCH] Stubs - Remove usage of JetExpressionImpl where interface should be used --- .../jet/lang/psi/JetAnnotatedExpression.java | 2 +- .../lang/psi/JetArrayAccessExpression.java | 2 +- .../jet/lang/psi/JetBinaryExpression.java | 4 ++-- .../psi/JetBinaryExpressionWithTypeRHS.java | 2 +- .../jet/lang/psi/JetCallExpression.java | 2 +- .../jet/lang/psi/JetCatchClause.java | 2 +- .../org/jetbrains/jet/lang/psi/JetClass.java | 21 +++++++++++++++++++ .../jet/lang/psi/JetClassInitializer.java | 2 +- .../jet/lang/psi/JetDecomposerPattern.java | 2 +- .../JetDelegatorByExpressionSpecifier.java | 2 +- .../jet/lang/psi/JetExpressionImpl.java | 2 +- .../jet/lang/psi/JetExpressionPattern.java | 2 +- .../jetbrains/jet/lang/psi/JetFunction.java | 2 +- .../jet/lang/psi/JetImportDirective.java | 2 +- .../jet/lang/psi/JetIsExpression.java | 2 +- .../lang/psi/JetLabelQualifiedExpression.java | 2 +- .../lang/psi/JetModifiableBlockHelper.java | 4 ++-- .../psi/JetNotStubbedNamedDeclaration.java | 1 + .../JetNotStubbedTypeParameterListOwner.java | 3 ++- .../jetbrains/jet/lang/psi/JetParameter.java | 2 +- .../lang/psi/JetParenthesizedExpression.java | 2 +- .../jet/lang/psi/JetPostfixExpression.java | 2 +- .../jet/lang/psi/JetPrefixExpression.java | 2 +- .../jetbrains/jet/lang/psi/JetProperty.java | 2 +- .../jet/lang/psi/JetPropertyAccessor.java | 2 +- .../jetbrains/jet/lang/psi/JetPsiUtil.java | 2 +- .../jet/lang/psi/JetQualifiedExpression.java | 4 ++-- .../jet/lang/psi/JetReturnExpression.java | 2 +- .../jet/lang/psi/JetSecondaryConstructor.java | 2 +- .../jet/lang/psi/JetStatementExpression.java | 4 ++-- .../jet/lang/psi/JetStringTemplateEntry.java | 2 +- .../jet/lang/psi/JetStubDeclaration.java | 3 ++- .../jet/lang/psi/JetThrowExpression.java | 2 +- .../lang/psi/JetTypeParameterListOwner.java | 16 ++++++++++++++ .../jet/lang/psi/JetValueArgument.java | 2 +- .../jet/lang/psi/JetWhenConditionInRange.java | 2 +- .../jetbrains/jet/lang/psi/JetWhenEntry.java | 2 +- .../jet/lang/psi/JetWhenExpression.java | 2 +- .../stubs/elements/JetClassElementType.java | 4 ++-- .../stubs/elements/JetFileElementType.java | 2 +- 40 files changed, 82 insertions(+), 42 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.java index e3cdb5ce71b..b976fc8b856 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.java @@ -45,7 +45,7 @@ public class JetAnnotatedExpression extends JetExpressionImpl { @Nullable public JetExpression getBaseExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } public List getAttributeAnnotations() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.java index 64a14b7e2c4..25c9c4c41d5 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.java @@ -57,7 +57,7 @@ public class JetArrayAccessExpression extends JetReferenceExpression { @NotNull public JetExpression getArrayExpression() { - JetExpression baseExpression = findChildByClass(JetExpressionImpl.class); + JetExpression baseExpression = findChildByClass(JetExpression.class); assert baseExpression != null; return baseExpression; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpression.java index a24997e8b44..354732c7a34 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpression.java @@ -43,7 +43,7 @@ public class JetBinaryExpression extends JetExpressionImpl implements JetOperati @NotNull public JetExpression getLeft() { - JetExpression left = findChildByClass(JetExpressionImpl.class); + JetExpression left = findChildByClass(JetExpression.class); assert left != null; return left; } @@ -53,7 +53,7 @@ public class JetBinaryExpression extends JetExpressionImpl implements JetOperati ASTNode node = getOperationReference().getNode().getTreeNext(); while (node != null) { PsiElement psi = node.getPsi(); - if (psi instanceof JetExpressionImpl) { + if (psi instanceof JetExpression) { return (JetExpression) psi; } node = node.getTreeNext(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.java index ccbc9af63d9..c0b0a4b6b78 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.java @@ -42,7 +42,7 @@ public class JetBinaryExpressionWithTypeRHS extends JetExpressionImpl { @NotNull public JetExpression getLeft() { - JetExpression left = findChildByClass(JetExpressionImpl.class); + JetExpression left = findChildByClass(JetExpression.class); assert left != null; return left; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCallExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCallExpression.java index d8e03ed6b68..ef7cbe20157 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCallExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCallExpression.java @@ -48,7 +48,7 @@ public class JetCallExpression extends JetExpressionImpl implements JetCallEleme @Override @Nullable public JetExpression getCalleeExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCatchClause.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCatchClause.java index 785b90bcc33..0054ef79012 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCatchClause.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetCatchClause.java @@ -57,6 +57,6 @@ public class JetCatchClause extends JetElementImpl { @Nullable @IfNotParsed public JetExpression getCatchBody() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java index e637c6b9a79..98b80a11907 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java @@ -151,6 +151,7 @@ public class JetClass extends JetNotStubbedTypeParameterListOwner return hasModifier(JetTokens.ANNOTATION_KEYWORD); } + @NotNull @Override public IStubElementType getElementType() { // TODO (stubs) @@ -183,6 +184,11 @@ public class JetClass extends JetNotStubbedTypeParameterListOwner @Nullable private String getQualifiedName() { + PsiJetClassStub stub = getStub(); + if (stub != null) { + return stub.getQualifiedName(); + } + List parts = new ArrayList(); JetClassOrObject current = this; while (current != null) { @@ -207,6 +213,11 @@ public class JetClass extends JetNotStubbedTypeParameterListOwner */ @NotNull public List getSuperNames() { + PsiJetClassStub stub = getStub(); + if (stub != null) { + return stub.getSuperNames(); + } + final List specifiers = getDelegationSpecifiers(); if (specifiers.size() == 0) return Collections.emptyList(); List result = new ArrayList(); @@ -238,6 +249,16 @@ public class JetClass extends JetNotStubbedTypeParameterListOwner } } + @Override + public String getName() { + PsiJetClassStub stub = getStub(); + if (stub != null) { + return stub.getName(); + } + + return super.getName(); + } + //@Override //public ItemPresentation getPresentation() { // return ItemPresentationProviders.getItemPresentation(this); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java index c8c1606c15a..4f584647a95 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java @@ -39,7 +39,7 @@ public class JetClassInitializer extends JetDeclarationImpl implements JetStatem @NotNull public JetExpression getBody() { - JetExpression body = findChildByClass(JetExpressionImpl.class); + JetExpression body = findChildByClass(JetExpression.class); assert body != null; return body; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDecomposerPattern.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDecomposerPattern.java index 1c3f51259d9..2be142dc39e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDecomposerPattern.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDecomposerPattern.java @@ -31,7 +31,7 @@ public class JetDecomposerPattern extends JetPattern { @Nullable @IfNotParsed public JetExpression getDecomposerExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.java index f6af909c4a7..6f5a77cf75e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.java @@ -40,6 +40,6 @@ public class JetDelegatorByExpressionSpecifier extends JetDelegationSpecifier { @Nullable @IfNotParsed public JetExpression getDelegateExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionImpl.java index c75c66e44db..049bab85bcf 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionImpl.java @@ -42,6 +42,6 @@ abstract class JetExpressionImpl extends JetElementImpl implements JetExpression JetContainerNode containerNode = (JetContainerNode) findChildByType(type); if (containerNode == null) return null; - return containerNode.findChildByClass(JetExpressionImpl.class); + return containerNode.findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionPattern.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionPattern.java index 13ec4bd7bf9..9b9be36d2de 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionPattern.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpressionPattern.java @@ -30,7 +30,7 @@ public class JetExpressionPattern extends JetPattern { @Nullable @IfNotParsed public JetExpression getExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunction.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunction.java index 08e38b6df7e..5720b803cfa 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunction.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunction.java @@ -52,7 +52,7 @@ abstract public class JetFunction extends JetNotStubbedTypeParameterListOwner @Override @Nullable public JetExpression getBodyExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetImportDirective.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetImportDirective.java index 1a6fd82255e..e1ef3fd3145 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetImportDirective.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetImportDirective.java @@ -46,7 +46,7 @@ public class JetImportDirective extends JetElementImpl { @Nullable @IfNotParsed public JetExpression getImportedReference() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetIsExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetIsExpression.java index 5caff578219..14887ecdf6d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetIsExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetIsExpression.java @@ -42,7 +42,7 @@ public class JetIsExpression extends JetExpressionImpl { @NotNull public JetExpression getLeftHandSide() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Nullable @IfNotParsed diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.java index 0cc4ff9bfde..5ede496d7d8 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.java @@ -39,7 +39,7 @@ public class JetLabelQualifiedExpression extends JetExpressionImpl { @Nullable @IfNotParsed public JetExpression getLabeledExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java index b5834b0a30e..8133034391d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java @@ -30,7 +30,7 @@ public final class JetModifiableBlockHelper { * Tested in OutOfBlockModificationTest */ public static boolean shouldChangeModificationCount(PsiElement place) { - JetDeclaration declaration = PsiTreeUtil.getParentOfType(place, JetDeclarationImpl.class, true); + JetDeclaration declaration = PsiTreeUtil.getParentOfType(place, JetDeclaration.class, true); if (declaration != null) { if (declaration instanceof JetNamedFunction) { JetNamedFunction function = (JetNamedFunction) declaration; @@ -61,7 +61,7 @@ public final class JetModifiableBlockHelper { } private static boolean takePartInDeclarationTypeInference(PsiElement place) { - JetDeclaration declaration = PsiTreeUtil.getParentOfType(place, JetDeclarationImpl.class, true); + JetDeclaration declaration = PsiTreeUtil.getParentOfType(place, JetDeclaration.class, true); if (declaration != null) { if (declaration instanceof JetNamedFunction) { JetNamedFunction function = (JetNamedFunction) declaration; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedNamedDeclaration.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedNamedDeclaration.java index 943b9f45b91..2f969bbdcb3 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedNamedDeclaration.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedNamedDeclaration.java @@ -28,6 +28,7 @@ import org.jetbrains.jet.lexer.JetTokens; /** * @author max */ +// TODO: Remove when all named declarations get stubs @Deprecated abstract class JetNotStubbedNamedDeclaration extends JetDeclarationImpl implements JetNamedDeclaration { public JetNotStubbedNamedDeclaration(@NotNull ASTNode node) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedTypeParameterListOwner.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedTypeParameterListOwner.java index 7a0fb034082..e1e84180a54 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedTypeParameterListOwner.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNotStubbedTypeParameterListOwner.java @@ -27,8 +27,9 @@ import java.util.List; /** * @author max */ +// TODO: Remove when all implementations of JetTypeParameterListOwner get stubs @Deprecated -class JetNotStubbedTypeParameterListOwner extends JetNotStubbedNamedDeclaration implements JetTypeParameterListOwner { +abstract class JetNotStubbedTypeParameterListOwner extends JetNotStubbedNamedDeclaration implements JetTypeParameterListOwner { public JetNotStubbedTypeParameterListOwner(@NotNull ASTNode node) { super(node); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParameter.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParameter.java index 0b7efc45bf0..7cb50083c6c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParameter.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParameter.java @@ -51,7 +51,7 @@ public class JetParameter extends JetNotStubbedNamedDeclaration { ASTNode child = getNode().getFirstChildNode(); while (child != null) { if (child.getElementType() == JetTokens.EQ) passedEQ = true; - if (passedEQ && child.getPsi() instanceof JetExpressionImpl) { + if (passedEQ && child.getPsi() instanceof JetExpression) { return (JetExpression) child.getPsi(); } child = child.getTreeNext(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.java index 9538aef06d8..ee81c61d9b2 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.java @@ -40,6 +40,6 @@ public class JetParenthesizedExpression extends JetExpressionImpl { @Nullable @IfNotParsed public JetExpression getExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java index aa4ca2a1359..9659a1a028d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java @@ -29,7 +29,7 @@ public class JetPostfixExpression extends JetUnaryExpression { @NotNull public JetExpression getBaseExpression() { - JetExpression answer = findChildByClass(JetExpressionImpl.class); + JetExpression answer = findChildByClass(JetExpression.class); assert answer != null; return answer; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java index 0364a40ab13..6f9c9ab687e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java @@ -42,7 +42,7 @@ public class JetPrefixExpression extends JetUnaryExpression { @Nullable @IfNotParsed public JetExpression getBaseExpression() { PsiElement expression = getOperationReference().getNextSibling(); - while (expression != null && !(expression instanceof JetExpressionImpl)) { + while (expression != null && !(expression instanceof JetExpression)) { expression = expression.getNextSibling(); } return (JetExpression) expression; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetProperty.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetProperty.java index 924be214f79..2edf63e88dc 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetProperty.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetProperty.java @@ -130,7 +130,7 @@ public class JetProperty extends JetNotStubbedTypeParameterListOwner implements @Nullable public JetExpression getInitializer() { PsiElement eq = findChildByType(EQ); - return PsiTreeUtil.getNextSiblingOfType(eq, JetExpressionImpl.class); + return PsiTreeUtil.getNextSiblingOfType(eq, JetExpression.class); } @NotNull diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPropertyAccessor.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPropertyAccessor.java index 5b7ec411166..f57a2e0b109 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPropertyAccessor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPropertyAccessor.java @@ -74,7 +74,7 @@ public class JetPropertyAccessor extends JetDeclarationImpl implements JetDeclar @Nullable @Override public JetExpression getBodyExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java index 21e1fe639b1..cf249e15c53 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java @@ -180,7 +180,7 @@ public class JetPsiUtil { if (parent instanceof JetFile) { firstPart = getFQName((JetFile) parent); } - else if (parent instanceof JetNotStubbedNamedDeclaration) { + else if (parent instanceof JetNamedDeclaration) { firstPart = getFQName((JetNamedDeclaration) parent); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetQualifiedExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetQualifiedExpression.java index 1f417384b19..ae4a4234661 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetQualifiedExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetQualifiedExpression.java @@ -33,7 +33,7 @@ public abstract class JetQualifiedExpression extends JetExpressionImpl { @NotNull public JetExpression getReceiverExpression() { - JetExpression left = findChildByClass(JetExpressionImpl.class); + JetExpression left = findChildByClass(JetExpression.class); assert left != null; return left; } @@ -43,7 +43,7 @@ public abstract class JetQualifiedExpression extends JetExpressionImpl { ASTNode node = getOperationTokenNode(); while (node != null) { PsiElement psi = node.getPsi(); - if (psi instanceof JetExpressionImpl) { + if (psi instanceof JetExpression) { return (JetExpression) psi; } node = node.getTreeNext(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetReturnExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetReturnExpression.java index 82562f5b65b..dd01febefd5 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetReturnExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetReturnExpression.java @@ -40,6 +40,6 @@ public class JetReturnExpression extends JetLabelQualifiedExpression implements @Nullable public JetExpression getReturnedExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.java index 61bb31ee91b..c5889dcb903 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.java @@ -68,7 +68,7 @@ public class JetSecondaryConstructor extends JetDeclarationImpl implements JetDe @Override public JetExpression getBodyExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStatementExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStatementExpression.java index b3792bc7af8..6efefd8cc4c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStatementExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStatementExpression.java @@ -22,10 +22,10 @@ package org.jetbrains.jet.lang.psi; */ /** - * This is an interface to show that {@link JetExpressionImpl} is not + * This is an interface to show that {@link JetExpression} is not * actually an expression (in meaning that this expression can be placed after "val x = "). * This is possibly redundant interface, all inheritors of this interface should be refactored that they are not - * {@link JetExpressionImpl}, after such refactoring, this interface can be removed. + * {@link JetExpression}, after such refactoring, this interface can be removed. */ public interface JetStatementExpression { } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.java index f948dacfc8b..766bb47a77b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.java @@ -30,7 +30,7 @@ public abstract class JetStringTemplateEntry extends JetElementImpl { @Nullable public JetExpression getExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStubDeclaration.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStubDeclaration.java index 328507a2407..d7895cc99d1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStubDeclaration.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetStubDeclaration.java @@ -19,6 +19,7 @@ package org.jetbrains.jet.lang.psi; import com.intellij.extapi.psi.StubBasedPsiElementBase; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; +import com.intellij.psi.StubBasedPsiElement; import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import org.jetbrains.annotations.NotNull; @@ -28,7 +29,7 @@ import org.jetbrains.jet.lexer.JetToken; /** * @author Nikolay Krasko */ -abstract class JetStubDeclaration extends StubBasedPsiElementBase implements JetDeclaration { +abstract class JetStubDeclaration extends StubBasedPsiElementBase implements JetDeclaration, StubBasedPsiElement { public JetStubDeclaration(@NotNull T stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetThrowExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetThrowExpression.java index 4e8f721e9b7..624f36f8b6f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetThrowExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetThrowExpression.java @@ -40,6 +40,6 @@ public class JetThrowExpression extends JetExpressionImpl { @Nullable @IfNotParsed public JetExpression getThrownExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.java index 06234fa1725..01d20696cf8 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.java @@ -1,3 +1,19 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.jet.lang.psi; import org.jetbrains.annotations.NotNull; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetValueArgument.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetValueArgument.java index 4628d137d20..f9314f68e30 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetValueArgument.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetValueArgument.java @@ -44,7 +44,7 @@ public class JetValueArgument extends JetElementImpl implements ValueArgument { @Override @Nullable @IfNotParsed public JetExpression getArgumentExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.java index ff907db37b3..c6250e8ccd5 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.java @@ -41,7 +41,7 @@ public class JetWhenConditionInRange extends JetWhenCondition { ASTNode node = getOperationReference().getNode().getTreeNext(); while (node != null) { PsiElement psi = node.getPsi(); - if (psi instanceof JetExpressionImpl) { + if (psi instanceof JetExpression) { return (JetExpression) psi; } node = node.getTreeNext(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenEntry.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenEntry.java index 2f2729fbda0..4f485c91002 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenEntry.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenEntry.java @@ -41,7 +41,7 @@ public class JetWhenEntry extends JetElementImpl { @Nullable public JetExpression getExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenExpression.java index b3b8ba04664..18b5f58c892 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetWhenExpression.java @@ -40,7 +40,7 @@ public class JetWhenExpression extends JetExpressionImpl { @Nullable public JetExpression getSubjectExpression() { - return findChildByClass(JetExpressionImpl.class); + return findChildByClass(JetExpression.class); } @Override diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.java index 0bf8e87b0ae..8d170a7c6b4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.java @@ -51,8 +51,8 @@ public class JetClassElementType extends JetStubElementType { - public static final int STUB_VERSION = 4; + public static final int STUB_VERSION = 5; public JetFileElementType() { super("jet.FILE", JetLanguage.INSTANCE);