mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
distinct prover: do not distinguish raw type arguments from type arguments without params (IDEA-119546)
This commit is contained in:
@@ -104,9 +104,15 @@ public class TypesDistinctProver {
|
||||
for (PsiTypeParameter parameter : substitutor1.getSubstitutionMap().keySet()) {
|
||||
final PsiType substitutedType1 = substitutor1.substitute(parameter);
|
||||
final PsiType substitutedType2 = substitutor2.substitute(parameter);
|
||||
if (substitutedType1 == null && substitutedType2 == null) return false;
|
||||
if (substitutedType1 == null || substitutedType2 == null) {
|
||||
return true;
|
||||
if (substitutedType1 == null && substitutedType2 == null){
|
||||
continue;
|
||||
}
|
||||
|
||||
if (substitutedType1 == null) {
|
||||
if (type2 instanceof PsiClassType && ((PsiClassType)type2).hasParameters()) return true;
|
||||
}
|
||||
else if (substitutedType2 == null) {
|
||||
if (type1 instanceof PsiClassType && ((PsiClassType)type1).hasParameters()) return true;
|
||||
} else {
|
||||
if (provablyDistinct(substitutedType1, substitutedType2, level + 1)) return true;
|
||||
if (substitutedType1 instanceof PsiWildcardType && !((PsiWildcardType)substitutedType1).isBounded()) return true;
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public interface I<K> {
|
||||
}
|
||||
|
||||
abstract class SpringHighlightingTestCase<T extends I>{
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Class<T> getBuilderClass() {
|
||||
return (Class<T>)I.class;
|
||||
}
|
||||
}
|
||||
@@ -334,6 +334,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA116493() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA117827() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA118037() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA119546() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user