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 (-7 / +20 lines)
Lines 13622-13627 Link Here
13622
/*
13622
/*
13623
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
13623
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84720
13624
 * to test that the methods with Boxed/unboxed return types get higher relevance than the ones that return void  
13624
 * to test that the methods with Boxed/unboxed return types get higher relevance than the ones that return void  
13625
 * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=273991 also
13625
 */
13626
 */
13626
public void testCompletionWithUnboxing() throws JavaModelException {
13627
public void testCompletionWithUnboxing() throws JavaModelException {
13627
	this.workingCopies = new ICompilationUnit[2];
13628
	this.workingCopies = new ICompilationUnit[2];
Lines 13631-13646 Link Here
13631
			"public class C {\n" +
13632
			"public class C {\n" +
13632
			"public void myMethod1(){}\n" +
13633
			"public void myMethod1(){}\n" +
13633
			"public void myMethod2(){}\n" +
13634
			"public void myMethod2(){}\n" +
13634
			"public int myMethod3(){return 0;}\n" +
13635
			"public long myMethod3(){return 0;}\n" +
13635
			"public Integer myMethod4(){return 0;}\n" +
13636
			"public Long myMethod4(){return 0;}\n" +
13637
			"public float myMethod5(){return 0;}\n" +
13638
			"public Float myMethod6(){return 0;}\n" +
13639
			"public Double myMethod7(){return 0;}\n" +
13640
			"public double myMethod8(){return 0;}\n" +
13636
			"public void foo() {\n" +
13641
			"public void foo() {\n" +
13637
			"	int i = myMeth \n" +
13642
			"	Long l = myMeth \n" +
13638
			"}\n" +
13643
			"}\n" +
13639
			"}");
13644
			"}");
13640
	this.workingCopies[1] = getWorkingCopy(
13645
	this.workingCopies[1] = getWorkingCopy(
13641
			"/Completion/src3/java/lang/Test.java",
13646
			"/Completion/src3/java/lang/Test.java",
13642
			"package java.lang;\n" +
13647
			"package java.lang;\n" +
13643
			"public class Integer {\n" +
13648
			"public class Long {\n" +
13644
			"}");
13649
			"}");
13645
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13650
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13646
13651
Lines 13654-13663 Link Here
13654
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13659
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13655
			"myMethod2[METHOD_REF]{myMethod2(), Ltest.C;, ()V, myMethod2, null, " +
13660
			"myMethod2[METHOD_REF]{myMethod2(), Ltest.C;, ()V, myMethod2, null, " +
13656
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13661
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13657
			"myMethod4[METHOD_REF]{myMethod4(), Ltest.C;, ()Ljava.lang.Integer;, myMethod4, null, " +
13662
			"myMethod5[METHOD_REF]{myMethod5(), Ltest.C;, ()F, myMethod5, null, " +
13663
				(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13664
			"myMethod6[METHOD_REF]{myMethod6(), Ltest.C;, ()LFloat;, myMethod6, null, " +
13665
			(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13666
			"myMethod7[METHOD_REF]{myMethod7(), Ltest.C;, ()LDouble;, myMethod7, null, " +
13667
			(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13668
			"myMethod8[METHOD_REF]{myMethod8(), Ltest.C;, ()D, myMethod8, null, " +
13669
			(R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +				
13670
			"myMethod3[METHOD_REF]{myMethod3(), Ltest.C;, ()J, myMethod3, null, " +
13658
				(R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13671
				(R_RESOLVED + R_INTERESTING + R_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
13659
			"myMethod3[METHOD_REF]{myMethod3(), Ltest.C;, ()I, myMethod3, null, " +
13672
			"myMethod4[METHOD_REF]{myMethod4(), Ltest.C;, ()Ljava.lang.Long;, myMethod4, null, " +
13660
				(R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
13673
				(R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}" ,
13661
			requestor.getResults());	
13674
			requestor.getResults());	
13662
}
13675
}
13663
/*
13676
/*
(-)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