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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java (-8 / +21 lines)
Lines 13663-13668 Link Here
13663
/*
13663
/*
13664
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
13664
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
13665
 * Additional tests for bug 84720  
13665
 * Additional tests for bug 84720  
13666
 * 
13667
 * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=273991 also
13666
 */
13668
 */
13667
public void testCompletionWithUnboxing_1() throws JavaModelException {
13669
public void testCompletionWithUnboxing_1() throws JavaModelException {
13668
	this.workingCopies = new ICompilationUnit[2];
13670
	this.workingCopies = new ICompilationUnit[2];
Lines 13672-13689 Link Here
13672
			"public class C {\n" +
13674
			"public class C {\n" +
13673
			"public void myMethod1(){}\n" +
13675
			"public void myMethod1(){}\n" +
13674
			"public void myMethod2(){}\n" +
13676
			"public void myMethod2(){}\n" +
13675
			"public int myMethod3(){return 0;}\n" +
13677
			"public long myMethod3(){return 0;}\n" +
13676
			"public Integer myMethod4(){return 0;}\n" +
13678
			"public Long myMethod4(){return 0;}\n" +
13679
			"public float myMethod5(){return 0;}\n" +
13680
			"public Float myMethod6(){return 0;}\n" +
13681
			"public Double myMethod7(){return 0;}\n" +
13682
			"public double myMethod8(){return 0;}\n" +
13677
			"public void foo() {\n" +
13683
			"public void foo() {\n" +
13678
			"	Integer i = myMeth \n" +
13684
			"	Long l = myMeth \n" +
13679
			"}\n" +
13685
			"}\n" +
13680
			"}");
13686
			"}");
13681
	this.workingCopies[1] = getWorkingCopy(
13687
	this.workingCopies[1] = getWorkingCopy(
13682
			"/Completion/src3/java/lang/Test.java",
13688
			"/Completion/src3/java/lang/Test.java",
13683
			"package java.lang;\n" +
13689
			"package java.lang;\n" +
13684
			"public class Integer {\n" +
13690
			"public class Long {\n" +
13685
			"}");
13691
			"}");
13686
13687
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13692
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13688
13693
13689
	String str = this.workingCopies[0].getSource();
13694
	String str = this.workingCopies[0].getSource();
Lines 13696-13705 Link Here
13696
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13701
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13697
			"myMethod2[METHOD_REF]{myMethod2(), Ltest.C;, ()V, myMethod2, null, " +
13702
			"myMethod2[METHOD_REF]{myMethod2(), Ltest.C;, ()V, myMethod2, null, " +
13698
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13703
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13699
			"myMethod3[METHOD_REF]{myMethod3(), Ltest.C;, ()I, myMethod3, null, " +
13704
			"myMethod5[METHOD_REF]{myMethod5(), Ltest.C;, ()F, myMethod5, null, " +
13705
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13706
			"myMethod6[METHOD_REF]{myMethod6(), Ltest.C;, ()LFloat;, myMethod6, null, " +
13707
			(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13708
			"myMethod7[METHOD_REF]{myMethod7(), Ltest.C;, ()LDouble;, myMethod7, null, " +
13709
			(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13710
			"myMethod8[METHOD_REF]{myMethod8(), Ltest.C;, ()D, myMethod8, null, " +
13711
			(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +				
13712
			"myMethod3[METHOD_REF]{myMethod3(), Ltest.C;, ()J, myMethod3, null, " +
13700
				(R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13713
				(R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13701
			"myMethod4[METHOD_REF]{myMethod4(), Ltest.C;, ()Ljava.lang.Integer;, myMethod4, null, " +
13714
			"myMethod4[METHOD_REF]{myMethod4(), Ltest.C;, ()Ljava.lang.Long;, myMethod4, null, " +
13702
				(R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
13715
				(R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}" ,
13703
			requestor.getResults());	
13716
			requestor.getResults());	
13704
}
13717
}
13705
/*
13718
/*
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 3979-3985 Link Here
3979
				}
3979
				}
3980
				// Bug 84720 - [1.5][assist] proposal ranking by return value should consider auto(un)boxing
3980
				// Bug 84720 - [1.5][assist] proposal ranking by return value should consider auto(un)boxing
3981
				// Just ensuring that the unitScope is not null, even though it's an unlikely case.
3981
				// Just ensuring that the unitScope is not null, even though it's an unlikely case.
3982
				if (this.unitScope != null && this.unitScope.isBoxingCompatibleWith(this.expectedTypes[i], proposalType)) {
3982
				if (this.unitScope != null && this.unitScope.isBoxingCompatibleWith(proposalType, this.expectedTypes[i])) {
3983
					relevance = R_EXPECTED_TYPE;
3983
					relevance = R_EXPECTED_TYPE;
3984
				}
3984
				}
3985
			}
3985
			}

Return to bug 273991