### Eclipse Workspace Patch 1.0 #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.141 diff -u -r1.141 CompletionTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 19 Jan 2007 17:06:24 -0000 1.141 +++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 24 Jan 2007 16:20:45 -0000 @@ -12233,6 +12233,35 @@ "vUnknown[VARIABLE_DECLARATION]{vUnknown, null, I, vUnknown, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}", requestor.getResults()); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=166570 +public void testCompletionVariableName35() throws JavaModelException { + this.workingCopies = new ICompilationUnit[2]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/test/Test.java", + "package test;\n"+ + "public class Test {\n"+ + " void bar() {\n"+ + " Test2 zzz\n"+ + " int zzzzz = 0;\n"+ + " }\n"+ + "}"); + + this.workingCopies[1] = getWorkingCopy( + "/Completion/src/test/Test2.java", + "package test;\n"+ + "public class Test2 {\n"+ + "}"); + + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); + String str = this.workingCopies[0].getSource(); + String completeBehind = "Test2 zzz"; + int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); + this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); + + assertResults( + "zzzTest2[VARIABLE_DECLARATION]{zzzTest2, null, Ltest.Test2;, zzzTest2, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", + requestor.getResults()); +} public void testCompletionVariableName4() throws JavaModelException { this.wc = getWorkingCopy( "/Completion/src/CompletionVariableName4.java", #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.5646 diff -u -r1.5646 buildnotes_jdt-core.html --- buildnotes_jdt-core.html 24 Jan 2007 08:05:52 -0000 1.5646 +++ buildnotes_jdt-core.html 24 Jan 2007 16:20:48 -0000 @@ -172,7 +172,9 @@

Problem Reports Fixed

-162073 +166570 +[assist] Proposal computer from the 'org.eclipse.mylar.java' plug-in did not complete normally +
162073 [compiler] extraneous interface compatibility error
171066 Provide TextEdit when sorting compilation unit @@ -578,8 +580,6 @@ [1.5][compiler] ClassCastException during annotation code generation
165900 [select] Incoherent behavior when there is ambiguous methods -
166570 -[assist] Proposal computer from the 'org.eclipse.mylar.java' plug-in did not complete normally
158611 Set 'generatedBy' attribute of IMarker anywhere markers are generated in JDT/Core code
166348 Index: codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java,v retrieving revision 1.5 diff -u -r1.5 UnresolvedReferenceNameFinder.java --- codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java 11 Jan 2007 15:22:40 -0000 1.5 +++ codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java 24 Jan 2007 16:20:48 -0000 @@ -391,7 +391,9 @@ } if (this.potentialVariableNamesPtr < nextIndex) { - this.potentialVariableNamesPtr = index; + if (index < this.potentialVariableNamesPtr) { + this.potentialVariableNamesPtr = index; + } return -1; } if (index + 1 < nextIndex) { @@ -414,7 +416,6 @@ int i = indexOfFisrtNameAfter(start); done : while (i != -1) { int nameStart = this.potentialVariableNameStarts[i]; - // the null check is added to fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=166570 if (start < nameStart && nameStart < end) { this.acceptName(this.potentialVariableNames[i]); this.removeNameAt(i);