### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java,v retrieving revision 1.66 diff -u -r1.66 ResolveTests_1_5.java --- src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java 28 Apr 2009 17:46:10 -0000 1.66 +++ src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java 25 Jun 2009 14:45:08 -0000 @@ -2909,4 +2909,31 @@ true ); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209639 +public void test0123() throws Exception { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Resolve/src/test/Test.java", + "package test;\n" + + "public class Test {\n" + + " T bar(T t) { return t; }\n" + + " void foo(boolean b, Runnable r) {\n" + + " Zork z = null;\n" + + " String s = (String) bar(z); // 5\n" + + " }\n" + + "}\n" + + "\n"); + + String str = this.workingCopies[0].getSource(); + int start = str.lastIndexOf("bar"); + int length = "bar".length(); + IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); + + assertElementsEqual( + "Unexpected elements", + "bar(T) {key=Ltest/Test;.bar(TT;)TT;%} [in Test [in [Working copy] Test.java [in test [in src [in Resolve]]]]]", + elements, + true + ); +} } #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java,v retrieving revision 1.9 diff -u -r1.9 GenericsSelectionTest.java --- src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java 28 Apr 2009 17:17:31 -0000 1.9 +++ src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java 25 Jun 2009 14:45:09 -0000 @@ -934,4 +934,51 @@ expectedReplacedSource, testName); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=255142 +public void test0024() { + + String str = + "import java.util.List;\n" + + "public class X {\n" + + " T bar(T t) { return t; }\n" + + " void foo(boolean b, Runnable r) {\n" + + " Zork z = null;\n" + + " String s = (String) bar(z); // 5\n" + + " }\n" + + "}\n" + + "\n"; + + String selection = "bar"; + + String expectedCompletionNodeToString = ""; + + String completionIdentifier = "bar"; + String expectedUnitDisplayString = + "import java.util.List;\n" + + "public class X {\n" + + " public X() {\n" + + " }\n" + + " T bar(T t) {\n" + + " }\n" + + " void foo(boolean b, Runnable r) {\n" + + " Zork z;\n" + + " String s = (String) ;\n" + + " }\n" + + "}\n"; + String expectedReplacedSource = "bar(z)"; + String testName = "