### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java,v retrieving revision 1.157 diff -u -r1.157 SelectionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 18 Mar 2010 16:19:33 -0000 1.157 +++ codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 7 Apr 2010 17:20:52 -0000 @@ -478,11 +478,20 @@ } } private boolean checkSelection( - char[] source, - int selectionStart, - int selectionEnd) { - - Scanner scanner = new Scanner(); + char[] source, + int selectionStart, + int selectionEnd) { + + Scanner scanner = + new Scanner( + false /*comment*/, + false /*whitespace*/, + false /*nls*/, + this.compilerOptions.sourceLevel, + this.compilerOptions.complianceLevel, + null/*taskTag*/, + null/*taskPriorities*/, + true /*taskCaseSensitive*/); scanner.setSource(source); int lastIdentifierStart = -1; #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.67 diff -u -r1.67 ResolveTests_1_5.java --- src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java 25 Jun 2009 14:48:50 -0000 1.67 +++ src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java 7 Apr 2010 17:20:53 -0000 @@ -27,7 +27,7 @@ // Names of tests to run: can be "testBugXXXX" or "BugXXXX") //TESTS_NAMES = new String[] { "test0095" }; // Numbers of tests to run: "test" will be run for each number of this array - //TESTS_NUMBERS = new int[] { 13 }; + //TESTS_NUMBERS = new int[] { 124 }; // Range numbers of tests to run: all tests between "test" and "test" will be run for { first, last } //TESTS_RANGE = new int[] { 16, -1 }; } @@ -2936,4 +2936,30 @@ true ); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=308356 +public void test0124() throws Exception { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Resolve/src/Test.java", + "public class Test {\n" + + " public static void main(String[] args) {\n" + + " String str\ud842\udf9f = null;\n" + + " }\n" + + "}"); + + String str = this.workingCopies[0].getSource(); + String CONST1 = "String "; + int start = str.indexOf("String "); + start += CONST1.length(); + int start2 = str.indexOf(" ="); + int length = start2 - start + 1; + IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); + + assertElementsEqual( + "Unexpected elements", + "str\ud842\udf9f [in main(String[]) [in Test [in [Working copy] Test.java [in [in src [in Resolve]]]]]]", + elements, + true + ); +} }