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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (-1 / +7 lines)
Lines 1063-1071 Link Here
1063
			method.tagBits |= TagBits.HasMissingType;
1063
			method.tagBits |= TagBits.HasMissingType;
1064
		}
1064
		}
1065
	}
1065
	}
1066
	long sourceLevel = this.environment.globalOptions.originalSourceLevel;
1066
	for (int i = method.parameters.length; --i >= 0;) {
1067
	for (int i = method.parameters.length; --i >= 0;) {
1067
		TypeBinding resolvedType = resolveType(method.parameters[i], this.environment, true /* raw conversion */);
1068
		TypeBinding resolvedType = resolveType(method.parameters[i], this.environment, true /* raw conversion */);
1068
		method.parameters[i] = resolvedType;
1069
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=331446
1070
		if (sourceLevel < ClassFileConstants.JDK1_5) {
1071
			method.parameters[i] = resolvedType.erasure();
1072
		} else {
1073
			method.parameters[i] = resolvedType;
1074
		}
1069
		if ((resolvedType.tagBits & TagBits.HasMissingType) != 0) {
1075
		if ((resolvedType.tagBits & TagBits.HasMissingType) != 0) {
1070
			method.tagBits |= TagBits.HasMissingType;
1076
			method.tagBits |= TagBits.HasMissingType;
1071
		}
1077
		}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-4 / +74 lines)
Lines 11417-11424 Link Here
11417
		false,
11417
		false,
11418
		compilerOptions14);
11418
		compilerOptions14);
11419
}
11419
}
11420
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=331446 
11420
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=331446 
11421
public void _test331446() {
11421
public void test331446() {
11422
	Map compilerOptions15 = getCompilerOptions();
11422
	Map compilerOptions15 = getCompilerOptions();
11423
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
11423
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
11424
	compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
11424
	compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
Lines 11490-11495 Link Here
11490
		compilerOptions14,
11490
		compilerOptions14,
11491
		null);
11491
		null);
11492
}
11492
}
11493
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=331446 
11494
public void test331446b() {
11495
	Map compilerOptions15 = getCompilerOptions();
11496
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_4);
11497
	compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
11498
	compilerOptions15.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
11499
	this.runConformTest(
11500
		new String[] {
11501
			"Test.java",
11502
			"import java.util.Comparator;\n" + 
11503
			"import java.util.List;\n" + 
11504
			"\n" + 
11505
			"public class Test {\n" + 
11506
			"	public static  void assertEquals(String message,\n" + 
11507
			"			Comparator comparator, List expected, List actual) {\n" + 
11508
			"		if (expected.size() != actual.size()) {\n" + 
11509
			"			//failNotEquals(message, expected, actual);\n" + 
11510
			"		}\n" + 
11511
			"		for (int i = 0, l = expected.size(); i < l; i++) {\n" + 
11512
			"			assertEquals(message, comparator, expected.get(i), actual.get(i));\n" + 
11513
			"		}\n" + 
11514
			"	}\n" + 
11515
			"	public static void assertEquals(String message,\n" + 
11516
			"			Comparator comparator, Object expected, Object actual) {\n" + 
11517
			"		if (comparator.compare(expected, actual) == 0) {\n" + 
11518
			"			return;\n" + 
11519
			"		}\n" + 
11520
			"		//failNotEquals(message, expected, actual);\n" + 
11521
			"	}\n" + 
11522
			"}\n" + 
11523
			""
11524
		},
11525
		"",
11526
		null,
11527
		true,
11528
		null,
11529
		compilerOptions15,
11530
		null);
11531
11532
	Map compilerOptions14 = getCompilerOptions();
11533
	compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
11534
	compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
11535
	compilerOptions14.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3);
11536
	compilerOptions14.put(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK, JavaCore.IGNORE);
11537
	this.runConformTest(
11538
		new String[] {
11539
			"X.java",
11540
			"import java.util.ArrayList;\n" + 
11541
			"import java.util.Comparator;\n" + 
11542
			"\n" + 
11543
			"public class X {\n" + 
11544
			"	public static void testAmbiguity() {\n" + 
11545
			"		Comparator comparator = new Comparator() {\n" + 
11546
			"			\n" + 
11547
			"			public int compare(Object o1, Object o2) {\n" + 
11548
			"				return 0;\n" + 
11549
			"			}\n" + 
11550
			"		};\n" + 
11551
			"		Test.assertEquals(\"Test\", comparator, new ArrayList(), new ArrayList());\n" + 
11552
			"	}\n" + 
11553
			"}\n" + 
11554
			"",
11555
		},
11556
		"",
11557
		null,
11558
		false,
11559
		null,
11560
		compilerOptions14,
11561
		null);
11562
}
11493
public void test1415Mix() {
11563
public void test1415Mix() {
11494
	Map compilerOptions15 = getCompilerOptions();
11564
	Map compilerOptions15 = getCompilerOptions();
11495
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
11565
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, CompilerOptions.VERSION_1_5);
Lines 11526-11532 Link Here
11526
		"1. ERROR in Concrete.java (at line 1)\n" + 
11596
		"1. ERROR in Concrete.java (at line 1)\n" + 
11527
		"	public class Concrete extends Abstract {\n" + 
11597
		"	public class Concrete extends Abstract {\n" + 
11528
		"	             ^^^^^^^^\n" + 
11598
		"	             ^^^^^^^^\n" + 
11529
		"The type Concrete must implement the inherited abstract method Generic<String>.foo(String)\n" + 
11599
		"The type Concrete must implement the inherited abstract method Generic<String>.foo(Object)\n" + 
11530
		"----------\n",
11600
		"----------\n",
11531
		null,
11601
		null,
11532
		false,
11602
		false,
Lines 11562-11568 Link Here
11562
			new String[] {
11632
			new String[] {
11563
					"Concrete.java",
11633
					"Concrete.java",
11564
					"public class Concrete extends Abstract {\n" +
11634
					"public class Concrete extends Abstract {\n" +
11565
					"    void foo(String s) {}\n" +
11635
					"    void foo(Object s) {}\n" +
11566
					"}",
11636
					"}",
11567
			},
11637
			},
11568
			"",
11638
			"",

Return to bug 331446