a registry key to turn off PsiClassImplUtil.correctType

This commit is contained in:
peter
2015-02-24 12:51:53 +01:00
parent 7619716220
commit 81f5cc5e4c
2 changed files with 9 additions and 1 deletions
@@ -20,6 +20,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProgressIndicatorProvider;
import com.intellij.openapi.roots.FileIndexFacade;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
@@ -711,6 +712,10 @@ public class PsiClassImplUtil {
@Nullable
public static PsiClassType correctType(PsiClassType originalType, final GlobalSearchScope resolveScope) {
if (!Registry.is("java.correct.class.type.by.place.resolve.scope")) {
return originalType;
}
final PsiClassType.ClassResolveResult originalResolveResult = originalType.resolveGenerics();
PsiClass superClass = originalResolveResult.getElement();
if (superClass == null) {
@@ -746,7 +751,7 @@ public class PsiClassImplUtil {
}
});
if (substitute == null) return null;
substitutor = substitutor.put(typeParameters[i], substitute);
}
}
@@ -257,6 +257,9 @@ java.annotations.inference.nullable.method.description=Restart is required; infe
java.annotations.inference.nullable.method.transitivity=true
java.annotations.inference.nullable.method.transitivity.description=Restart is required; if a method result is a call to a @Nullable method, reports the caller as @Nullable as well
java.correct.class.type.by.place.resolve.scope=true
java.correct.class.type.by.place.resolve.scope.description=When resolving Java references, use the resolve scope of the currently processed source file
documentation.component.editor.font=false
ide.completion.show.better.matching.classes=true