### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.performance Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java,v retrieving revision 1.39 diff -u -r1.39 FullSourceWorkspaceModelTests.java --- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 28 May 2008 00:00:21 -0000 1.39 +++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 10 Jun 2008 13:10:18 -0000 @@ -760,6 +760,56 @@ } } +/* + * Ensures that the performance of reconcile on a CU with lots of duplicates is acceptable. + * (regression test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=135906 ) + */ +public void testReconcileDuplicates() throws JavaModelException { + tagAsSummary("Reconcile editor change on file with lots of duplicates", false); // do NOT put in fingerprint + + // build big file contents + StringBuffer contents = new StringBuffer(); + contents.append("public class CUWithDuplicates {\n"); + int fooIndex = 0; + while (fooIndex < 2000) { // add 2000 duplicate methods + contents.append(" void foo() {}\n"); + contents.append(fooIndex++); + } + contents.append("} //"); // ensure it ends with a line comment that is edited below + + ICompilationUnit workingCopy = null; + try { + // Setup + workingCopy = (ICompilationUnit) JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/BigProject/src/CUWithDuplicates.java"))); + workingCopy.becomeWorkingCopy(null); + + // Warm up + int warmup = WARMUP_COUNT / 10; + for (int i=0; i