### 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.203 diff -u -r1.203 CompletionTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 7 May 2009 08:49:30 -0000 1.203 +++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 25 May 2009 17:59:42 -0000 @@ -20102,4 +20102,48 @@ requestor.getResults()); } +public void test270436a() throws JavaModelException { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/test/Test270436a.java", + "package test;\n" + + "public final class TestClass {}\n" + + "interface TestInterface {}\n" + + "class Subclass extends test.Test {}\n"); + + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); + String str = this.workingCopies[0].getSource(); + String completeBehind = "test.Test"; + int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); + + // In the absence of the fix, it would have been: + // TestInterface[TYPE_REF]{TestInterface, test, Ltest.TestInterface;, null, 19} + this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); + assertResults( + "", + requestor.getResults()); +} + +public void test270436b() throws JavaModelException { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/test/Test270436b.java", + "package test;\n" + + "public final class TestClass {}\n" + + "interface TestInterface {}\n" + + "class Subclass extends test.Sub {}\n"); + + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); + String str = this.workingCopies[0].getSource(); + String completeBehind = "test.Sub"; + int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); + + // In the absence of the fix, it would have been: + // Subclass[TYPE_REF]{Subclass, test, Ltest.Subclass;, null, 39} + this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); + assertResults( + "", + requestor.getResults()); +} + }