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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-9 / +19 lines)
Lines 724-730 Link Here
724
		}
724
		}
725
		// no need to check for visibility - interface methods are public
725
		// no need to check for visibility - interface methods are public
726
		if (compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4)
726
		if (compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4)
727
			return mostSpecificMethodBinding(candidates, candidatesCount, argumentTypes, invocationSite, receiverType);
727
			return mostSpecificMethodBinding(candidates, null, candidatesCount, argumentTypes, invocationSite, receiverType);
728
		return mostSpecificInterfaceMethodBinding(candidates, candidatesCount, invocationSite);
728
		return mostSpecificInterfaceMethodBinding(candidates, candidatesCount, invocationSite);
729
	}
729
	}
730
730
Lines 1112-1117 Link Here
1112
		// if found several candidates, then eliminate those not matching argument types
1112
		// if found several candidates, then eliminate those not matching argument types
1113
		int foundSize = found.size;
1113
		int foundSize = found.size;
1114
		MethodBinding[] candidates = null;
1114
		MethodBinding[] candidates = null;
1115
		boolean[] differingCandidates = null;
1115
		int candidatesCount = 0;
1116
		int candidatesCount = 0;
1116
		MethodBinding problemMethod = null;
1117
		MethodBinding problemMethod = null;
1117
		boolean searchForDefaultAbstractMethod = isCompliant14 && ! receiverTypeIsInterface && (receiverType.isAbstract() || receiverType.isTypeVariable());
1118
		boolean searchForDefaultAbstractMethod = isCompliant14 && ! receiverTypeIsInterface && (receiverType.isAbstract() || receiverType.isTypeVariable());
Lines 1129-1136 Link Here
1129
							unitScope.recordTypeReferences(compatibleMethod.thrownExceptions);
1130
							unitScope.recordTypeReferences(compatibleMethod.thrownExceptions);
1130
							return compatibleMethod;
1131
							return compatibleMethod;
1131
						}
1132
						}
1132
						if (candidatesCount == 0)
1133
						if (candidatesCount == 0) {
1133
							candidates = new MethodBinding[foundSize];
1134
							candidates = new MethodBinding[foundSize];
1135
							differingCandidates = new boolean[foundSize];
1136
						}
1137
						if (compatibleMethod != methodBinding) {
1138
							differingCandidates[candidatesCount] = true;
1139
						}
1134
						candidates[candidatesCount++] = compatibleMethod;
1140
						candidates[candidatesCount++] = compatibleMethod;
1135
					} else if (problemMethod == null) {
1141
					} else if (problemMethod == null) {
1136
						problemMethod = compatibleMethod;
1142
						problemMethod = compatibleMethod;
Lines 1205-1210 Link Here
1205
					if (visiblesCount != i) {
1211
					if (visiblesCount != i) {
1206
						candidates[i] = null;
1212
						candidates[i] = null;
1207
						candidates[visiblesCount] = methodBinding;
1213
						candidates[visiblesCount] = methodBinding;
1214
						differingCandidates[visiblesCount] = differingCandidates[i];
1208
					}
1215
					}
1209
					visiblesCount++;
1216
					visiblesCount++;
1210
				}
1217
				}
Lines 1243-1249 Link Here
1243
			}
1250
			}
1244
		}
1251
		}
1245
1252
1246
		MethodBinding mostSpecificMethod = mostSpecificMethodBinding(candidates, visiblesCount, argumentTypes, invocationSite, receiverType);
1253
		MethodBinding mostSpecificMethod = mostSpecificMethodBinding(candidates, differingCandidates, visiblesCount, argumentTypes, invocationSite, receiverType);
1247
		if (searchForDefaultAbstractMethod) { // search interfaces for a better match
1254
		if (searchForDefaultAbstractMethod) { // search interfaces for a better match
1248
			if (mostSpecificMethod.isValidBinding())
1255
			if (mostSpecificMethod.isValidBinding())
1249
				// see if there is a better match in the interfaces - see AutoBoxingTest 99, LookupTest#81
1256
				// see if there is a better match in the interfaces - see AutoBoxingTest 99, LookupTest#81
Lines 1670-1676 Link Here
1670
					compatible[0].parameters,
1677
					compatible[0].parameters,
1671
					ProblemReasons.NotVisible);
1678
					ProblemReasons.NotVisible);
