View | Details | Raw Unified | Return to bug 308356 | Differences between
and this patch

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java (-5 / +14 lines)
Lines 478-488 Link Here
478
		}
478
		}
479
	}
479
	}
480
	private boolean checkSelection(
480
	private boolean checkSelection(
481
		char[] source,
481
			char[] source,
482
		int selectionStart,
482
			int selectionStart,
483
		int selectionEnd) {
483
			int selectionEnd) {
484
484
485
		Scanner scanner = new Scanner();
485
		Scanner scanner =
486
			new Scanner(
487
				false /*comment*/,
488
				false /*whitespace*/,
489
				false /*nls*/,
490
				this.compilerOptions.sourceLevel,
491
				this.compilerOptions.complianceLevel,
492
				null/*taskTag*/,
493
				null/*taskPriorities*/,
494
				true /*taskCaseSensitive*/);
486
		scanner.setSource(source);
495
		scanner.setSource(source);
487
496
488
		int lastIdentifierStart = -1;
497
		int lastIdentifierStart = -1;
(-)src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java (-1 / +27 lines)
Lines 27-33 Link Here
27
	// Names of tests to run: can be "testBugXXXX" or "BugXXXX")
27
	// Names of tests to run: can be "testBugXXXX" or "BugXXXX")
28
	//TESTS_NAMES = new String[] { "test0095" };
28
	//TESTS_NAMES = new String[] { "test0095" };
29
	// Numbers of tests to run: "test<number>" will be run for each number of this array
29
	// Numbers of tests to run: "test<number>" will be run for each number of this array
30
	//TESTS_NUMBERS = new int[] { 13 };
30
	//TESTS_NUMBERS = new int[] { 124 };
31
	// Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
31
	// Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
32
	//TESTS_RANGE = new int[] { 16, -1 };
32
	//TESTS_RANGE = new int[] { 16, -1 };
33
}
33
}
Lines 2936-2939 Link Here
2936
			true
2936
			true
2937
		);
2937
		);
2938
}
2938
}
2939
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=308356
2940
public void test0124() throws Exception {
2941
	this.workingCopies = new ICompilationUnit[1];
2942
	this.workingCopies[0] = getWorkingCopy(
2943
			"/Resolve/src/Test.java",
2944
			"public class Test {\n" + 
2945
			"	public static void main(String[] args) {\n" + 
2946
			"		String str\ud842\udf9f = null;\n" + 
2947
			"	}\n" + 
2948
			"}");
2949
2950
	String str = this.workingCopies[0].getSource();
2951
	String CONST1 = "String ";
2952
	int start = str.indexOf("String ");
2953
	start += CONST1.length();
2954
	int start2 = str.indexOf(" =");
2955
	int length = start2 - start + 1;
2956
	IJavaElement[] elements =  this.workingCopies[0].codeSelect(start, length, this.wcOwner);
2957
2958
	assertElementsEqual(
2959
			"Unexpected elements",
2960
			"str\ud842\udf9f [in main(String[]) [in Test [in [Working copy] Test.java [in <default> [in src [in Resolve]]]]]]",
2961
			elements,
2962
			true
2963
		);
2964
}
2939
}
2965
}

Return to bug 308356