From 1fa19e0c06be75e03db014da79e8deec626ae926 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Fri, 16 Dec 2016 16:50:57 +0300 Subject: [PATCH] Annotate PyReferenceOwner.getReference parameter as NotNull --- .../plugins/ipnb/psi/IpnbPyReferenceExpression.java | 2 +- .../src/com/jetbrains/python/psi/PyReferenceOwner.java | 4 ++-- .../documentation/doctest/PyDocReferenceExpression.java | 4 ++-- .../python/psi/impl/PyBinaryExpressionImpl.java | 9 ++++++--- .../python/psi/impl/PyPrefixExpressionImpl.java | 2 +- .../python/psi/impl/PyReferenceExpressionImpl.java | 2 +- .../python/psi/impl/PySubscriptionExpressionImpl.java | 4 ++-- .../python/psi/impl/PyTargetExpressionImpl.java | 2 +- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyReferenceExpression.java b/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyReferenceExpression.java index b7776f3fa90c..dffcd6396b65 100644 --- a/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyReferenceExpression.java +++ b/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyReferenceExpression.java @@ -20,7 +20,7 @@ public class IpnbPyReferenceExpression extends PyReferenceExpressionImpl { @NotNull @Override - public PsiPolyVariantReference getReference(PyResolveContext context) { + public PsiPolyVariantReference getReference(@NotNull PyResolveContext context) { if (isQualified()) { return new PyQualifiedReference(this, context); } diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyReferenceOwner.java b/python/psi-api/src/com/jetbrains/python/psi/PyReferenceOwner.java index 3ab93ab9c8c9..f18dece00f4a 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/PyReferenceOwner.java +++ b/python/psi-api/src/com/jetbrains/python/psi/PyReferenceOwner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -24,5 +24,5 @@ import org.jetbrains.annotations.NotNull; */ public interface PyReferenceOwner extends PyElement { @NotNull - PsiPolyVariantReference getReference(PyResolveContext context); + PsiPolyVariantReference getReference(@NotNull PyResolveContext context); } diff --git a/python/src/com/jetbrains/python/documentation/doctest/PyDocReferenceExpression.java b/python/src/com/jetbrains/python/documentation/doctest/PyDocReferenceExpression.java index f69fa6ec4257..05584a9c6198 100644 --- a/python/src/com/jetbrains/python/documentation/doctest/PyDocReferenceExpression.java +++ b/python/src/com/jetbrains/python/documentation/doctest/PyDocReferenceExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -39,7 +39,7 @@ public class PyDocReferenceExpression extends PyReferenceExpressionImpl { @NotNull @Override - public PsiPolyVariantReference getReference(PyResolveContext context) { + public PsiPolyVariantReference getReference(@NotNull PyResolveContext context) { if (isQualified()) { return new PyQualifiedReference(this, context); } diff --git a/python/src/com/jetbrains/python/psi/impl/PyBinaryExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyBinaryExpressionImpl.java index 9b839b423a29..0c9cb953681b 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyBinaryExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyBinaryExpressionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -31,7 +31,10 @@ import com.jetbrains.python.psi.types.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author yole @@ -119,7 +122,7 @@ public class PyBinaryExpressionImpl extends PyElementImpl implements PyBinaryExp @NotNull @Override - public PsiPolyVariantReference getReference(PyResolveContext context) { + public PsiPolyVariantReference getReference(@NotNull PyResolveContext context) { return new PyOperatorReference(this, context); } diff --git a/python/src/com/jetbrains/python/psi/impl/PyPrefixExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyPrefixExpressionImpl.java index 41173c0526b6..3213f7db5ff9 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyPrefixExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyPrefixExpressionImpl.java @@ -75,7 +75,7 @@ public class PyPrefixExpressionImpl extends PyElementImpl implements PyPrefixExp @NotNull @Override - public PsiPolyVariantReference getReference(PyResolveContext context) { + public PsiPolyVariantReference getReference(@NotNull PyResolveContext context) { return new PyOperatorReference(this, context); } diff --git a/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java index 10f5ab6fcc4a..a9c09a598732 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java @@ -71,7 +71,7 @@ public class PyReferenceExpressionImpl extends PyElementImpl implements PyRefere @NotNull @Override - public PsiPolyVariantReference getReference(PyResolveContext context) { + public PsiPolyVariantReference getReference(@NotNull PyResolveContext context) { // Handle import reference final PsiElement importParent = PsiTreeUtil.getParentOfType(this, PyImportElement.class, PyFromImportStatement.class); if (importParent != null) { diff --git a/python/src/com/jetbrains/python/psi/impl/PySubscriptionExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PySubscriptionExpressionImpl.java index f79369369230..22ee8e7d130a 100644 --- a/python/src/com/jetbrains/python/psi/impl/PySubscriptionExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PySubscriptionExpressionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -111,7 +111,7 @@ public class PySubscriptionExpressionImpl extends PyElementImpl implements PySub @NotNull @Override - public PsiPolyVariantReference getReference(PyResolveContext context) { + public PsiPolyVariantReference getReference(@NotNull PyResolveContext context) { return new PyOperatorReference(this, context); } diff --git a/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java index bb63c93f83ba..791eade41425 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java @@ -563,7 +563,7 @@ public class PyTargetExpressionImpl extends PyBaseElementImpl