diff options
author | aclement <aclement> | 2005-06-14 13:58:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-06-14 13:58:09 +0000 |
commit | d6bfe97b4db7f2109a4a088ebd0898b3ef8740e9 (patch) | |
tree | d088f7eb6ff2ec1e4abc99ff5b26a233d1580573 | |
parent | e25db87b054247a2b71f6ab709b91e1f776cd223 (diff) | |
download | aspectj-d6bfe97b4db7f2109a4a088ebd0898b3ef8740e9.tar.gz aspectj-d6bfe97b4db7f2109a4a088ebd0898b3ef8740e9.zip |
Tests for 98320, 99228, 99089: [generics][itds]
-rw-r--r-- | tests/bugs150/PR98320.aj | 18 | ||||
-rw-r--r-- | tests/bugs150/PR99228.aj | 22 | ||||
-rw-r--r-- | tests/bugs150/pr99089/DataClass.java | 14 | ||||
-rw-r--r-- | tests/bugs150/pr99089/TracingAspect.java | 11 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 14 |
5 files changed, 74 insertions, 5 deletions
diff --git a/tests/bugs150/PR98320.aj b/tests/bugs150/PR98320.aj new file mode 100644 index 000000000..ad07cd9e3 --- /dev/null +++ b/tests/bugs150/PR98320.aj @@ -0,0 +1,18 @@ +import java.util.*; + +class C { + Set<String> simple_local; + Set<Set<String>> nested_local; +} + +aspect Inter_Type_Injector { + Set<String> C.simple_intertype; + Set<Set<String>> C.nested_intertype; + + public void test() { + Set<String> simple_local = new C().simple_local; // works + Set<String> simple_intertype = new C().simple_intertype; // works + Set<Set<String>> nested_local = new C().nested_local; // works + Set<Set<String>> nested_intertype = new C().nested_intertype; // fails + } +} diff --git a/tests/bugs150/PR99228.aj b/tests/bugs150/PR99228.aj new file mode 100644 index 000000000..78288c934 --- /dev/null +++ b/tests/bugs150/PR99228.aj @@ -0,0 +1,22 @@ +class Normal { int basicField;} +class Generic<T> { int basicField;} + +aspect Injector { + void Normal.method() {} + void Generic.method() {} + int Normal.itdField; + int Generic.itdField; + + void test() { + new Normal().method(); + new Generic<Integer>().method(); + + int n1 = new Normal().basicField; + int normal = new Normal().itdField; + + int a = new Generic<Integer>().basicField; + int b = new Generic<Integer>().itdField; + int c = new Generic().basicField; + int d = new Generic().itdField; + } +} diff --git a/tests/bugs150/pr99089/DataClass.java b/tests/bugs150/pr99089/DataClass.java index cbfb7905d..91e76763d 100644 --- a/tests/bugs150/pr99089/DataClass.java +++ b/tests/bugs150/pr99089/DataClass.java @@ -1,6 +1,16 @@ import java.util.Vector; public class DataClass { - private Vector<Object> v = new Vector<Object>(); - private Vector<Object> getV() { return v; } + private Vector<Object> v = new Vector<Object>(); + private Vector<Object> getV() { return v; } + + public static void main(String[]argv) { + DataClass dc = new DataClass(); + dc.v.add("hello"); + dc.doit(); + } + + public void doit() { + v.add("world"); + } } diff --git a/tests/bugs150/pr99089/TracingAspect.java b/tests/bugs150/pr99089/TracingAspect.java index ba3ef7ef6..f318797bf 100644 --- a/tests/bugs150/pr99089/TracingAspect.java +++ b/tests/bugs150/pr99089/TracingAspect.java @@ -1,7 +1,12 @@ import java.util.Vector; privileged aspect TracingAspect { - before(DataClass dc): execution(* DataClass.doit()) && this(dc) { - Vector<Object> myV = dc.getV(); - } + before(DataClass dc): execution(* DataClass.doit()) && this(dc) { + Vector<Object> myV = dc.getV(); + System.err.println("before:Length of v="+myV.size()); + } + after(DataClass dc): execution(* DataClass.doit()) && this(dc) { + Vector<Object> myV = dc.getV(); + System.err.println("after:Length of v="+myV.size()); + } } diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index eab14b2b3..00ab89eb9 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -72,6 +72,14 @@ <run class="B"/> </ajc-test> + <ajc-test dir="bugs150" pr="99228" vm="1.5" title="ITD of a field into a generic class"> + <compile files="PR99228.aj" options="-1.5"/> + </ajc-test> + + <ajc-test dir="bugs150" pr="98320" vm="1.5" title="intertype with nested generic type"> + <compile files="PR98320.aj" options="-1.5"/> + </ajc-test> + <ajc-test dir="decs" pr="42743" title="declare soft of runtime exception"> <compile files="DeclareSoftRuntimeException.aj"> <message kind="warning" line="3" text="MyRuntimeException will not be softened as it is already a RuntimeException"/> @@ -114,6 +122,12 @@ <ajc-test dir="bugs150/pr99089" vm="1.5" pr="99089" title="ArrayIndexOutOfBoundsException - Generics in privileged aspects"> <compile files="DataClass.java,TracingAspect.java" options="-1.5"/> + <run class="DataClass"> + <stderr> + <line text="before:Length of v=1"/> + <line text="after:Length of v=2"/> + </stderr> + </run> </ajc-test> <ajc-test dir="bugs150" pr="79554" title="Return in try-block disables catch-block if final-block is present"> |