mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
generics: raw type should not be equal to param type (IDEA-60170)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import java.util.*;
|
||||
import Node.Details;
|
||||
|
||||
public class Node<E> {
|
||||
public class Details {
|
||||
public E data;
|
||||
}
|
||||
public Details addNode(Node<E> child) {
|
||||
return new Details();
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Map<String, Details> m = null;
|
||||
Map<String, Node.Details> sorted1;
|
||||
sorted1 = m;
|
||||
}
|
||||
}
|
||||
@@ -101,6 +101,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testWildcardCastConversion() throws Exception { doTest(false); }
|
||||
public void testTypeWithinItsWildcardBound() throws Exception { doTest(false); }
|
||||
public void testMethodSignatureEquality() throws Exception { doTest(false); }
|
||||
public void testInnerClassRef() throws Exception { doTest(false); }
|
||||
|
||||
public void testJavaUtilCollections() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
@@ -73,7 +73,9 @@ public abstract class PsiClassType extends PsiType {
|
||||
String className = getClassName();
|
||||
String otherClassName = otherClassType.getClassName();
|
||||
if (!Comparing.equal(className, otherClassName)) return false;
|
||||
|
||||
final PsiType[] parameters = getParameters();
|
||||
final PsiType[] otherParameters = otherClassType.getParameters();
|
||||
if (parameters.length != otherParameters.length) return false;
|
||||
final ClassResolveResult result = resolveGenerics();
|
||||
final ClassResolveResult otherResult = otherClassType.resolveGenerics();
|
||||
if (result == otherResult) return true;
|
||||
@@ -84,7 +86,7 @@ public abstract class PsiClassType extends PsiType {
|
||||
return aClass == otherClass;
|
||||
}
|
||||
return aClass.getManager().areElementsEquivalent(aClass, otherClass) &&
|
||||
PsiUtil.equalOnEquivalentClasses(result.getSubstitutor(), aClass, otherResult.getSubstitutor(), otherClass);
|
||||
(parameters.length == 0 || PsiUtil.equalOnEquivalentClasses(result.getSubstitutor(), aClass, otherResult.getSubstitutor(), otherClass));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user