a registry key to turn off PsiClassImplUtil.correctType
authorpeter <peter@jetbrains.com>
Tue, 24 Feb 2015 11:49:50 +0000 (12:49 +0100)
committerpeter <peter@jetbrains.com>
Tue, 24 Feb 2015 11:51:53 +0000 (12:51 +0100)
java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java
platform/util/resources/misc/registry.properties

index 67143a7b73a50bd93cca1a11375c0284d9827159..2a03a31bb3ea4e7233224b05c778bd218ca9da4a 100644 (file)
@@ -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);
         }
       }
index c324e08707382fee14efa6fb96c28b9275e64504..1613d3e292e3e17060e3a24f219b7e8f8a07e0bb 100644 (file)
@@ -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