diff options
author | acolyer <acolyer> | 2005-08-25 12:52:12 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-25 12:52:12 +0000 |
commit | 2172ceec0382a30dd7c8bbcf4e983b70225243a4 (patch) | |
tree | e5138bd599771eb27a008e8c300bce66a30bb2d4 | |
parent | 4d2c46f3f99d7ca0bbfbdbac6adb92f64a851653 (diff) | |
download | aspectj-2172ceec0382a30dd7c8bbcf4e983b70225243a4.tar.gz aspectj-2172ceec0382a30dd7c8bbcf4e983b70225243a4.zip |
tests for pr107898 and pr72668
-rw-r--r-- | tests/bugs150/PointcutsInInterfaces.aj | 15 | ||||
-rw-r--r-- | tests/bugs150/pr107898.aj | 17 | ||||
-rw-r--r-- | tests/bugs150/pr72668.aj | 20 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 11 |
5 files changed, 71 insertions, 0 deletions
diff --git a/tests/bugs150/PointcutsInInterfaces.aj b/tests/bugs150/PointcutsInInterfaces.aj new file mode 100644 index 000000000..18e825c97 --- /dev/null +++ b/tests/bugs150/PointcutsInInterfaces.aj @@ -0,0 +1,15 @@ +public interface PointcutsInInterfaces { + + public pointcut foo() : execution(* *(..)); + +} + +class C { + void foo() {} +} + +aspect A { + + declare warning : PointcutsInInterfaces.foo() : "aha!"; + +}
\ No newline at end of file diff --git a/tests/bugs150/pr107898.aj b/tests/bugs150/pr107898.aj new file mode 100644 index 000000000..272d2dcab --- /dev/null +++ b/tests/bugs150/pr107898.aj @@ -0,0 +1,17 @@ +class Bug_Provider { + public void enable_bug(Object argument) {} +} + +class Null_Provider<T> extends Bug_Provider { + public T get_typed_null() { + return null; + } +} + +public class pr107898 { + public static void main(String[] args) { + Null_Provider<Integer> null_provider = new Null_Provider<Integer>() {}; + null_provider.enable_bug(null); + Integer i = null_provider.get_typed_null(); // type mismatch + } +}
\ No newline at end of file diff --git a/tests/bugs150/pr72668.aj b/tests/bugs150/pr72668.aj new file mode 100644 index 000000000..6c8dac4ba --- /dev/null +++ b/tests/bugs150/pr72668.aj @@ -0,0 +1,20 @@ +public aspect pr72668 { + + Number[] getThoseInts() { + return new Integer[0]; + } + + declare warning : execution(Object[] *(..)) : "should not match"; + + @org.aspectj.lang.annotation.SuppressAjWarnings("adviceDidNotMatch") + Object[] around() : execution(*[] *(..)) { + Object[] ret = proceed(); + return (Object[]) ret.clone(); + } + + Integer[] around() : execution(*[] *(..)) { + Number[] ret = proceed(); + return (Integer[]) ret.clone(); + } + +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 8dae040fd..f3fb8cb6f 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -274,6 +274,14 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("Compiler error due to a wrong exception check in try blocks"); } + public void testAnonymousInnerClassWithMethodReturningTypeParameter_pr107898() { + runTest("anonymous inner class with method returning type parameter"); + } + + public void testMatchingOfObjectArray() { + runTest("matching against Object[]"); + } + // 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 46ad3374a..a78887390 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -178,6 +178,17 @@ </run> </ajc-test> + <ajc-test title="anonymous inner class with method returning type parameter" pr="107898" dir="bugs150"> + <compile files="pr107898.aj" options="-1.5"></compile> + </ajc-test> + + <ajc-test title="matching against Object[]" pr="72668" dir="bugs150"> + <compile files="pr72668.aj" options="-1.5"> + <message kind="error" line="3" text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"></message> + <message kind="error" line="10" text="incompatible return type applying to method-execution(java.lang.Number[] pr72668.getThoseInts())"></message> + </compile> + </ajc-test> + <ajc-test dir="decp" pr="80249" title="Order of types passed to compiler determines weaving behavior"> <compile files="A.java,B.java,AspectX.java"/> <run class="B"/> |