From 184e12ec193865f8acb314f4515168d43c8c2d30 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Mon, 18 Aug 2014 23:49:12 +0400 Subject: [PATCH] Added nullity annotations --- python/psi-api/src/com/jetbrains/python/psi/PyAnnotation.java | 1 + python/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyAnnotation.java b/python/psi-api/src/com/jetbrains/python/psi/PyAnnotation.java index a6182fb2eb65..cb37c46cac68 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/PyAnnotation.java +++ b/python/psi-api/src/com/jetbrains/python/psi/PyAnnotation.java @@ -23,6 +23,7 @@ import org.jetbrains.annotations.Nullable; * @author yole */ public interface PyAnnotation extends PyElement, StubBasedPsiElement { + @Nullable PyExpression getValue(); @Nullable diff --git a/python/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java b/python/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java index f3c806dac7c5..2a95c2bdcbf0 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java @@ -24,6 +24,7 @@ import com.jetbrains.python.psi.PyClass; import com.jetbrains.python.psi.PyExpression; import com.jetbrains.python.psi.PyReferenceExpression; import com.jetbrains.python.psi.stubs.PyAnnotationStub; +import org.jetbrains.annotations.Nullable; /** * @author yole @@ -37,11 +38,13 @@ public class PyAnnotationImpl extends PyBaseElementImpl implem super(stub, PyElementTypes.ANNOTATION); } + @Nullable @Override public PyExpression getValue() { return findChildByClass(PyExpression.class); } + @Nullable @Override public PyClass resolveToClass() { PyExpression expr = getValue();