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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java (+34 lines)
Lines 2395-2400 Link Here
2395
		null /* no custom requestor*/,
2395
		null /* no custom requestor*/,
2396
	  	false /* do not skip javac for this peculiar test */);
2396
	  	false /* do not skip javac for this peculiar test */);
2397
}
2397
}
2398
2398
public void test072() {
2399
public void test072() {
2399
	this.runNegativeTest(
2400
	this.runNegativeTest(
2400
			new String[] {
2401
			new String[] {
Lines 2422-2427 Link Here
2422
			"The method foo(String) is ambiguous for the type AX\n" + 
2423
			"The method foo(String) is ambiguous for the type AX\n" + 
2423
			"----------\n");
2424
			"----------\n");
2424
}
2425
}
2426
2427
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150758
2428
public void test075() {
2429
	this.runConformTest(
2430
			new String[] {
2431
				"package1/Test.java",//===================
2432
				"package package1;\n"  +
2433
				"import package2.MyList;\n"  +
2434
				"public class Test {\n"  +
2435
				"        public void reproduce(String sortKey, boolean isAscending) {\n"  +
2436
				"                MyList recList = new MyList();\n"  +
2437
				"                recList.add(null);\n"  +
2438
				"        }\n"  +
2439
				"}\n",//===================
2440
				"package2/MyList.java",//===================
2441
				"package package2;\n"  +
2442
				"import java.util.AbstractList;\n"  +
2443
				"import java.util.List;\n"  +
2444
				"public class MyList extends AbstractList implements List {\n"  +
2445
				"        void add(Integer i) {\n"  +
2446
				"        }\n"  +
2447
				"        public Object get(int index) {\n"  +
2448
				"                return null;\n"  +
2449
				"        }\n"  +
2450
				"        public int size() {\n"  +
2451
				"                return 0;\n"  +
2452
				"        }\n"  +
2453
				"}", // =================
2454
			},
2455
			"");
2456
}
2457
2458
2425
public static Class testClass() {	return LookupTest.class;
2459
public static Class testClass() {	return LookupTest.class;
2426
}
2460
}
2427
}
2461
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-2 / +2 lines)
Lines 1219-1230 Link Here
1219
1219
1220
		// check for duplicate parameterized methods
1220
		// check for duplicate parameterized methods
1221
		if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
1221
		if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
1222
			for (int i = 0; i < candidatesCount; i++) {
1222
			for (int i = 0; i < visiblesCount; i++) {
1223
				MethodBinding current = candidates[i];
1223
				MethodBinding current = candidates[i];
1224
				if (current instanceof ParameterizedGenericMethodBinding)
1224
				if (current instanceof ParameterizedGenericMethodBinding)
1225
					current = ((ParameterizedGenericMethodBinding) current).originalMethod;
1225
					current = ((ParameterizedGenericMethodBinding) current).originalMethod;
1226
				if (current instanceof ParameterizedMethodBinding)
1226
				if (current instanceof ParameterizedMethodBinding)
1227
					for (int j = i + 1; j < candidatesCount; j++)
1227
					for (int j = i + 1; j < visiblesCount; j++)
1228
						if (current.declaringClass == candidates[j].declaringClass && current.areParametersEqual(candidates[j]))
1228
						if (current.declaringClass == candidates[j].declaringClass && current.areParametersEqual(candidates[j]))
1229
							return new ProblemMethodBinding(candidates[i].selector, candidates[i].parameters, ProblemReasons.Ambiguous);
1229
							return new ProblemMethodBinding(candidates[i].selector, candidates[i].parameters, ProblemReasons.Ambiguous);
1230
			}
1230
			}

Return to bug 150758