1672
			// all of visible are from the same declaringClass, even before 1.4 we can call this method instead of mostSpecificClassMethodBinding
1679
			// all of visible are from the same declaringClass, even before 1.4 we can call this method instead of mostSpecificClassMethodBinding
1673
			return mostSpecificMethodBinding(visible, visibleIndex, argumentTypes, invocationSite, receiverType);
1680
			return mostSpecificMethodBinding(visible, null, visibleIndex, argumentTypes, invocationSite, receiverType);
1674
		} catch (AbortCompilation e) {
1681
		} catch (AbortCompilation e) {
1675
			e.updateContext(invocationSite, referenceCompilationUnit().compilationResult);
1682
			e.updateContext(invocationSite, referenceCompilationUnit().compilationResult);
1676
			throw e;
1683
			throw e;
Lines 1949-1955 Link Here
1949
				if (visible != null) {
1956
				if (visible != null) {
1950
					MethodBinding[] temp = new MethodBinding[visible.size];
1957
					MethodBinding[] temp = new MethodBinding[visible.size];
1951
					visible.copyInto(temp);
1958
					visible.copyInto(temp);
1952
					foundMethod = mostSpecificMethodBinding(temp, temp.length, argumentTypes, invocationSite, null);
1959
					foundMethod = mostSpecificMethodBinding(temp, null, temp.length, argumentTypes, invocationSite, null);
1953
				}
1960
				}
1954
			}
1961
			}
1955
		}
1962
		}
Lines 2561-2567 Link Here
2561
		return null;
2568
		return null;
2562
	}
2569
	}
2563
2570
2564
	protected boolean isAcceptableMethod(MethodBinding one, MethodBinding two) {
2571
	protected boolean isAcceptableMethod(MethodBinding one, MethodBinding two, boolean twoIsRawified) {
2565
		TypeBinding[] oneParams = one.parameters;
2572
		TypeBinding[] oneParams = one.parameters;
2566
		TypeBinding[] twoParams = two.parameters;
2573
		TypeBinding[] twoParams = two.parameters;
2567
		int oneParamsLength = oneParams.length;
2574
		int oneParamsLength = oneParams.length;
Lines 2581-2587 Link Here
2581
				if (oneParam.isCompatibleWith(twoParam)) {
2588
				if (oneParam.isCompatibleWith(twoParam)) {
2582
					if (oneParam.leafComponentType().isRawType()) {
2589
					if (oneParam.leafComponentType().isRawType()) {
2583
						// A#RAW is not more specific than a rawified A<T>
2590
						// A#RAW is not more specific than a rawified A<T>
2584
						if (oneParam.needsUncheckedConversion(two.original().parameters[i]))
2591
						if ((twoIsRawified || ! two.parameters[i].isRawType()) && oneParam.needsUncheckedConversion(two.original().parameters[i]))	
2585
							return false;
2592
							return false;
2586
					}
2593
					}
2587
				} else {
2594
				} else {
Lines 3287-3293 Link Here
3287
	}
3294
	}
3288
3295
3289
	// caveat: this is not a direct implementation of JLS
3296
	// caveat: this is not a direct implementation of JLS
3290
	protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) {
3297
	protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, boolean differing[], int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) {
3291
		int[] compatibilityLevels = new int[visibleSize];
3298
		int[] compatibilityLevels = new int[visibleSize];
3292
		for (int i = 0; i < visibleSize; i++)
3299
		for (int i = 0; i < visibleSize; i++)
3293
			compatibilityLevels[i] = parameterCompatibilityLevel(visible[i], argumentTypes);
3300
			compatibilityLevels[i] = parameterCompatibilityLevel(visible[i], argumentTypes);
Lines 3330-3336 Link Here
3330
					 */
3337
					 */
3331
					if (acceptable == null || !acceptable.isValidBinding())
3338
					if (acceptable == null || !acceptable.isValidBinding())
3332
						continue nextVisible;
3339
						continue nextVisible;
3333
					if (!isAcceptableMethod(tiebreakMethod, acceptable))
3340
					if (!isAcceptableMethod(tiebreakMethod, acceptable, 
3341
							(differing != null && differing[j]) ||
3342
							/* not enough to replace the differing mechanism: (acceptable instanceof ParameterizedGenericMethodBinding && ((ParameterizedGenericMethodBinding) acceptable).wasInferred) || */
3343
							acceptable != methodToTest))
3334
						continue nextVisible;
3344
						continue nextVisible;
3335
					// pick a concrete method over a bridge method when parameters are equal since the return type of the concrete method is more specific
3345
					// pick a concrete method over a bridge method when parameters are equal since the return type of the concrete method is more specific
3336
					if (current.isBridge() && !next.isBridge())
3346
					if (current.isBridge() && !next.isBridge())
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-30 / +267 lines)
Lines 799-805 Link Here
799
			"135"
799
			"135"
800
		);
