mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
check overriding in correct order (IDEA-97506)
This commit is contained in:
@@ -215,15 +215,15 @@ public class PsiSuperMethodImplUtil {
|
||||
LOG.assertTrue(copy.getMethod().isValid());
|
||||
map.put(signature, copy);
|
||||
}
|
||||
else if (isSuperMethod(aClass, existing, hierarchicalMethodSignature)) {
|
||||
mergeSupers(existing, hierarchicalMethodSignature);
|
||||
}
|
||||
else if (isReturnTypeIsMoreSpecificThan(hierarchicalMethodSignature, existing) && isSuperMethod(aClass, hierarchicalMethodSignature, existing)) {
|
||||
HierarchicalMethodSignatureImpl newSuper = copy(hierarchicalMethodSignature);
|
||||
mergeSupers(newSuper, existing);
|
||||
LOG.assertTrue(newSuper.getMethod().isValid());
|
||||
map.put(signature, newSuper);
|
||||
}
|
||||
else if (isSuperMethod(aClass, existing, hierarchicalMethodSignature)) {
|
||||
mergeSupers(existing, hierarchicalMethodSignature);
|
||||
}
|
||||
// just drop an invalid method declaration there - to highlight accordingly
|
||||
else if (!result.containsKey(signature)) {
|
||||
LOG.assertTrue(hierarchicalMethodSignature.getMethod().isValid());
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.util.List;
|
||||
|
||||
interface ExampleInterface {
|
||||
public List exampleMethod();
|
||||
}
|
||||
|
||||
class ExampleSuperClass {
|
||||
public List<String> exampleMethod() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ExampleSubClass extends ExampleSuperClass implements ExampleInterface {
|
||||
}
|
||||
@@ -206,6 +206,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testFlattenIntersectionType() throws Exception { doTest17Incompatibility(false); }
|
||||
public void testIDEA97276() throws Exception { doTest17Incompatibility(false); }
|
||||
public void testWildcardsBoundsIntersection() throws Exception { doTest17Incompatibility(false); }
|
||||
public void testOverrideWithMoreSpecificReturn() throws Exception { doTest17Incompatibility(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user