From 8a0f01116a3ca96fcd93e37fd13f396d8f3fa62c Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Fri, 2 Aug 2013 15:54:01 +0400 Subject: [PATCH] Fixed nullness annotations --- .../python/findUsages/PyUsageTypeProvider.java | 2 +- .../python/psi/impl/CallArgumentsMappingImpl.java | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/python/src/com/jetbrains/python/findUsages/PyUsageTypeProvider.java b/python/src/com/jetbrains/python/findUsages/PyUsageTypeProvider.java index 23a538cb632e..9114b10c3d84 100644 --- a/python/src/com/jetbrains/python/findUsages/PyUsageTypeProvider.java +++ b/python/src/com/jetbrains/python/findUsages/PyUsageTypeProvider.java @@ -74,7 +74,7 @@ public class PyUsageTypeProvider implements UsageTypeProviderEx { } @Nullable - private static UsageType checkMatchingSignatureGroup(PyCallExpression call, UsageTarget[] targets, TypeEvalContext context) { + private static UsageType checkMatchingSignatureGroup(PyCallExpression call, UsageTarget[] targets, @NotNull TypeEvalContext context) { if (targets.length == 1 && targets[0] instanceof PsiElementUsageTarget) { final PsiElement element = ((PsiElementUsageTarget)targets[0]).getElement(); if (element instanceof PyFunction) { diff --git a/python/src/com/jetbrains/python/psi/impl/CallArgumentsMappingImpl.java b/python/src/com/jetbrains/python/psi/impl/CallArgumentsMappingImpl.java index e8cddd605855..1df8ec4b5d62 100644 --- a/python/src/com/jetbrains/python/psi/impl/CallArgumentsMappingImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/CallArgumentsMappingImpl.java @@ -49,7 +49,7 @@ public class CallArgumentsMappingImpl implements CallArgumentsMapping { * @param resolved_callee what to map parameters of * @param context optional shared type evaluator / cache. */ - public void mapArguments(PyCallExpression.PyMarkedCallee resolved_callee, @Nullable TypeEvalContext context) { + public void mapArguments(PyCallExpression.PyMarkedCallee resolved_callee, @NotNull TypeEvalContext context) { PyExpression[] arguments = myArgumentList.getArguments(); myMarkedCallee = resolved_callee; List unmatched_args = new LinkedList(); @@ -206,11 +206,9 @@ public class CallArgumentsMappingImpl implements CallArgumentsMapping { if (cnt < parameters.length && cnt < positional_index && myTupleArg != null) { // check length of myTupleArg PyType tuple_arg_type = null; - if (context != null) { - final PyExpression expression = PsiTreeUtil.getChildOfType(myTupleArg, PyExpression.class); - if (expression != null) { - tuple_arg_type = context.getType(expression); - } + final PyExpression expression = PsiTreeUtil.getChildOfType(myTupleArg, PyExpression.class); + if (expression != null) { + tuple_arg_type = context.getType(expression); } int tuple_length; boolean tuple_length_known;