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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (-1 / +11 lines)
Lines 80-86 Link Here
80
				    }
80
				    }
81
				}
81
				}
82
			}
82
			}
83
			if (!hasErrors) this.tagBits |= TagBits.PassedBoundCheck; // no need to recheck it in the future
83
			if (!hasErrors) {
84
				this.tagBits |= TagBits.PassedBoundCheck; // no need to recheck it in the future
85
				if (this.arguments != null) {
86
					for (int i = 0, length = this.arguments.length; i < length; i++) {
87
					    if (this.arguments[i].leafComponentType() instanceof ParameterizedTypeBinding) {
88
					    	ParameterizedTypeBinding parameterizedType = (ParameterizedTypeBinding) this.arguments[i].leafComponentType();
89
					    	parameterizedType.boundCheck(scope, argumentReferences);
90
					    }
91
					}
92
				}
93
			}
84
		}
94
		}
85
	}
95
	}
86
	/**
96
	/**
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+37 lines)
Lines 49455-49458 Link Here
49455
             ""
49455
             ""
49456
     );
49456
     );
49457
}
49457
}
49458
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=159851
49459
public void test1450() {
49460
	this.runNegativeTest(
49461
		new String[] {
49462
			"X.java",
49463
			"import java.util.*;\n" +
49464
			"class A {}\n" +
49465
			"class B<T extends A> {}\n" +
49466
			"class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
49467
			"\n" +
49468
			"class D<T> {}\n" +
49469
			"class E<T extends Number> {}\n" +
49470
			"class Y<T> extends E<D<T>> {}",
49471
		},
49472
		"----------\n" + 
49473
		"1. WARNING in X.java (at line 4)\n" + 
49474
		"	class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + 
49475
		"	      ^\n" + 
49476
		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
49477
		"----------\n" + 
49478
		"2. ERROR in X.java (at line 4)\n" + 
49479
		"	class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + 
49480
		"	                            ^\n" + 
49481
		"Bound mismatch: The type Integer is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" + 
49482
		"----------\n" + 
49483
		"3. ERROR in X.java (at line 4)\n" + 
49484
		"	class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + 
49485
		"	                                                         ^^^^^^^\n" + 
49486
		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" + 
49487
		"----------\n" + 
49488
		"4. ERROR in X.java (at line 8)\n" + 
49489
		"	class Y<T> extends E<D<T>> {}\n" + 
49490
		"	                     ^\n" + 
49491
		"Bound mismatch: The type D<T> is not a valid substitute for the bounded parameter <T extends Number> of the type E<T>\n" + 
49492
		"----------\n"
49493
	);
49494
}
49458
}
49495
}

Return to bug 159851