From 2172ceec0382a30dd7c8bbcf4e983b70225243a4 Mon Sep 17 00:00:00 2001 From: acolyer Date: Thu, 25 Aug 2005 12:52:12 +0000 Subject: tests for pr107898 and pr72668 --- tests/bugs150/PointcutsInInterfaces.aj | 15 +++++++++++++++ tests/bugs150/pr107898.aj | 17 +++++++++++++++++ tests/bugs150/pr72668.aj | 20 ++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/bugs150/PointcutsInInterfaces.aj create mode 100644 tests/bugs150/pr107898.aj create mode 100644 tests/bugs150/pr72668.aj (limited to 'tests/bugs150') 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 extends Bug_Provider { + public T get_typed_null() { + return null; + } +} + +public class pr107898 { + public static void main(String[] args) { + Null_Provider null_provider = new Null_Provider() {}; + 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 -- cgit v1.2.3