diff options
author | acolyer <acolyer> | 2005-08-21 19:51:47 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-21 19:51:47 +0000 |
commit | 3cedc6ef49a4a98ed33701d3545074ac97f2af04 (patch) | |
tree | 5b29eb6eff21396bb2309ecca99b6fb58c575f8a | |
parent | 197ea8d62a60b4b2e3e22a94ea01c1ec009d485d (diff) | |
download | aspectj-3cedc6ef49a4a98ed33701d3545074ac97f2af04.tar.gz aspectj-3cedc6ef49a4a98ed33701d3545074ac97f2af04.zip |
tests for pr83377
-rw-r--r-- | tests/bugs150/pr83377.aj | 18 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 68 |
3 files changed, 80 insertions, 10 deletions
diff --git a/tests/bugs150/pr83377.aj b/tests/bugs150/pr83377.aj new file mode 100644 index 000000000..821778c63 --- /dev/null +++ b/tests/bugs150/pr83377.aj @@ -0,0 +1,18 @@ + +interface I extends Cloneable { + public Object clone (); +} + +class C implements I { +// public Object clone() {return this;} + +} + +privileged aspect A { + declare parents : C implements java.lang.Cloneable; + + public Object C.clone () { + return null; + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index e4dcf188d..bb25a4f25 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -258,6 +258,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("good error message for unmatched member syntax"); } + public void testITDWithNoExceptionAndIntermediary() { + runTest("itd override with no exception clause"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 362b41c9a..1abf02a21 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -143,6 +143,10 @@ <message kind="error" line="41" text="ConnectionRequestContext cannot be resolved to a type"/> </compile> </ajc-test> + + <ajc-test title="itd override with no exception clause" dir="bugs150"> + <compile files="pr83377.aj"></compile> + </ajc-test> <ajc-test dir="bugs150/pr84260" vm="1.5" title="static import failures"> <compile files="A.java,I1.java,I2.java" options="-1.5"/> @@ -335,7 +339,51 @@ <message kind="error" line="3" text="Syntax error on token "new", "method name (not constructor)" expected"/> </compile> </ajc-test> - + + <!-- hasmethod / hasfield tests --> + + <ajc-test title="declare parents : hasmethod(..) - 1" dir="hasmember"> + <compile files="HasMethod.aj"> + </compile> + <run class="HasMethod"></run> + </ajc-test> + + <ajc-test title="declare parents : hasmethod(..) - 2" dir="hasmember"> + <compile files="HasMethodInherited.aj"> + </compile> + <run class="HasMethodInherited"></run> + </ajc-test> + + <ajc-test title="declare parents : hasmethod(..) - 3" dir="hasmember"> + <compile files="HasPrivateMethodInherited.aj"> + </compile> + <run class="HasPrivateMethodInherited"></run> + </ajc-test> + + <ajc-test title="declare parents : hasmethod(..) - 4" dir="hasmember"> + <compile files="HasMethodViaITD.aj"> + <message kind="warning" line="15" text="hasmethod matched on ITD ok"/> + </compile> + </ajc-test> + + <ajc-test title="declare parents : hasfield(..) - 1" dir="hasmember"> + <compile files="HasField.aj"> + </compile> + <run class="HasField"></run> + </ajc-test> + + <ajc-test title="declare parents : hasfield(..) - 2" dir="hasmember"> + <compile files="HasFieldInherited.aj"> + </compile> + <run class="HasFieldInherited"></run> + </ajc-test> + + <ajc-test title="declare parents : hasfield(..) - 3" dir="hasmember"> + <compile files="HasPrivateFieldInherited.aj"> + </compile> + <run class="HasPrivateFieldInherited"></run> + </ajc-test> + <!-- Annotation binding tests --> <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 1"> @@ -2603,14 +2651,14 @@ <ajc-test dir="java5/generics/itds" title="parameterized method itd - 2"> <compile files="ParameterizedMethodITD2.aj" options="-1.5"> - <message kind="error" line="9" text="The method simple(List<? extends Number>) in the type X is not applicable for the arguments (List<A>)"/> + <message kind="error" line="9" text="The method simple(List<? extends Number>) in the type Base is not applicable for the arguments (List<A>)"/> </compile> </ajc-test> <ajc-test dir="java5/generics/itds" title="parameterized method itd - 3"> <compile files="ParameterizedMethodITD3.aj" options="-1.5"> - <message kind="error" line="9" text="The method simple(List<? super A>) in the type X is not applicable for the arguments (List<B>)"/> + <message kind="error" line="9" text="The method simple(List<? super A>) in the type Base is not applicable for the arguments (List<B>)"/> </compile> </ajc-test> @@ -2626,7 +2674,7 @@ <ajc-test dir="java5/generics/itds" title="generic method itd - 2"> <compile files="GenericMethodITD2.aj" options="-1.5"> - <message kind="error" line="9" text="Bound mismatch: The generic method simple(List<? extends E>) of type X is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <E extends Number>"/> + <message kind="error" line="9" text="Bound mismatch: The generic method simple(List<? extends E>) of type Base is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <E extends Number>"/> </compile> </ajc-test> @@ -2642,7 +2690,7 @@ <ajc-test dir="java5/generics/itds" title="generic method itd - 5"> <compile files="GenericMethodITD5.aj" options="-1.5"> - <message kind="error" line="10" text="The method simple(List<E>, List<E>) in the type X is not applicable for the arguments (List<A>, List<B>)"/> + <message kind="error" line="10" text="The method simple(List<E>, List<E>) in the type Base is not applicable for the arguments (List<A>, List<B>)"/> </compile> </ajc-test> @@ -2658,7 +2706,7 @@ <ajc-test dir="java5/generics/itds" title="generic method itd - 8"> <compile files="GenericMethodITD8.aj" options="-1.5"> - <message kind="error" line="10" text="The method simple(List<E>, List<? extends E>) in the type X is not applicable for the arguments (List<Number>, List<String>)"/> + <message kind="error" line="10" text="The method simple(List<E>, List<? extends E>) in the type Base is not applicable for the arguments (List<Number>, List<String>)"/> </compile> </ajc-test> @@ -2669,7 +2717,7 @@ <ajc-test dir="java5/generics/itds" title="generic method itd - 10"> <compile files="GenericMethodITD10.aj" options="-1.5"> - <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type X is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <R extends Object & Comparable<? super R>>"/> + <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type Base is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <R extends Object & Comparable<? super R>>"/> </compile> </ajc-test> @@ -2680,7 +2728,7 @@ <ajc-test dir="java5/generics/itds" title="generic method itd - 12"> <compile files="GenericMethodITD12.aj" options="-1.5"> - <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type X is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <R extends Object & Foo<? extends R>>"/> + <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type Base is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <R extends Object & Foo<? extends R>>"/> </compile> </ajc-test> @@ -2691,7 +2739,7 @@ <ajc-test dir="java5/generics/itds" title="generic method itd - 14"> <compile files="GenericMethodITD14.aj" options="-1.5"> - <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type X is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <R extends Object & Foo<? super R>>"/> + <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type Base is not applicable for the arguments (List<A>). The inferred type A is not a valid substitute for the bounded parameter <R extends Object & Foo<? super R>>"/> </compile> </ajc-test> @@ -2719,7 +2767,7 @@ <ajc-test dir="java5/generics/itds/visibility" title="public itds with errors"> <compile files="PublicITDsErrors.aj" options="-1.5"> - <message kind="error" line="13" text="The method publicMethod2(List<R>, List<R>) in the type X is not applicable for the arguments (List<Double>, List<Float>)"/> + <message kind="error" line="13" text="The method publicMethod2(List<R>, List<R>) in the type Base is not applicable for the arguments (List<Double>, List<Float>)"/> <message kind="error" line="15" text="The constructor Base(List<Double>, Map<Integer,String>) is undefined"/> </compile> </ajc-test> |