mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
static override: search method in superclass by method signature from derived (IDEA-93043)
This commit is contained in:
+1
-1
@@ -973,7 +973,7 @@ public class HighlightMethodUtil {
|
||||
PsiClass[] interfaces = aClass.getInterfaces();
|
||||
for (PsiClass aInterfaces : interfaces) {
|
||||
superClass = aInterfaces;
|
||||
superMethod = MethodSignatureUtil.findMethodBySignature(superClass, method, true);
|
||||
superMethod = MethodSignatureUtil.findMethodInSuperClassBySignatureInDerived(aClass, superClass, method.getSignature(PsiSubstitutor.EMPTY), true);
|
||||
highlightInfo = checkStaticMethodOverride(aClass, method, true, superClass, superMethod);
|
||||
if (highlightInfo != null) return highlightInfo;
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import java.util.*;
|
||||
|
||||
public class MyClass implements Comparator<String> {
|
||||
|
||||
<error descr="Static method 'compare(String, String)' in 'MyClass' cannot override instance method 'compare(T, T)' in 'java.util.Comparator'">public static int compare(String a, String b)</error> {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testInconvertibleTypes() throws Exception { doTest(false); }
|
||||
public void testIncompatibleReturnType() throws Exception { doTest(false); }
|
||||
public void testContinueInferenceAfterFirstRawResult() throws Exception { doTest(false); }
|
||||
public void testStaticOverride() throws Exception { doTest(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user