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

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (+1 lines)
Lines 2549-2554 Link Here
2549
								}
2549
								}
2550
							}
2550
							}
2551
							// if null then we found a problem in the completion node
2551
							// if null then we found a problem in the completion node
2552
							this.lookupEnvironment.unitBeingCompleted = parsedUnit; // better resilient to further error reporting
2552
							contextAccepted =
2553
							contextAccepted =
2553
								complete(
2554
								complete(
2554
									e.astNode,
2555
									e.astNode,
(-)src/org/eclipse/jdt/core/tests/model/JavadocTypeCompletionModelTest.java (-2 / +6 lines)
Lines 340-346 Link Here
340
	assertSortedResults(
340
	assertSortedResults(
341
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
341
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
342
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
342
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
343
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}"
343
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
344
		"Bin4[TYPE_REF]{pack.Bin4, pack, Lpack.Bin4;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
345
		"Bin5[TYPE_REF]{pack.Bin5, pack, Lpack.Bin5;, null, null, "+this.positions+R_DRICQNR+"}"
344
	);
346
	);
345
}
347
}
346
348
Lines 357-363 Link Here
357
	assertSortedResults(
359
	assertSortedResults(
358
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
360
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
359
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
361
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
360
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}"
362
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
363
		"Bin4[TYPE_REF]{pack.Bin4, pack, Lpack.Bin4;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
364
		"Bin5[TYPE_REF]{pack.Bin5, pack, Lpack.Bin5;, null, null, "+this.positions+R_DRICQNR+"}"
361
	);
365
	);
362
}
366
}
363
367
(-)src/org/eclipse/jdt/core/tests/model/JavadocFieldCompletionModelTest.java (-1 / +3 lines)
Lines 270-276 Link Here
270
	assertSortedResults(
270
	assertSortedResults(
271
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
271
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
272
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
272
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
273
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}"
273
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
274
		"Bin4[TYPE_REF]{pack.Bin4, pack, Lpack.Bin4;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
275
		"Bin5[TYPE_REF]{pack.Bin5, pack, Lpack.Bin5;, null, null, "+this.positions+R_DRICQNR+"}"
274
	);
276
	);
275
}
277
}
276
278
(-)src/org/eclipse/jdt/core/tests/model/JavadocPackageCompletionModelTest.java (-1 / +3 lines)
Lines 284-290 Link Here
284
	assertSortedResults(
284
	assertSortedResults(
285
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
285
		"Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
286
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
286
		"Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
287
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}"
287
		"Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
288
		"Bin4[TYPE_REF]{pack.Bin4, pack, Lpack.Bin4;, null, null, "+this.positions+R_DRICQNR+"}\n" + 
289
		"Bin5[TYPE_REF]{pack.Bin5, pack, Lpack.Bin5;, null, null, "+this.positions+R_DRICQNR+"}"
288
	);
290
	);
289
}
291
}
290
292
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+45 lines)
Lines 13462-13467 Link Here
13462
	cu.codeComplete(cursorLocation, requestor);
13462
	cu.codeComplete(cursorLocation, requestor);
13463
13463
13464
	assertEquals(
13464
	assertEquals(
13465
		"element:bar    completion:bar    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC+ R_NON_RESTRICTED) +"\n"+
13465
		"element:barPlus    completion:barPlus()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
13466
		"element:barPlus    completion:barPlus()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
13466
		requestor.getResults());
13467
		requestor.getResults());
13467
}
13468
}
Lines 13475-13480 Link Here
13475
	cu.codeComplete(cursorLocation, requestor);
13476
	cu.codeComplete(cursorLocation, requestor);
13476
13477
13477
	assertEquals(
13478
	assertEquals(
13479
		"element:bar    completion:bar()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC+ R_NON_RESTRICTED) +"\n"+
13478
		"element:barPlus    completion:barPlus()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
13480
		"element:barPlus    completion:barPlus()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
13479
		requestor.getResults());
13481
		requestor.getResults());
13480
}
13482
}
Lines 13488-13496 Link Here
13488
	cu.codeComplete(cursorLocation, requestor);
13490
	cu.codeComplete(cursorLocation, requestor);
13489
13491
13490
	assertEquals(
13492
	assertEquals(
13493
		"element:bar    completion:bar()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC+ R_NON_RESTRICTED) +"\n"+
13491
		"element:barPlus    completion:barPlus()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
13494
		"element:barPlus    completion:barPlus()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
13492
		requestor.getResults());
13495
		requestor.getResults());
13493
}
13496
}
13497
public void testCompletionUnresolvedSuperclass() throws JavaModelException {
13498
	this.workingCopies = new ICompilationUnit[1];
13499
	this.workingCopies[0] = getWorkingCopy(
13500
		"/Completion/src/test/Test.java",
13501
		"package test;"+
13502
		"public class Test {\n" + 
13503
		"  public void foo(pack.Bin4 b) {\n" + 
13504
		"    b.bar\n" + 
13505
		"  }\n" + 
13506
		"}\n");
13507
13508
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13509
	String str = this.workingCopies[0].getSource();
13510
	String completeBehind = "bar";
13511
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
13512
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
13513
13514
	assertResults(
13515
			"barPlus[METHOD_REF]{barPlus(), Lpack.Bin4;, ()V, barPlus, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}",
13516
			requestor.getResults());
13517
}
13518
public void testCompletionUnresolvedSuperinteface() throws JavaModelException {
13519
	this.workingCopies = new ICompilationUnit[1];
13520
	this.workingCopies[0] = getWorkingCopy(
13521
		"/Completion/src/test/Test.java",
13522
		"package test;"+
13523
		"public class Test {\n" + 
13524
		"  public void foo(pack.Bin5 b) {\n" + 
13525
		"    b.bar\n" + 
13526
		"  }\n" + 
13527
		"}\n");
13528
13529
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13530
	String str = this.workingCopies[0].getSource();
13531
	String completeBehind = "bar";
13532
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
13533
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
13534
13535
	assertResults(
13536
			"barPlus[METHOD_REF]{barPlus(), Lpack.Bin5;, ()V, barPlus, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}",
13537
			requestor.getResults());
13538
}
13494
public void testCompletionVariableInitializerInInitializer1() throws JavaModelException {
13539
public void testCompletionVariableInitializerInInitializer1() throws JavaModelException {
13495
	CompletionTestsRequestor requestor = new CompletionTestsRequestor();
13540
	CompletionTestsRequestor requestor = new CompletionTestsRequestor();
13496
	ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInInitializer1.java");
13541
	ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInInitializer1.java");

Return to bug 101610