800
		);
801
	}
801
	}
802
	public void test014h() {
802
	public void test014h1() {
803
		this.runConformTest(
803
		this.runConformTest(
804
			new String[] {
804
			new String[] {
805
				"X.java",
805
				"X.java",
Lines 816-823 Link Here
816
				"	<T extends F<C>> void a3(T x) {}\n" + 
816
				"	<T extends F<C>> void a3(T x) {}\n" + 
817
				"	void a4(G x) {}\n" + 
817
				"	void a4(G x) {}\n" + 
818
				"	<T extends C, S extends F<T>> void a4(S x) {}\n" + 
818
				"	<T extends C, S extends F<T>> void a4(S x) {}\n" + 
819
				"	<T extends G> void a5(T x) {}\n" + 
820
				"	void a5(F<C> x) {}\n" +  
821
				"	void b(G<C> x) { System.out.print(true); }\n" + 
819
				"	void b(G<C> x) { System.out.print(true); }\n" + 
822
				"	void b(F x) { System.out.print(false); }\n" +  
820
				"	void b(F x) { System.out.print(false); }\n" +  
823
				"	void b2(G<C> x) { System.out.print(true); }\n" + 
821
				"	void b2(G<C> x) { System.out.print(true); }\n" + 
Lines 860-944 Link Here
860
			},
858
			},
861
			"truetruetruetruetruetruetruetruetruetruetruetruetruetruetruetrue"
859
			"truetruetruetruetruetruetruetruetruetruetruetruetruetruetruetrue"
862
		);
860
		);
861
	}
862
	public void test014h2() {
863
		this.runNegativeTest(
863
		this.runNegativeTest(
864
			new String[] {
864
			new String[] {
865
				"Y.java",
865
				"X.java",
866
				"public class Y extends X {\n" + 
866
				"public class X {\n" + 
867
				"	void a(G x) {}\n" + 
868
				"	void a(F<C> x) {}\n" +  
869
				"}\n" +
870
				"class A {}\n" + 
871
				"class B extends A {}\n" +
872
				"class C extends B {}\n" +
873
				"class F<T1> {} \n" + 
874
				"class G<T2> extends F<T2> {}\n" +
875
				"class H<T3> extends G<T3> {}" +
876
				"class Y extends X {\n" + 
867
				"	public static void ambiguousCases() {\n" + 
877
				"	public static void ambiguousCases() {\n" + 
868
				"		H<C> h = null;\n" +
878
				"		H<C> h = null;\n" +
869
				"		H hraw = null;\n" +
879
				"		H hraw = null;\n" +
870
				"		new X().a(h);\n" +
880
				"		new X().a(h);\n" +
871
				"		new X().a(hraw);\n" +
881
				"		new X().a(hraw);\n" +
872
				"		new X().a2(h);\n" +
873
				"		new X().a2(hraw);\n" +
874
				"		new X().a3(h);\n" +
875
				"		new X().a3(hraw);\n" +
876
				"		new X().a4(h);\n" +
877
				"		new X().a4(hraw);\n" +
878
				"		new X().a5(h);\n" +
879
				"		new X().a5(hraw);\n" +
880
				"	}\n" + 
882
				"	}\n" + 
881
				"}\n"
883
				"}\n"
882
			},
884
			},
883
			"----------\n" + 
885
			"----------\n" + 
884
			"1. WARNING in Y.java (at line 4)\n" + 
886
			"1. WARNING in X.java (at line 2)\n" + 
887
			"	void a(G x) {}\n" + 
888
			"	       ^\n" + 
889
			"G is a raw type. References to generic type G<T2> should be parameterized\n" + 
890
			"----------\n" + 
891
			"2. WARNING in X.java (at line 13)\n" + 
885
			"	H hraw = null;\n" + 
892
			"	H hraw = null;\n" + 
886
			"	^\n" + 
893
			"	^\n" + 
887
			"H is a raw type. References to generic type H<T3> should be parameterized\n" + 
894
			"H is a raw type. References to generic type H<T3> should be parameterized\n" + 
888
			"----------\n" + 
895
			"----------\n" + 
889
			"2. ERROR in Y.java (at line 5)\n" + 
896
			"3. ERROR in X.java (at line 14)\n" + 
890
			"	new X().a(h);\n" + 
897
			"	new X().a(h);\n" + 
891
			"	        ^\n" + 
898
			"	        ^\n" + 
892
			"The method a(G) is ambiguous for the type X\n" + 
899
			"The method a(G) is ambiguous for the type X\n" + 
893
			"----------\n" + 
900
			"----------\n" + 
894
			"3. ERROR in Y.java (at line 6)\n" + 
901
			"4. ERROR in X.java (at line 15)\n" + 
895
			"	new X().a(hraw);\n" + 
902
			"	new X().a(hraw);\n" + 
896
			"	        ^\n" + 
903
			"	        ^\n" + 
897
			"The method a(G) is ambiguous for the type X\n" + 
904
			"The method a(G) is ambiguous for the type X\n" + 
905
			"----------\n",
906
			null,
907
			false
908
		);
909
	}
910
	public void test014h3() {
911
		this.runNegativeTest(
912
			new String[] {
913
				"X.java",
914
				"public class X {\n" + 
915
				"	void a2(G x) {}\n" + 
916
				"	<T extends C> void a2(F<T> x) {}\n" +  
917
				"}\n" +
918
				"class A {}\n" + 
919
				"class B extends A {}\n" +
920
				"class C extends B {}\n" +
921
				"class F<T1> {} \n" + 
922
				"class G<T2> extends F<T2> {}\n" +
923
				"class H<T3> extends G<T3> {}" +
924
				"class Y extends X {\n" + 
925
				"	public static void ambiguousCases() {\n" + 
926
				"		H<C> h = null;\n" +
927
				"		new X().a2(h);\n" +
928
				"	}\n" + 
929
				"}\n"
930
			},
898
			"----------\n" + 
931
			"----------\n" + 
899
			"4. ERROR in Y.java (at line 7)\n" + 
932
			"1. WARNING in X.java (at line 2)\n" + 
933
			"	void a2(G x) {}\n" + 
934
			"	        ^\n" + 
935
			"G is a raw type. References to generic type G<T2> should be parameterized\n" + 
936
			"----------\n" + 
937
			"2. ERROR in X.java (at line 13)\n" + 
900
			"	new X().a2(h);\n" + 
938
			"	new X().a2(h);\n" + 
901
			"	        ^^\n" + 
939
			"	        ^^\n" + 
902
			"The method a2(G) is ambiguous for the type X\n" + 
940
			"The method a2(G) is ambiguous for the type X\n" + 
941
			"----------\n"
942
		);
943
	}
944
	public void test014h4() {
945
		this.runNegativeTest(
946
			new String[] {
947
				"X.java",
948
				"public class X {\n" + 
949
				"	void a2(G x) {}\n" + 
950
				"	<T extends C> void a2(F<T> x) {}\n" +  
951
				"}\n" +
952
				"class A {}\n" + 
953
				"class B extends A {}\n" +
954
				"class C extends B {}\n" +
955
				"class F<T1> {} \n" + 
956
				"class G<T2> extends F<T2> {}\n" +
957
				"class H<T3> extends G<T3> {}" +
958
				"class Y extends X {\n" + 
959
				"	public static void ambiguousCases() {\n" + 
960
				"		H hraw = null;\n" +
961
				"		new X().a2(hraw);\n" +
962
				"	}\n" + 
963
				"}\n"
964
			},
903
			"----------\n" + 
965
			"----------\n" + 
904
			"5. ERROR in Y.java (at line 8)\n" + 
966
			"1. WARNING in X.java (at line 2)\n" + 
967
			"	void a2(G x) {}\n" + 
968
			"	        ^\n" + 
969
			"G is a raw type. References to generic type G<T2> should be parameterized\n" + 
970
			"----------\n" + 
971
			"2. WARNING in X.java (at line 12)\n" + 
972
			"	H hraw = null;\n" + 
973
			"	^\n" + 
974
			"H is a raw type. References to generic type H<T3> should be parameterized\n" + 
975
			"----------\n" + 
976
			"3. ERROR in X.java (at line 13)\n" + 
905
			"	new X().a2(hraw);\n" + 
977
			"	new X().a2(hraw);\n" + 
906
			"	        ^^\n" + 
978
			"	        ^^\n" + 
907
			"The method a2(G) is ambiguous for the type X\n" + 
979
			"The method a2(G) is ambiguous for the type X\n" + 
980
			"----------\n"
981
		);
982
	}
983
	public void test014h5() {
984
		this.runNegativeTest(
985
			new String[] {
986
				"X.java",
987
				"public class X {\n" + 
988
				"	void a3(G x) {}\n" + 
989
				"	<T extends F<C>> void a3(T x) {}\n" + 
990
				"}\n" +
991
				"class A {}\n" + 
992
				"class B extends A {}\n" +
993
				"class C extends B {}\n" +
994
				"class F<T1> {} \n" + 
995
				"class G<T2> extends F<T2> {}\n" +
996
				"class H<T3> extends G<T3> {}" +
997
				"class Y extends X {\n" + 
998
				"	public static void ambiguousCases() {\n" + 
999
				"		H<C> h = null;\n" +
1000
				"		H hraw = null;\n" +
1001
				"		new X().a3(h);\n" +
1002
				"		new X().a3(hraw);\n" +
1003
				"	}\n" + 
1004
				"}\n"
1005
			},
1006
			"----------\n" + 
1007
			"1. WARNING in X.java (at line 2)\n" + 
1008
			"	void a3(G x) {}\n" + 
1009
			"	        ^\n" + 
1010
			"G is a raw type. References to generic type G<T2> should be parameterized\n" + 
908
			"----------\n" + 
1011
			"----------\n" + 
909
			"6. ERROR in Y.java (at line 9)\n" + 
1012
			"2. WARNING in X.java (at line 13)\n" + 
1013
			"	H hraw = null;\n" + 
1014
			"	^\n" + 
1015
			"H is a raw type. References to generic type H<T3> should be parameterized\n" + 
1016
			"----------\n" + 
1017
			"3. ERROR in X.java (at line 14)\n" + 
910
			"	new X().a3(h);\n" + 
1018
			"	new X().a3(h);\n" + 
911
			"	        ^^\n" + 
1019
			"	        ^^\n" + 
912
			"The method a3(G) is ambiguous for the type X\n" + 
1020
			"The method a3(G) is ambiguous for the type X\n" + 
913
			"----------\n" + 
1021
			"----------\n" + 
914
			"7. ERROR in Y.java (at line 10)\n" + 
1022
			"4. ERROR in X.java (at line 15)\n" + 
915
			"	new X().a3(hraw);\n" + 
1023
			"	new X().a3(hraw);\n" + 
916
			"	        ^^\n" + 
1024
			"	        ^^\n" + 
917
			"The method a3(G) is ambiguous for the type X\n" + 
1025
			"The method a3(G) is ambiguous for the type X\n" + 
1026
			"----------\n",
1027
			null,
1028
			false
1029
		);
1030
	}
1031
	public void test014h6() {
1032
		this.runNegativeTest(
1033
			new String[] {
1034
				"X.java",
1035
				"public class X {\n" + 
1036
				"	void a4(G x) {}\n" + 
1037
				"	<T extends C, S extends F<T>> void a4(S x) {}\n" + 
1038
				"}\n" +
1039
				"class A {}\n" + 
1040
				"class B extends A {}\n" +
1041
				"class C extends B {}\n" +
1042
				"class F<T1> {} \n" + 
1043
				"class G<T2> extends F<T2> {}\n" +
1044
				"class H<T3> extends G<T3> {}" +
1045
				"class Y extends X {\n" + 
1046
				"	public static void ambiguousCases() {\n" + 
1047
				"		H<C> h = null;\n" +
1048
				"		H hraw = null;\n" +
1049
				"		new X().a4(h);\n" +
1050
				"		new X().a4(hraw);\n" +
1051
				"	}\n" + 
1052
				"}\n"
1053
			},
918
			"----------\n" + 
1054
			"----------\n" + 
919
			"8. ERROR in Y.java (at line 11)\n" + 
1055
			"1. WARNING in X.java (at line 2)\n" + 
1056
			"	void a4(G x) {}\n" + 
1057
			"	        ^\n" + 
1058
			"G is a raw type. References to generic type G<T2> should be parameterized\n" + 
1059
			"----------\n" + 
1060
			"2. WARNING in X.java (at line 13)\n" + 
1061
			"	H hraw = null;\n" + 
1062
			"	^\n" + 
1063
			"H is a raw type. References to generic type H<T3> should be parameterized\n" + 
1064
			"----------\n" + 
1065
			"3. ERROR in X.java (at line 14)\n" + 
920
			"	new X().a4(h);\n" + 
1066
			"	new X().a4(h);\n" + 
921
			"	        ^^\n" + 
1067
			"	        ^^\n" + 
922
			"The method a4(G) is ambiguous for the type X\n" + 
1068
			"The method a4(G) is ambiguous for the type X\n" + 
923
			"----------\n" + 
1069
			"----------\n" + 
924
			"9. ERROR in Y.java (at line 12)\n" + 
1070
			"4. ERROR in X.java (at line 15)\n" + 
925
			"	new X().a4(hraw);\n" + 
1071
			"	new X().a4(hraw);\n" + 
926
			"	        ^^\n" + 
1072
			"	        ^^\n" + 
927
			"The method a4(G) is ambiguous for the type X\n" + 
1073
			"The method a4(G) is ambiguous for the type X\n" + 
1074
			"----------\n",
1075
			null,
1076
			false
1077
		);
1078
	}
1079
	public void test014h7() {
1080
		this.runNegativeTest(
1081
			new String[] {
1082
				"X.java",
1083
				"public class X {\n" + 
1084
				"	<T extends G> void a5(T x) {}\n" + 
1085
				"	void a5(F<C> x) {}\n" +  
1086
				"}\n" +
1087
				"class A {}\n" + 
1088
				"class B extends A {}\n" +
1089
				"class C extends B {}\n" +
1090
				"class F<T1> {} \n" + 
1091
				"class G<T2> extends F<T2> {}\n" +
1092
				"class H<T3> extends G<T3> {}" +
1093
				"class Y extends X {\n" + 
1094
				"	public static void ambiguousCases() {\n" + 
1095
				"		H<C> h = null;\n" +
1096
				"		H hraw = null;\n" +
1097
				"		new X().a5(h);\n" +
1098
				"		new X().a5(hraw);\n" +
1099
				"	}\n" + 
1100
				"}\n"
1101
			},
1102
			"----------\n" + 
1103
			"1. WARNING in X.java (at line 2)\n" + 
1104
			"	<T extends G> void a5(T x) {}\n" + 
1105
			"	           ^\n" + 
1106
			"G is a raw type. References to generic type G<T2> should be parameterized\n" + 
1107
			"----------\n" + 
1108
			"2. WARNING in X.java (at line 13)\n" + 
1109
			"	H hraw = null;\n" + 
1110
			"	^\n" + 
1111
			"H is a raw type. References to generic type H<T3> should be parameterized\n" + 
928
			"----------\n" + 
1112
			"----------\n" + 
929
			"10. ERROR in Y.java (at line 13)\n" + 
1113
			"3. ERROR in X.java (at line 14)\n" + 
930
			"	new X().a5(h);\n" + 
1114
			"	new X().a5(h);\n" + 
931
			"	        ^^\n" + 
1115
			"	        ^^\n" + 
932
			"The method a5(H<C>) is ambiguous for the type X\n" + 
1116
			"The method a5(H<C>) is ambiguous for the type X\n" + 
933
			"----------\n" + 
1117
			"----------\n" + 
934
			"11. ERROR in Y.java (at line 14)\n" + 
1118
			"4. ERROR in X.java (at line 15)\n" + 
935
			"	new X().a5(hraw);\n" + 
1119
			"	new X().a5(hraw);\n" + 
936
			"	        ^^\n" + 
1120
			"	        ^^\n" + 
937
			"The method a5(H) is ambiguous for the type X\n" + 
1121
			"The method a5(H) is ambiguous for the type X\n" + 
938
			"----------\n",
1122
			"----------\n");
939
			null,
940
			false
941
		);
942
	}
1123
	}
