some @NotNulls

This commit is contained in:
peter
2011-07-29 19:51:26 +02:00
parent 902e08289a
commit fecd549808
7 changed files with 11 additions and 8 deletions
@@ -722,7 +722,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
}
@Nullable
private static Pair<PsiType, ConstraintType> inferTypeForCompletionFromCallContext(final PsiCallExpression innerMethodCall,
private static Pair<PsiType, ConstraintType> inferTypeForCompletionFromCallContext(@NotNull final PsiCallExpression innerMethodCall,
final PsiExpressionList expressionList,
final PsiCallExpression contextCall,
final PsiTypeParameter typeParameter) {
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.util;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -32,7 +33,7 @@ public abstract class RecursionGuard {
@SuppressWarnings("JavaDoc")
@Deprecated
@Nullable
public <T> T doPreventingRecursion(Object key, Computable<T> computation) {
public <T> T doPreventingRecursion(@NotNull Object key, Computable<T> computation) {
return doPreventingRecursion(key, false, computation);
}
@@ -45,7 +46,7 @@ public abstract class RecursionGuard {
* @return the result of the computation or null if we're entering a computation with this key on this thread recursively,
*/
@Nullable
public abstract <T> T doPreventingRecursion(Object key, boolean memoize, Computable<T> computation);
public abstract <T> T doPreventingRecursion(@NotNull Object key, boolean memoize, Computable<T> computation);
/**
* Used in pair with {@link com.intellij.openapi.util.RecursionGuard.StackStamp#mayCacheNow()} to ensure that cached are only the reliable values,
@@ -18,6 +18,7 @@ package com.intellij.openapi.util;
import com.intellij.reference.SoftReference;
import com.intellij.util.containers.SoftHashMap;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -78,7 +79,7 @@ public class RecursionManager {
public static RecursionGuard createGuard(@NonNls final String id) {
return new RecursionGuard() {
@Override
public <T> T doPreventingRecursion(Object key, boolean memoize, Computable<T> computation) {
public <T> T doPreventingRecursion(@NotNull Object key, boolean memoize, Computable<T> computation) {
MyKey realKey = new MyKey(id, key);
LinkedHashMap<MyKey, Integer> progressMap = ourProgress.get();
if (progressMap.containsKey(realKey)) {
@@ -183,7 +183,7 @@ public class GroovyPsiManager {
}
@Nullable
public static PsiType inferType(PsiElement element, Computable<PsiType> computable) {
public static PsiType inferType(@NotNull PsiElement element, Computable<PsiType> computable) {
List<Object> stack = ourGuard.currentStack();
if (stack.size() > 7) { //don't end up walking the whole project PSI
ourGuard.prohibitResultCaching(stack.get(0));
@@ -23,6 +23,7 @@ import com.intellij.psi.PsiType;
import com.intellij.psi.util.*;
import gnu.trove.TIntHashSet;
import gnu.trove.TIntObjectHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.lang.lexer.TokenSets;
import org.jetbrains.plugins.groovy.lang.psi.GrControlFlowOwner;
@@ -52,7 +53,7 @@ import java.util.List;
public class TypeInferenceHelper {
@Nullable
public static PsiType getInferredType(final GrReferenceExpression refExpr) {
public static PsiType getInferredType(@NotNull final GrReferenceExpression refExpr) {
return RecursionManager.createGuard("refType").doPreventingRecursion(refExpr, true, new Computable<PsiType>() {
@Override
public PsiType compute() {
@@ -128,7 +128,7 @@ public class GrClassImplUtil {
}
@Nullable
private static List<PsiClassType> getImplementsFromDelegate(final GrTypeDefinition grType, final Set<PsiClass> visited) {
private static List<PsiClassType> getImplementsFromDelegate(@NotNull final GrTypeDefinition grType, final Set<PsiClass> visited) {
return RecursionManager.createGuard("groovyDelegateFields").doPreventingRecursion(grType, true, new Computable<List<PsiClassType>>() {
@Override
public List<PsiClassType> compute() {
@@ -667,7 +667,7 @@ public class XmlUtil {
return true;
}
private boolean processXInclude(final boolean deepFlag, final boolean wideFlag, final XmlTag xincludeTag) {
private boolean processXInclude(final boolean deepFlag, final boolean wideFlag, @NotNull final XmlTag xincludeTag) {
final PsiElement[] inclusion = CachedValuesManager.getManager(xincludeTag.getProject()).getCachedValue(xincludeTag, new CachedValueProvider<PsiElement[]>() {
public Result<PsiElement[]> compute() {