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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+29 lines)
Lines 12233-12238 Link Here
12233
			"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)+"}",
12233
			"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)+"}",
12234
			requestor.getResults());
12234
			requestor.getResults());
12235
}
12235
}
12236
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=166570
12237
public void testCompletionVariableName35() throws JavaModelException {
12238
	this.workingCopies = new ICompilationUnit[2];
12239
	this.workingCopies[0] = getWorkingCopy(
12240
            "/Completion/src/test/Test.java",
12241
            "package test;\n"+
12242
            "public class Test {\n"+
12243
            "	void bar() {\n"+
12244
            "		Test2 zzz\n"+
12245
            "		int zzzzz = 0;\n"+
12246
            "	}\n"+
12247
            "}");
12248
	
12249
	this.workingCopies[1] = getWorkingCopy(
12250
            "/Completion/src/test/Test2.java",
12251
            "package test;\n"+
12252
            "public class Test2 {\n"+
12253
            "}");
12254
    
12255
    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
12256
    String str = this.workingCopies[0].getSource();
12257
    String completeBehind = "Test2 zzz";
12258
    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
12259
    this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
12260
12261
    assertResults(
12262
			"zzzTest2[VARIABLE_DECLARATION]{zzzTest2, null, Ltest.Test2;, zzzTest2, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}",
12263
			requestor.getResults());
12264
}
12236
public void testCompletionVariableName4() throws JavaModelException {
12265
public void testCompletionVariableName4() throws JavaModelException {
12237
	this.wc = getWorkingCopy(
12266
	this.wc = getWorkingCopy(
12238
            "/Completion/src/CompletionVariableName4.java",
12267
            "/Completion/src/CompletionVariableName4.java",
(-)buildnotes_jdt-core.html (-3 / +3 lines)
Lines 172-178 Link Here
172
</li>
172
</li>
173
173
174
<h3>Problem Reports Fixed</h3>
174
<h3>Problem Reports Fixed</h3>
175
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=162073">162073</a>
175
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=166570">166570</a>
176
[assist] Proposal computer from the 'org.eclipse.mylar.java' plug-in did not complete normally
177
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=162073">162073</a>
176
[compiler] extraneous interface compatibility error
178
[compiler] extraneous interface compatibility error
177
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=171066">171066</a>
179
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=171066">171066</a>
178
Provide TextEdit when sorting compilation unit
180
Provide TextEdit when sorting compilation unit
Lines 578-585 Link Here
578
[1.5][compiler] ClassCastException during annotation code generation
580
[1.5][compiler] ClassCastException during annotation code generation
579
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=165900">165900</a>
581
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=165900">165900</a>
580
[select] Incoherent behavior when there is ambiguous methods
582
[select] Incoherent behavior when there is ambiguous methods
581
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=166570">166570</a>
582
[assist] Proposal computer from the 'org.eclipse.mylar.java' plug-in did not complete normally
583
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=158611">158611</a>
583
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=158611">158611</a>
584
Set 'generatedBy' attribute of IMarker anywhere markers are generated in JDT/Core code
584
Set 'generatedBy' attribute of IMarker anywhere markers are generated in JDT/Core code
585
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=166348">166348</a>
585
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=166348">166348</a>
(-)codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java (-2 / +3 lines)
Lines 391-397 Link Here
391
		}
391
		}
392
		
392
		
393
		if (this.potentialVariableNamesPtr < nextIndex) {
393
		if (this.potentialVariableNamesPtr < nextIndex) {
394
			this.potentialVariableNamesPtr = index;
394
			if  (index < this.potentialVariableNamesPtr) {
395
				this.potentialVariableNamesPtr = index;
396
			}
395
			return -1;
397
			return -1;
396
		}
398
		}
397
		if (index + 1 < nextIndex) {
399
		if (index + 1 < nextIndex) {
Lines 414-420 Link Here
414
		int i = indexOfFisrtNameAfter(start);
416
		int i = indexOfFisrtNameAfter(start);
415
		done : while (i != -1) {
417
		done : while (i != -1) {
416
			int nameStart = this.potentialVariableNameStarts[i];
418
			int nameStart = this.potentialVariableNameStarts[i];
417
			// the null check is added to fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=166570
418
			if (start < nameStart && nameStart < end) {
419
			if (start < nameStart && nameStart < end) {
419
				this.acceptName(this.potentialVariableNames[i]);
420
				this.acceptName(this.potentialVariableNames[i]);
420
				this.removeNameAt(i);
421
				this.removeNameAt(i);

Return to bug 166570