JetClassObject#getObjectDeclaration() by stub

This commit is contained in:
Pavel V. Talanov
2014-04-04 18:45:53 +04:00
parent 76608ff01b
commit c5977bff96
@@ -20,7 +20,6 @@ import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
@@ -41,13 +40,7 @@ public class JetClassObject extends JetDeclarationStub<PsiJetPlaceHolderStub<Jet
@NotNull
public JetObjectDeclaration getObjectDeclaration() {
JetObjectDeclaration objectDeclaration = (JetObjectDeclaration) findChildByType(JetNodeTypes.OBJECT_DECLARATION);
assert objectDeclaration != null :
String.format("It should be impossible to produce class object element without object child:\n %s",
this.getParent().getText());
return objectDeclaration;
return getRequiredStubOrPsiChild(JetStubElementTypes.OBJECT_DECLARATION);
}
@Nullable @IfNotParsed