mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
check for duplicate methods made linear down from quadratic
This commit is contained in:
+1
-1
@@ -3,5 +3,5 @@ import java.util.List;
|
||||
|
||||
interface A
|
||||
{
|
||||
<<error descr="'add(E)' in 'java.util.List' clashes with 'add(E)' in 'java.util.Collection'; both methods have same erasure, yet neither overrides the other"></error>T extends List<?> & Collection<? extends Cloneable>> void foo(T x);
|
||||
<<error descr="'addAll(Collection<? extends E>)' in 'java.util.Collection' clashes with 'addAll(Collection<? extends E>)' in 'java.util.List'; both methods have same erasure, yet neither overrides the other"></error>T extends List<?> & Collection<? extends Cloneable>> void foo(T x);
|
||||
}
|
||||
+1
-1
@@ -70,7 +70,7 @@ class Test {
|
||||
abstract class F<T extends Throwable> {
|
||||
<error descr="'foo(F<?>)' is already defined in 'Test.F'">abstract void foo(F<?> y)</error>;
|
||||
|
||||
abstract void foo(F<? extends Throwable> y);
|
||||
<error descr="'foo(F<? extends Throwable>)' is already defined in 'Test.F'">abstract void foo(F<? extends Throwable> y)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -91,6 +91,10 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest
|
||||
private List<HighlightInfo> doTest(final int maxMillis) throws Exception {
|
||||
configureByFile(getFilePath(""));
|
||||
|
||||
return startTest(maxMillis);
|
||||
}
|
||||
|
||||
private List<HighlightInfo> startTest(int maxMillis) {
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
getFile().getText(); //to load text
|
||||
CodeInsightTestFixtureImpl.ensureIndexesUpToDate(getProject());
|
||||
@@ -124,4 +128,20 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest
|
||||
fail("Actual: " + errors.size());
|
||||
}
|
||||
}
|
||||
|
||||
public void testDuplicateMethods() throws Exception {
|
||||
StringBuilder text = new StringBuilder("class X {\n");
|
||||
int N = 1000;
|
||||
for (int i=0;i<N;i++) {
|
||||
text.append("public void visit(C" + i + " param) {}\n");
|
||||
}
|
||||
for (int i=0;i<N;i++) {
|
||||
text.append("class C" + i + " {}\n");
|
||||
}
|
||||
text.append("}");
|
||||
configureFromFileText("x.java", text.toString());
|
||||
|
||||
List<HighlightInfo> infos = startTest(Math.max(1000, 10000 - JobSchedulerImpl.CORES_COUNT * 1000));
|
||||
assertEmpty(infos);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user