This commit is contained in:
Alexey Kudravtsev
2013-02-18 14:44:00 +04:00
parent 0a3b18cac7
commit 0eb25eec20
5 changed files with 16 additions and 12 deletions
@@ -1929,7 +1929,7 @@ public class HighlightUtil extends HighlightUtilBase {
@Nullable
private static HighlightInfo checkReferenceToOurInstanceInsideThisOrSuper(@NotNull final PsiElement expression,
final PsiClass referencedClass,
@NotNull PsiClass referencedClass,
final String resolvedName) {
if (PsiTreeUtil.getParentOfType(expression, PsiReferenceParameterList.class) != null) return null;
PsiElement element = expression.getParent();
@@ -29,6 +29,7 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.*;
import gnu.trove.THashSet;
import gnu.trove.TIntArrayList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
@@ -46,9 +47,8 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
private final PsiElement myArgumentsList;
private final PsiType[] myActualParameterTypes;
public JavaMethodsConflictResolver(PsiExpressionList list) {
myArgumentsList = list;
myActualParameterTypes = list.getExpressionTypes();
public JavaMethodsConflictResolver(@NotNull PsiExpressionList list) {
this(list, list.getExpressionTypes());
}
public JavaMethodsConflictResolver(final PsiElement argumentsList, final PsiType[] actualParameterTypes) {
@@ -26,20 +26,20 @@ import org.jetbrains.annotations.NotNull;
public class MethodResolverProcessor extends MethodCandidatesProcessor {
private boolean myStopAcceptingCandidates = false;
public MethodResolverProcessor(PsiMethodCallExpression place){
public MethodResolverProcessor(@NotNull PsiMethodCallExpression place){
this(place, new PsiConflictResolver[]{new JavaMethodsConflictResolver(place.getArgumentList())});
setArgumentList(place.getArgumentList());
obtainTypeArguments(place);
}
public MethodResolverProcessor(PsiClass classConstr, PsiExpressionList argumentList, PsiElement place) {
public MethodResolverProcessor(PsiClass classConstr, @NotNull PsiExpressionList argumentList, @NotNull PsiElement place) {
super(place, new PsiConflictResolver[]{new JavaMethodsConflictResolver(argumentList)}, new SmartList<CandidateInfo>());
setIsConstructor(true);
setAccessClass(classConstr);
setArgumentList(argumentList);
}
public MethodResolverProcessor(final PsiElement place, final PsiConflictResolver[] resolvers) {
public MethodResolverProcessor(@NotNull PsiElement place, @NotNull PsiConflictResolver[] resolvers) {
super(place, resolvers, new SmartList<CandidateInfo>());
}
@@ -144,12 +144,14 @@ public class PsiScopesUtil {
}
}
public static boolean resolveAndWalk(PsiScopeProcessor processor, PsiJavaCodeReferenceElement ref, @Nullable PsiElement maxScope) {
public static boolean resolveAndWalk(@NotNull PsiScopeProcessor processor,
@NotNull PsiJavaCodeReferenceElement ref,
@Nullable PsiElement maxScope) {
return resolveAndWalk(processor, ref, maxScope, false);
}
public static boolean resolveAndWalk(PsiScopeProcessor processor,
PsiJavaCodeReferenceElement ref,
public static boolean resolveAndWalk(@NotNull PsiScopeProcessor processor,
@NotNull PsiJavaCodeReferenceElement ref,
@Nullable PsiElement maxScope,
boolean incompleteCode) {
final PsiElement qualifier = ref.getQualifier();
@@ -33,7 +33,7 @@ public abstract class RecursionGuard {
@SuppressWarnings("JavaDoc")
@Deprecated
@Nullable
public <T> T doPreventingRecursion(@NotNull Object key, Computable<T> computation) {
public <T> T doPreventingRecursion(@NotNull Object key, @NotNull Computable<T> computation) {
return doPreventingRecursion(key, false, computation);
}
@@ -46,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(@NotNull Object key, boolean memoize, Computable<T> computation);
public abstract <T> T doPreventingRecursion(@NotNull Object key, boolean memoize, @NotNull Computable<T> computation);
/**
* Used in pair with {@link com.intellij.openapi.util.RecursionGuard.StackStamp#mayCacheNow()} to ensure that cached are only the reliable values,
@@ -65,11 +65,13 @@ public abstract class RecursionGuard {
* @return an object representing the current stack state, managed by {@link RecursionManager}
*/
@NotNull
public abstract StackStamp markStack();
/**
* @return the current thread-local stack of keys passed to {@link #doPreventingRecursion(Object, Computable)}
*/
@NotNull
public abstract List<Object> currentStack();
/**