943
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79798
1124
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79798
944
	public void test015() {
1125
	public void test015() {
Lines 2091-2097 Link Here
2091
	);
2272
	);
2092
}
2273
}
2093
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933
2274
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933
2094
public void _test060() {
2275
public void test060() {
2095
	this.runConformTest(
2276
	this.runConformTest(
2096
		new String[] {
2277
		new String[] {
2097
			"X.java",
2278
			"X.java",
Lines 2120-2126 Link Here
2120
}
2301
}
2121
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933
2302
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933
2122
// variant
2303
// variant
2123
public void _test061() {
2304
public void test061() {
2124
	this.runNegativeTest(
2305
	this.runNegativeTest(
2125
		new String[] {
2306
		new String[] {
2126
			"X.java",
2307
			"X.java",
Lines 2177-2180 Link Here
2177
		"----------\n"
2358
		"----------\n"
2178
	);
2359
	);
2179
}
2360
}
2361
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933
2362
// variant
2363
public void test062() {
2364
	this.runConformTest(
2365
		new String[] {
2366
			"X.java",
2367
			"public class X<T> {\n" + 
2368
			"  public void bar(K<T, Object> p) {\n" + 
2369
			"    new Y<T, Object>(p);\n" + 
2370
			"    new Y<T, Object>((J<T, Object>) p);\n" + 			
2371
			"  }\n" + 
2372
			"}\n" + 
2373
			"class Y<T, U> {\n" + 
2374
			"  Y(I<? extends T, ? extends U> p) {\n" + 
2375
			"  }\n" + 
2376
			"  Y(J<T, ? extends U> p) {\n" + 
2377
			"  }\n" + 
2378
			"}\n" + 
2379
			"interface I<T, U> {  \n" + 
2380
			"}\n" + 
2381
			"interface J<T, U> extends I<T, U> {\n" + 
2382
			"}\n" + 
2383
			"interface K<T, U> extends I<T, U>, J<T, U> {\n" + 
2384
			"}"
2385
		},
2386
		""
2387
	);
2388
}
2389
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933
2390
// variant
2391
public void test063() {
2392
	this.runConformTest(
2393
		new String[] {
2394
			"X.java",
2395
			"public class X<T, U> {\n" + 
2396
			"  public void bar(K<T, U> p) {\n" + 
2397
			"    new Y<T, U>(p);\n" + 
2398
			"    new Y<T, U>((J<T, U>) p);\n" + 			
2399
			"  }\n" + 
2400
			"}\n" + 
2401
			"class Y<T, U> {\n" + 
2402
			"  Y(I<? extends T, ? extends U> p) {\n" + 
2403
			"  }\n" + 
2404
			"  Y(J<T, ? extends U> p) {\n" + 
2405
			"  }\n" + 
2406
			"}\n" + 
2407
			"interface I<T, U> {  \n" + 
2408
			"}\n" + 
2409
			"interface J<T, U> extends I<T, U> {\n" + 
2410
			"}\n" + 
2411
			"interface K<T, U> extends I<T, U>, J<T, U> {\n" + 
2412
			"}"
2413
		},
2414
		""
2415
	);
2416
}
2180
}
2417
}

Return to bug 189933