diff options
author | acolyer <acolyer> | 2005-11-03 17:09:45 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-11-03 17:09:45 +0000 |
commit | 9025e8b4185cf965d51e64b1ed0aba7e43d33842 (patch) | |
tree | ee5d7d16f1ea95c5bcf8dea3f7eff00626335aaa | |
parent | 38084566dbf9d17cbe375f7fdfa14a821e3d7311 (diff) | |
download | aspectj-9025e8b4185cf965d51e64b1ed0aba7e43d33842.tar.gz aspectj-9025e8b4185cf965d51e64b1ed0aba7e43d33842.zip |
tests for pr62606 - itdcs don't run field initialisers in target type. Largely updates to existing tests to cope with new Lint warning.
43 files changed, 117 insertions, 65 deletions
diff --git a/tests/base/test103/Driver.java b/tests/base/test103/Driver.java index 68961d801..cdb42e809 100644 --- a/tests/base/test103/Driver.java +++ b/tests/base/test103/Driver.java @@ -46,7 +46,8 @@ aspect Foo { return other; } - Pos.new(MagicKey key) { + Pos.new(MagicKey key) { + this(); other = id; id = getOther(); } diff --git a/tests/base/test115/Driver.java b/tests/base/test115/Driver.java index a15967fc0..16fb5b13e 100644 --- a/tests/base/test115/Driver.java +++ b/tests/base/test115/Driver.java @@ -19,7 +19,7 @@ class SubClass extends Class {} aspect Aspect { static int count = 0; //introduction subtypes(Class) { - Class.new(int i) {count++;} + Class.new(int i) {this(); count++;} SubClass.new(int i) {super(2); count++;} //} } diff --git a/tests/base/test118/Driver.java b/tests/base/test118/Driver.java index 5d0db8c15..813a395a6 100644 --- a/tests/base/test118/Driver.java +++ b/tests/base/test118/Driver.java @@ -53,11 +53,11 @@ aspect A1 { C1.new() { c1Count++; - } - C1.new(int x) { - c1IntCount++; - } - } + } + C1.new(int x) { + c1IntCount++; + } +} aspect Verify { diff --git a/tests/base/test121/Driver.java b/tests/base/test121/Driver.java index ff9fffb28..c363fbd3e 100644 --- a/tests/base/test121/Driver.java +++ b/tests/base/test121/Driver.java @@ -74,7 +74,7 @@ aspect A pertarget(target(Foo)){ // System.out.println(thisJoinPoint.className +"."+ // thisJoinPoint.methodName); } - Foo.new(int n) { ranIntroducedConstructor = true; } + Foo.new(int n) { this(); ranIntroducedConstructor = true; } // make sure advice doesn't go on the toString() method // this would result in an infinite recursion diff --git a/tests/bugs/DecwInitializationITD.java b/tests/bugs/DecwInitializationITD.java index 26bab8b9e..dec83b051 100644 --- a/tests/bugs/DecwInitializationITD.java +++ b/tests/bugs/DecwInitializationITD.java @@ -8,7 +8,7 @@ // initialization(HW.new(String)) will not match ! aspect A { - HW.new(String s) {} + HW.new(String s) { this(); } declare warning : initialization(HW.new(String,A)) : "Funky ctor found!"; } diff --git a/tests/bugs/WithincodeNPE01.java b/tests/bugs/WithincodeNPE01.java index 8e7accb23..0ff93dc67 100644 --- a/tests/bugs/WithincodeNPE01.java +++ b/tests/bugs/WithincodeNPE01.java @@ -1,5 +1,5 @@ aspect B { - public A.new(String s) { } + public A.new(String s) {this(); } public void A.foo() { int i = 1; } declare warning: withincode(void main(..)): "X"; // Would NPE without the fix for PR67774 diff --git a/tests/bugs150/PR82570_1.java b/tests/bugs150/PR82570_1.java index 074ad22d1..c7eb464d6 100644 --- a/tests/bugs150/PR82570_1.java +++ b/tests/bugs150/PR82570_1.java @@ -12,7 +12,7 @@ public class PR82570_1 { aspect X { - public PR82570_1.new(String p) {} + public PR82570_1.new(String p) { this(); } public int PR82570_1.itdField; diff --git a/tests/bugs150/Pr62606.aj b/tests/bugs150/Pr62606.aj new file mode 100644 index 000000000..0cf661647 --- /dev/null +++ b/tests/bugs150/Pr62606.aj @@ -0,0 +1,35 @@ +import org.aspectj.lang.annotation.*; + +public aspect Pr62606 { + + // xlint + public Target.new() {} + + // no xlint + public Target.new(String s) { + this(1); + } + + // no xlint + @SuppressAjWarnings + public Target.new(double d) {} + + // no xlint + @SuppressAjWarnings({"noExplicitConstructorCall"}) + public Target.new(float f) {} + + // no xlint + @SuppressAjWarnings({"adviceDidNotMatch","noExplicitConstructorCall"}) + public Target.new(short s) {} +} + +class Target { + + int x = 5; + int y; + + public Target(int z) { + this.y = z; + } + +}
\ No newline at end of file diff --git a/tests/bugs150/pr111481.aj b/tests/bugs150/pr111481.aj index e764b4e4f..6c3020b70 100644 --- a/tests/bugs150/pr111481.aj +++ b/tests/bugs150/pr111481.aj @@ -8,6 +8,7 @@ public class pr111481 { } aspect A { public pr111481.new(Object... names) { + this(); System.out.println(names[0]); } diff --git a/tests/bugs150/pr113073.java b/tests/bugs150/pr113073.java index 9e57ffaa9..6ebff397d 100644 --- a/tests/bugs150/pr113073.java +++ b/tests/bugs150/pr113073.java @@ -9,6 +9,7 @@ class C { aspect D { public C.new(String s) { + this(); } public void C.anotherMethod(String s) { } diff --git a/tests/bugs150/pr59397.aj b/tests/bugs150/pr59397.aj index a8c157c9e..b11d6f475 100644 --- a/tests/bugs150/pr59397.aj +++ b/tests/bugs150/pr59397.aj @@ -1,5 +1,5 @@ aspect A { - HW.new(String s) {} + HW.new(String s) {this();} declare warning : initialization(HW.new(String,A)) : "should not match"; declare warning : initialization(HW.new(String)) : "should match"; } diff --git a/tests/design/intro/Simple.java b/tests/design/intro/Simple.java index cd995d993..d72b04a17 100644 --- a/tests/design/intro/Simple.java +++ b/tests/design/intro/Simple.java @@ -56,10 +56,10 @@ aspect A { return new C(2).m(); } - public C.new(String s) { } + public C.new(String s) { this(); } private C.new(int i) { - Tester.note("new A.C"); + this(); Tester.note("new A.C"); } } @@ -75,6 +75,6 @@ aspect B { } private C.new(int i) { - Tester.note("new B.C"); + this(); Tester.note("new B.C"); } } diff --git a/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java index 4da93f0ca..3da3275e8 100644 --- a/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java +++ b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java @@ -8,7 +8,7 @@ public aspect AdviceOnIntroduced { } int Foo.foo(int n) { return n; } - Foo.new(int w) {} + Foo.new(int w) {this();} int around(int n): within(AdviceOnIntroduced) && diff --git a/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java index 4da93f0ca..4a3bba55d 100644 --- a/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java +++ b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java @@ -8,7 +8,7 @@ public aspect AdviceOnIntroduced { } int Foo.foo(int n) { return n; } - Foo.new(int w) {} + Foo.new(int w) { this(); } int around(int n): within(AdviceOnIntroduced) && diff --git a/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/AdviceOnIntroduced.java b/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/AdviceOnIntroduced.java index 4da93f0ca..3da3275e8 100644 --- a/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/AdviceOnIntroduced.java +++ b/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/AdviceOnIntroduced.java @@ -8,7 +8,7 @@ public aspect AdviceOnIntroduced { } int Foo.foo(int n) { return n; } - Foo.new(int w) {} + Foo.new(int w) {this();} int around(int n): within(AdviceOnIntroduced) && diff --git a/tests/java5/annotations/aspectMembers/a/AnnotatedAspect03.aj b/tests/java5/annotations/aspectMembers/a/AnnotatedAspect03.aj index 939285816..c3c6312a8 100644 --- a/tests/java5/annotations/aspectMembers/a/AnnotatedAspect03.aj +++ b/tests/java5/annotations/aspectMembers/a/AnnotatedAspect03.aj @@ -9,7 +9,7 @@ public aspect AnnotatedAspect03 { @MethodAnnotation private int ITDMe.getGoo() { return goo; } - @ConstructorAnnotation public ITDMe.new(int x) { goo = x; } + @ConstructorAnnotation public ITDMe.new(int x) { this(); goo = x; } } diff --git a/tests/java5/annotations/binding/BindingWithAnnotatedItds3.aj b/tests/java5/annotations/binding/BindingWithAnnotatedItds3.aj index 8bee421ec..caeec3ba7 100644 --- a/tests/java5/annotations/binding/BindingWithAnnotatedItds3.aj +++ b/tests/java5/annotations/binding/BindingWithAnnotatedItds3.aj @@ -5,11 +5,11 @@ import java.lang.annotation.*; public aspect BindingWithAnnotatedItds3 { - @Fruit("pear") A.new(String s) { } + @Fruit("pear") A.new(String s) { this(); } - private @Fruit("orange") A.new(int i) { } + private @Fruit("orange") A.new(int i) { this(); } - public @Fruit("tomato") A.new(boolean b) { } + public @Fruit("tomato") A.new(boolean b) { this(); } public static void main(String[]argv) { A instance1 = new A("a"); diff --git a/tests/java5/annotations/binding/BindingWithDeclaredAnnotationItds4.aj b/tests/java5/annotations/binding/BindingWithDeclaredAnnotationItds4.aj index 2ecc73c64..65b8d2802 100644 --- a/tests/java5/annotations/binding/BindingWithDeclaredAnnotationItds4.aj +++ b/tests/java5/annotations/binding/BindingWithDeclaredAnnotationItds4.aj @@ -5,11 +5,11 @@ import java.lang.annotation.*; public aspect BindingWithDeclaredAnnotationItds4 { - A.new(String s) { } + A.new(String s) { this(); } - private A.new(int i) { } + private A.new(int i) { this(); } - public A.new(boolean b) { } + public A.new(boolean b) { this(); } public static void main(String[]argv) { A instance1 = new A("a"); diff --git a/tests/java5/annotations/itds/AnnotationsAndITDs.aj b/tests/java5/annotations/itds/AnnotationsAndITDs.aj index 104681419..c26d8474a 100644 --- a/tests/java5/annotations/itds/AnnotationsAndITDs.aj +++ b/tests/java5/annotations/itds/AnnotationsAndITDs.aj @@ -14,10 +14,10 @@ public aspect AnnotationsAndITDs { // annotated ITD constructors @SomeAnnotation(s="hello",clazz=AnnotationsAndITDs.class) - public ITDMe.new(String s) {} + public ITDMe.new(String s) { this(); } @SomeAnnotation(s="goodbye",clazz=String.class) - private ITDMe.new(int x) {} + private ITDMe.new(int x) { this(); } // annotated ITD methods @@ -42,8 +42,8 @@ public aspect AnnotationsAndITDs { declare @constructor : ITDMe2.new(..) : @SomeAnnotation(s="@cons",clazz=String.class); - public ITDMe2.new(String s) {} - private ITDMe2.new(int x) {} + public ITDMe2.new(String s) { this(); } + private ITDMe2.new(int x) { this(); } // annotated ITD methods diff --git a/tests/java5/ataspectj/annotationGen/ITDTest.aj b/tests/java5/ataspectj/annotationGen/ITDTest.aj index bfa2e58bd..26cdc4c2f 100644 --- a/tests/java5/ataspectj/annotationGen/ITDTest.aj +++ b/tests/java5/ataspectj/annotationGen/ITDTest.aj @@ -12,11 +12,11 @@ public aspect ITDTest { int A.c(String s) { return 1; } - public A.new(String s) {} + public A.new(String s) { this(); } - private A.new(String s,String s2) {} + private A.new(String s,String s2) { this(); } - A.new(String s, Object o) {} + A.new(String s, Object o) { this(); } public int A.f ; diff --git a/tests/java5/generics/itds/GenericCtorITD1.aj b/tests/java5/generics/itds/GenericCtorITD1.aj index 9d0650568..ca02f6bec 100644 --- a/tests/java5/generics/itds/GenericCtorITD1.aj +++ b/tests/java5/generics/itds/GenericCtorITD1.aj @@ -14,5 +14,5 @@ public class GenericCtorITD1 { aspect X { - <T> Base.new(List<T> elements) { } + <T> Base.new(List<T> elements) { this(); } } diff --git a/tests/java5/generics/itds/GenericCtorITD2.aj b/tests/java5/generics/itds/GenericCtorITD2.aj index 9fc96e624..461bb80d7 100644 --- a/tests/java5/generics/itds/GenericCtorITD2.aj +++ b/tests/java5/generics/itds/GenericCtorITD2.aj @@ -18,5 +18,5 @@ public class GenericCtorITD2 { aspect X { // wildcards, argh! - <T> Base.new(List<T> one,List<? extends T> two) { } + <T> Base.new(List<T> one,List<? extends T> two) { this(); } } diff --git a/tests/java5/generics/itds/GenericCtorITD3.aj b/tests/java5/generics/itds/GenericCtorITD3.aj index 03b558726..4e3a5d8a0 100644 --- a/tests/java5/generics/itds/GenericCtorITD3.aj +++ b/tests/java5/generics/itds/GenericCtorITD3.aj @@ -38,6 +38,7 @@ public class GenericCtorITD3 { aspect X { <T> Sorter.new(List<T> elements,Comparator<? super T> comparator) { + this(); Collections.sort(elements,comparator); l = elements; } diff --git a/tests/java5/generics/itds/Parse3.java b/tests/java5/generics/itds/Parse3.java index a6b7d1a1d..e2f7c2fbd 100644 --- a/tests/java5/generics/itds/Parse3.java +++ b/tests/java5/generics/itds/Parse3.java @@ -2,5 +2,5 @@ public class Parse3 { } aspect X { - <T> Parse3.new(T cupOf) {} + <T> Parse3.new(T cupOf) {this();} } diff --git a/tests/java5/generics/itds/Parse6.java b/tests/java5/generics/itds/Parse6.java index 90e3b94f5..f64b32267 100644 --- a/tests/java5/generics/itds/Parse6.java +++ b/tests/java5/generics/itds/Parse6.java @@ -11,7 +11,7 @@ class Base<N> { aspect X { public Base<Z>.new(Z aNumber) { - ; + this() ; } public List<Z> Base<Z>.f2; diff --git a/tests/java5/generics/itds/sharing/CtorA.aj b/tests/java5/generics/itds/sharing/CtorA.aj index 3dc05b26e..d9c1498ec 100644 --- a/tests/java5/generics/itds/sharing/CtorA.aj +++ b/tests/java5/generics/itds/sharing/CtorA.aj @@ -8,10 +8,10 @@ public class CtorA { } class Base<N extends Number> { - //public Base(List<N> sn) {} + public Base() {} <Y extends Number> Base(Set<N> sn, List<Y> ys) {} } aspect X { - public Base<Z>.new(List<Z> lz) {}; // OK, Z becomes N in parameter + public Base<Z>.new(List<Z> lz) { this(); } // OK, Z becomes N in parameter } diff --git a/tests/java5/generics/itds/sharing/CtorC.aj b/tests/java5/generics/itds/sharing/CtorC.aj index 967c38192..04fe1c854 100644 --- a/tests/java5/generics/itds/sharing/CtorC.aj +++ b/tests/java5/generics/itds/sharing/CtorC.aj @@ -11,5 +11,5 @@ class Base<N extends Number> { } aspect X { - public Base<Z>.new(List<List<Z>> llz) {}; // ok - nested but OK + public Base<Z>.new(List<List<Z>> llz) { this(); }; // ok - nested but OK } diff --git a/tests/java5/generics/itds/sharing/CtorD.aj b/tests/java5/generics/itds/sharing/CtorD.aj index f8115ce92..8931c1f8f 100644 --- a/tests/java5/generics/itds/sharing/CtorD.aj +++ b/tests/java5/generics/itds/sharing/CtorD.aj @@ -10,5 +10,5 @@ class Base<N extends Number,S> { } aspect X { - public Base<A,B>.new(Map<A,B> mabs) {}; // ok multiple + public Base<A,B>.new(Map<A,B> mabs) { this(); }; // ok multiple } diff --git a/tests/java5/generics/itds/sharing/CtorE.aj b/tests/java5/generics/itds/sharing/CtorE.aj index 20aaf57d6..3d45790eb 100644 --- a/tests/java5/generics/itds/sharing/CtorE.aj +++ b/tests/java5/generics/itds/sharing/CtorE.aj @@ -12,5 +12,5 @@ class Base<N extends Number> { } aspect X { - public Base<Z>.new(List<String> ls) {}; // ok - specified type variable but didnt use it (could put a lint warning on this case?) + public Base<Z>.new(List<String> ls) { this(); }; // ok - specified type variable but didnt use it (could put a lint warning on this case?) } diff --git a/tests/java5/generics/itds/sharing/CtorF.aj b/tests/java5/generics/itds/sharing/CtorF.aj index bb4204b5b..c06083d2c 100644 --- a/tests/java5/generics/itds/sharing/CtorF.aj +++ b/tests/java5/generics/itds/sharing/CtorF.aj @@ -11,5 +11,5 @@ class Base<P,N extends Number,S> { } aspect X { - public Base<A,B,C>.new(Map<C,A> lc,Map<B,A> lb) {} // ok multiple in funny orders + public Base<A,B,C>.new(Map<C,A> lc,Map<B,A> lb) { this(); } // ok multiple in funny orders } diff --git a/tests/java5/generics/itds/sharing/CtorG.aj b/tests/java5/generics/itds/sharing/CtorG.aj index d798f9c7f..150dea67b 100644 --- a/tests/java5/generics/itds/sharing/CtorG.aj +++ b/tests/java5/generics/itds/sharing/CtorG.aj @@ -3,9 +3,9 @@ import java.util.*; public aspect CtorG { // visibility options... - public Base<Z>.new(List<Z> lz,int i) {} - private Base<Z>.new(List<Z> lz,String s) {} - Base<Z>.new(List<Z> lz,boolean b) {} + public Base<Z>.new(List<Z> lz,int i) { this();} + private Base<Z>.new(List<Z> lz,String s) { this();} + Base<Z>.new(List<Z> lz,boolean b) {this();} public static void main(String []argv) { List<Integer> intList = new ArrayList<Integer>(); diff --git a/tests/java5/generics/itds/sharing/CtorH.aj b/tests/java5/generics/itds/sharing/CtorH.aj index 8ce2d0ffe..c0f9d7873 100644 --- a/tests/java5/generics/itds/sharing/CtorH.aj +++ b/tests/java5/generics/itds/sharing/CtorH.aj @@ -15,5 +15,5 @@ public class CtorH { class Base<N> { } aspect X { - public Base<Z>.new(List<Z> lz) {} // OK, Z becomes N in first case, S in the second ;) + public Base<Z>.new(List<Z> lz) {this();} // OK, Z becomes N in first case, S in the second ;) } diff --git a/tests/java5/generics/itds/sharing/CtorI.aj b/tests/java5/generics/itds/sharing/CtorI.aj index bed64a85a..5fbbcd2e2 100644 --- a/tests/java5/generics/itds/sharing/CtorI.aj +++ b/tests/java5/generics/itds/sharing/CtorI.aj @@ -10,5 +10,5 @@ public class CtorI { class Base<N extends Number> { } aspect X { - public Base<Z>.new(List<Z> lz) {} + public Base<Z>.new(List<Z> lz) {this();} } diff --git a/tests/java5/generics/itds/visibility/PackageITDs.aj b/tests/java5/generics/itds/visibility/PackageITDs.aj index eaa7f3122..7c4ed0602 100644 --- a/tests/java5/generics/itds/visibility/PackageITDs.aj +++ b/tests/java5/generics/itds/visibility/PackageITDs.aj @@ -23,8 +23,8 @@ public aspect PackageITDs { <R extends Number> void Base.packageMethod2(List<R> lr1,List<R> lr2) {} // ctor - <P extends Number> Base.new(List<P> lr) {} - <P extends Number> Base.new(List<P> lr1,List<P> lr2) {} - <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) {} + <P extends Number> Base.new(List<P> lr) { this(); } + <P extends Number> Base.new(List<P> lr1,List<P> lr2) { this(); } + <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) { this(); } } diff --git a/tests/java5/generics/itds/visibility/PrivateITDs.aj b/tests/java5/generics/itds/visibility/PrivateITDs.aj index beaebb49d..758bc58d7 100644 --- a/tests/java5/generics/itds/visibility/PrivateITDs.aj +++ b/tests/java5/generics/itds/visibility/PrivateITDs.aj @@ -23,8 +23,8 @@ public aspect PrivateITDs { private <R extends Number> void Base.privateMethod2(List<R> lr1,List<R> lr2) {} // ctor - private <P extends Number> Base.new(List<P> lr) {} - private <P extends Number> Base.new(List<P> lr1,List<P> lr2) {} - private <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) {} + private <P extends Number> Base.new(List<P> lr) { this(); } + private <P extends Number> Base.new(List<P> lr1,List<P> lr2) { this(); } + private <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) { this(); } } diff --git a/tests/java5/generics/itds/visibility/PublicITDs.aj b/tests/java5/generics/itds/visibility/PublicITDs.aj index 25d58b4a3..e419a8a21 100644 --- a/tests/java5/generics/itds/visibility/PublicITDs.aj +++ b/tests/java5/generics/itds/visibility/PublicITDs.aj @@ -26,9 +26,9 @@ aspect X { public <R extends Number> void Base.publicMethod2(List<R> lr1,List<R> lr2) {} // ctor - public <P extends Number> Base.new(List<P> lr) {} - public <P extends Number> Base.new(List<P> lr1,List<P> lr2) {} - public <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) {} + public <P extends Number> Base.new(List<P> lr) { this(); } + public <P extends Number> Base.new(List<P> lr1,List<P> lr2) { this(); } + public <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) { this(); } // what use is this next one?? // public <R extends Number> R Base.publicMethod3() { return null;} diff --git a/tests/java5/generics/itds/visibility/PublicITDsErrors.aj b/tests/java5/generics/itds/visibility/PublicITDsErrors.aj index cc7bd81cf..89a173f6a 100644 --- a/tests/java5/generics/itds/visibility/PublicITDsErrors.aj +++ b/tests/java5/generics/itds/visibility/PublicITDsErrors.aj @@ -23,7 +23,7 @@ aspect X { public <R extends Number> void Base.publicMethod2(List<R> lr1,List<R> lr2) {} // ctor - public <P extends Number> Base.new(List<P> lr) {} - public <P extends Number> Base.new(List<P> lr1,List<P> lr2) {} - public <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) {} + public <P extends Number> Base.new(List<P> lr) { this(); } + public <P extends Number> Base.new(List<P> lr1,List<P> lr2) { this(); } + public <P,Q extends Number> Base.new(List<P> lp,Map<Q,P> m1) { this(); } } diff --git a/tests/new/AdviceOnIntroduced.java b/tests/new/AdviceOnIntroduced.java index 4da93f0ca..4a3bba55d 100644 --- a/tests/new/AdviceOnIntroduced.java +++ b/tests/new/AdviceOnIntroduced.java @@ -8,7 +8,7 @@ public aspect AdviceOnIntroduced { } int Foo.foo(int n) { return n; } - Foo.new(int w) {} + Foo.new(int w) { this(); } int around(int n): within(AdviceOnIntroduced) && diff --git a/tests/new/DeclareAspectConstructorCE.java b/tests/new/DeclareAspectConstructorCE.java index 864d5f097..65b28e049 100644 --- a/tests/new/DeclareAspectConstructorCE.java +++ b/tests/new/DeclareAspectConstructorCE.java @@ -7,5 +7,5 @@ aspect A { } aspect B { - A.new(int i) {} // CE 10 + A.new(int i) { this(); } // CE 10 } diff --git a/tests/new/DeclareOnlyAspectConstructorCE.java b/tests/new/DeclareOnlyAspectConstructorCE.java index 11bde660b..383981a06 100644 --- a/tests/new/DeclareOnlyAspectConstructorCE.java +++ b/tests/new/DeclareOnlyAspectConstructorCE.java @@ -7,5 +7,5 @@ aspect A { } aspect B { - A.new(int i) {} // CE 10 + A.new(int i) { this(); } // CE 10 } diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index fb7f77f39..af3de4121 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -655,6 +655,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("no verify error with two this pcds"); } + public void testITDCWithNoExplicitConsCall() { + runTest("ITDC with no explicit cons call"); + } + // 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 6e569be05..42b96499c 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -10,6 +10,12 @@ <ajc-test dir="bugs150" title="Problem with constructor ITDs"> <compile files="pr112783.aj" options="-1.5"/> </ajc-test> + + <ajc-test dir="bugs150" title="ITDC with no explicit cons call"> + <compile files="Pr62606.aj" options="-1.5"> + <message kind="warning" line="6" text="[Xlint:noExplicitConstructorCall]"/> + </compile> + </ajc-test> <ajc-test dir="java5/generics/bugs" title="using same type variable in ITD"> <compile files="SameTypeVariable.aj" options="-1.5"> @@ -84,7 +90,7 @@ <ajc-test dir="bugs150/pr113947/case2" title="maws generic aspect - 2"> <compile files="AbstractListSupport.java,AnotherItem.java,Item.java,LinkedList.java,LinkedListItem.java,ListItem.java,StringList.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs150/pr113861" title="field-get problems with generic field"> <compile files="Test.java,TestAspect.java" options="-1.5"/> <run class="com.Test"/> @@ -131,7 +137,7 @@ <message kind="warning" text="void C.<init>(int) - already has an annotation of type Annotation, cannot add a second instance [Xlint:elementAlreadyAnnotated]"/> </compile> </ajc-test> - + <ajc-test dir="bugs150/pr113630/case1" title="IncompatibleClassChangeError - errorscenario"> <compile files="Bean.java,BeanTestCase.java,javaBean.java,propertyChanger.java,PropertySupportAspect5.aj" options="-1.5"> <message kind="warning" line="9" text="Failing match because annotation 'javaBean' on type 'Bean' has SOURCE retention. Matching allowed when RetentionPolicy is CLASS or RUNTIME"/> diff --git a/tests/src/org/aspectj/systemtest/base/baseTests-tests.xml b/tests/src/org/aspectj/systemtest/base/baseTests-tests.xml index 264c03fab..014a7e64c 100644 --- a/tests/src/org/aspectj/systemtest/base/baseTests-tests.xml +++ b/tests/src/org/aspectj/systemtest/base/baseTests-tests.xml @@ -116,7 +116,10 @@ <ajc-test dir="base/test118" title="DEPRECATED: Introduce of constructors" keywords="from-base"> - <compile files="Driver.java"/> + <compile files="Driver.java"> + <message kind="warning" line="54" text="[Xlint:noExplicitConstructorCall]"/> + <message kind="warning" line="57" text="[Xlint:noExplicitConstructorCall]"/> + </compile> <run class="Driver"/> </ajc-test> |