assertEquals(1, getErrorMessages(p).size());
assertContains("B.java:4:0::0 Unhandled exception type Exception", getErrorMessages(p).get(0));
}
+
+ // changing method return type parameterization
+ public void testModifiedGenericParameterTypeShouldTriggerError_318884_3() throws Exception {
+ String p = "pr318884_3";
+ initialiseProject(p);
+ build(p);
+ checkWasFullBuild();
+ checkCompileWeaveCount(p, 2, 2);
+ alter(p, "inc1");
+ build(p);
+ checkWasntFullBuild();
+ assertEquals(1, getErrorMessages(p).size());
+ assertContains("The return type is incompatible with B.foo()", getErrorMessages(p).get(0));
+ }
+
+ // changing method parameter type parameterization
+ public void testModifiedGenericParameterTypeShouldTriggerError_318884_4() throws Exception {
+ String p = "pr318884_4";
+ initialiseProject(p);
+ build(p);
+ checkWasFullBuild();
+ checkCompileWeaveCount(p, 2, 2);
+ alter(p, "inc1");
+ build(p);
+ checkWasntFullBuild();
+ assertEquals(1, getErrorMessages(p).size());
+ assertContains(
+ "Name clash: The method foo(List<String>) of type A has the same erasure as foo(List<Integer>) of type B but does not override it",
+ getErrorMessages(p).get(0));
+ }
+
+ // changing constructor parameter type parameterization
+ public void testModifiedGenericParameterTypeShouldTriggerError_318884_5() throws Exception {
+ String p = "pr318884_5";
+ initialiseProject(p);
+ build(p);
+ checkWasFullBuild();
+ checkCompileWeaveCount(p, 2, 2);
+ alter(p, "inc1");
+ build(p);
+ checkWasntFullBuild();
+ assertEquals(1, getErrorMessages(p).size());
+ assertContains("The constructor B(List<String>) is undefined", getErrorMessages(p).get(0));
+ }
}