Refactor: remove redundant getElementType overrides is PSI

This commit is contained in:
Pavel V. Talanov
2013-08-07 21:27:43 +04:00
parent 24364dd63b
commit 8d07bc60d0
10 changed files with 0 additions and 69 deletions
@@ -17,7 +17,6 @@
package org.jetbrains.jet.lang.psi; package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode; import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.IStubElementType;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
@@ -32,12 +31,6 @@ public class JetAnnotationEntry extends JetElementImplStub<PsiJetAnnotationStub>
super(node); super(node);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.ANNOTATION_ENTRY;
}
public JetAnnotationEntry(@NotNull PsiJetAnnotationStub stub) { public JetAnnotationEntry(@NotNull PsiJetAnnotationStub stub) {
super(stub, JetStubElementTypes.ANNOTATION_ENTRY); super(stub, JetStubElementTypes.ANNOTATION_ENTRY);
} }
@@ -22,7 +22,6 @@ import com.intellij.navigation.ItemPresentationProviders;
import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile; import com.intellij.psi.PsiFile;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.IncorrectOperationException; import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -165,12 +164,6 @@ public class JetClass extends JetTypeParameterListOwnerStub<PsiJetClassStub> imp
return hasModifier(JetTokens.INNER_KEYWORD); return hasModifier(JetTokens.INNER_KEYWORD);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.CLASS;
}
@Override @Override
public void delete() throws IncorrectOperationException { public void delete() throws IncorrectOperationException {
JetPsiUtil.deleteClass(this); JetPsiUtil.deleteClass(this);
@@ -18,13 +18,11 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode; import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.util.IncorrectOperationException; import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@@ -55,12 +53,6 @@ public class JetEnumEntry extends JetClass {
return nameAsDeclaration == null ? null : nameAsDeclaration.getNameIdentifier(); return nameAsDeclaration == null ? null : nameAsDeclaration.getNameIdentifier();
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.ENUM_ENTRY;
}
@Override @Override
public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException { public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
JetObjectDeclarationName nameAsDeclaration = getNameAsDeclaration(); JetObjectDeclarationName nameAsDeclaration = getNameAsDeclaration();
@@ -20,7 +20,6 @@ import com.intellij.lang.ASTNode;
import com.intellij.navigation.ItemPresentation; import com.intellij.navigation.ItemPresentation;
import com.intellij.navigation.ItemPresentationProviders; import com.intellij.navigation.ItemPresentationProviders;
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -106,12 +105,6 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
return null; return null;
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.FUNCTION;
}
@Override @Override
public ItemPresentation getPresentation() { public ItemPresentation getPresentation() {
return ItemPresentationProviders.getItemPresentation(this); return ItemPresentationProviders.getItemPresentation(this);
@@ -20,7 +20,6 @@ import com.intellij.lang.ASTNode;
import com.intellij.navigation.ItemPresentation; import com.intellij.navigation.ItemPresentation;
import com.intellij.navigation.ItemPresentationProviders; import com.intellij.navigation.ItemPresentationProviders;
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.util.IncorrectOperationException; import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -44,12 +43,6 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
super(stub, JetStubElementTypes.OBJECT_DECLARATION); super(stub, JetStubElementTypes.OBJECT_DECLARATION);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.OBJECT_DECLARATION;
}
@Override @Override
public String getName() { public String getName() {
PsiJetObjectStub stub = getStub(); PsiJetObjectStub stub = getStub();
@@ -25,7 +25,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens; import org.jetbrains.jet.lexer.JetTokens;
public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> { public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> {
@@ -46,12 +45,6 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> {
super(stub, nodeType); super(stub, nodeType);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.VALUE_PARAMETER;
}
@Override @Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitParameter(this, data); return visitor.visitParameter(this, data);
@@ -34,12 +34,6 @@ public class JetParameterList extends JetElementImplStub<PsiJetParameterListStub
super(stub, nodeType); super(stub, nodeType);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.VALUE_PARAMETER_LIST;
}
@Override @Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitParameterList(this, data); return visitor.visitParameterList(this, data);
@@ -28,7 +28,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens; import org.jetbrains.jet.lexer.JetTokens;
import java.util.List; import java.util.List;
@@ -52,12 +51,6 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
return visitor.visitProperty(this, data); return visitor.visitProperty(this, data);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.PROPERTY;
}
@Override @Override
public boolean isVar() { public boolean isVar() {
PsiJetPropertyStub stub = getStub(); PsiJetPropertyStub stub = getStub();
@@ -23,7 +23,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.types.Variance; import org.jetbrains.jet.lang.types.Variance;
import org.jetbrains.jet.lexer.JetTokens; import org.jetbrains.jet.lexer.JetTokens;
@@ -71,10 +70,4 @@ public class JetTypeParameter extends JetNamedDeclarationStub<PsiJetTypeParamete
public JetTypeReference getExtendsBound() { public JetTypeReference getExtendsBound() {
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE); return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.TYPE_PARAMETER;
}
} }
@@ -39,12 +39,6 @@ public class JetTypeParameterList extends JetElementImplStub<PsiJetTypeParameter
return Arrays.asList(getStubOrPsiChildren(JetStubElementTypes.TYPE_PARAMETER, JetTypeParameter.ARRAY_FACTORY)); return Arrays.asList(getStubOrPsiChildren(JetStubElementTypes.TYPE_PARAMETER, JetTypeParameter.ARRAY_FACTORY));
} }
@NotNull
@Override
public IStubElementType getElementType() {
return JetStubElementTypes.TYPE_PARAMETER_LIST;
}
@Override @Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitTypeParameterList(this, data); return visitor.visitTypeParameterList(this, data);