### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: buildnotes_jdt-core.html
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v
retrieving revision 1.5721
diff -u -r1.5721 buildnotes_jdt-core.html
--- buildnotes_jdt-core.html 27 Feb 2007 17:48:46 -0000 1.5721
+++ buildnotes_jdt-core.html 28 Feb 2007 14:22:56 -0000
@@ -52,7 +52,9 @@
What's new in this drop
Problem Reports Fixed
-175531
+175834
+[assist] already defined name is proposed as variable name
+
175531
Livelock in OverflowingLRUCache.privateRemoveEntry
Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v
retrieving revision 1.169
diff -u -r1.169 CompletionParser.java
--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 19 Jan 2007 17:06:30 -0000 1.169
+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 28 Feb 2007 14:22:57 -0000
@@ -3746,6 +3746,8 @@
referenceContext = fakeMethod;
compilationUnit = unit;
+ this.restartRecovery = true;
+
scanner.resetTo(start, end);
consumeNestedMethod();
try {
#P org.eclipse.jdt.core.tests.model
Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v
retrieving revision 1.147
diff -u -r1.147 CompletionTests.java
--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 15 Feb 2007 15:02:35 -0000 1.147
+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 28 Feb 2007 14:23:09 -0000
@@ -12379,6 +12379,34 @@
"zzzTest2[VARIABLE_DECLARATION]{zzzTest2, null, Ltest.Test2;, zzzTest2, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=175834
+public void testCompletionVariableName36() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[1];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;\n"+
+ "public class Test {\n"+
+ " void bar() {\n"+
+ " /**/int varzz\n"+
+ " {\n"+
+ " int varzz1 = 0;\n"+
+ " varzz1 = 0;\n"+
+ " }\n"+
+ " int varzz2 = 0;\n"+
+ " #\n"+
+ " }\n"+
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "/**/int varzz";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "varzzI[VARIABLE_DECLARATION]{varzzI, null, I, varzzI, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}",
+ requestor.getResults());
+}
public void testCompletionVariableName4() throws JavaModelException {
this.wc = getWorkingCopy(
"/Completion/src/CompletionVariableName4.java",