mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
make capture<? super Object> == Object
This commit is contained in:
@@ -82,7 +82,11 @@ public abstract class PsiClassType extends PsiType {
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (!(obj instanceof PsiClassType)) return false;
|
||||
if (!(obj instanceof PsiClassType)) {
|
||||
return obj instanceof PsiCapturedWildcardType &&
|
||||
((PsiCapturedWildcardType)obj).getLowerBound().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) &&
|
||||
equalsToText(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
}
|
||||
PsiClassType otherClassType = (PsiClassType)obj;
|
||||
|
||||
String className = getClassName();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<T> {}
|
||||
|
||||
class Test {
|
||||
{
|
||||
A<? super Object> queue = null;
|
||||
A<Object> q = queue;
|
||||
queue = q;
|
||||
}
|
||||
}
|
||||
@@ -471,6 +471,10 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
|
||||
}
|
||||
|
||||
public void testSuperObjectCapturedWildcardEquality() throws Exception {
|
||||
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()));
|
||||
assertNotNull(collectionsClass);
|
||||
|
||||
Reference in New Issue
Block a user