--- /dev/null
+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
+ }
+}
--- /dev/null
+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;
+ }
+}
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");
+ }
}
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());
+ }
}
<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"/>
<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">