diff options
Diffstat (limited to 'tests/bugs154')
46 files changed, 643 insertions, 0 deletions
diff --git a/tests/bugs154/pr165631/Bug.java b/tests/bugs154/pr165631/Bug.java new file mode 100644 index 000000000..e1ceb22ad --- /dev/null +++ b/tests/bugs154/pr165631/Bug.java @@ -0,0 +1,13 @@ +interface A<T> {} + +interface B<T> extends A<T> {} + +class C implements A<String> { +} + +class D extends C { +} + +aspect X { + declare parents: D implements B<Number>; +} diff --git a/tests/bugs154/pr165631/Bug2.java b/tests/bugs154/pr165631/Bug2.java new file mode 100644 index 000000000..0754042e9 --- /dev/null +++ b/tests/bugs154/pr165631/Bug2.java @@ -0,0 +1,15 @@ +interface A<T> {} + +interface B<T> extends A<T> {} + +class C implements A<String> {} + +interface A1 {} + +class D extends C implements A1 { +} + +aspect X { + declare parents: D implements B<Number>; +} + diff --git a/tests/bugs154/pr165885/Abstract.java b/tests/bugs154/pr165885/Abstract.java new file mode 100644 index 000000000..b2de830c4 --- /dev/null +++ b/tests/bugs154/pr165885/Abstract.java @@ -0,0 +1,7 @@ +package package1; + +public abstract class Abstract<T> { + + protected Object field; + +} diff --git a/tests/bugs154/pr165885/Aspect.java b/tests/bugs154/pr165885/Aspect.java new file mode 100644 index 000000000..127a8f271 --- /dev/null +++ b/tests/bugs154/pr165885/Aspect.java @@ -0,0 +1,6 @@ +public aspect Aspect { + + declare warning : set(* *) : "foo"; + + +} diff --git a/tests/bugs154/pr165885/Concrete.java b/tests/bugs154/pr165885/Concrete.java new file mode 100644 index 000000000..520d75a75 --- /dev/null +++ b/tests/bugs154/pr165885/Concrete.java @@ -0,0 +1,11 @@ +package bug.package2; + +import package1.Abstract; + +public class Concrete extends Abstract<Object> { + + public void method() { + field = null; + } + +} diff --git a/tests/bugs154/pr166084/Simple.java b/tests/bugs154/pr166084/Simple.java new file mode 100644 index 000000000..c5992b4ee --- /dev/null +++ b/tests/bugs154/pr166084/Simple.java @@ -0,0 +1,14 @@ +public class Simple { + public static void main(String []argv) { + new Simple().m(); + } + + public void m() { + int i = 1; + System.out.println(i); + } +} + +aspect X { + before(): call(* println(..)) {} +} diff --git a/tests/bugs154/pr166084/X.java b/tests/bugs154/pr166084/X.java new file mode 100644 index 000000000..e60c2c397 --- /dev/null +++ b/tests/bugs154/pr166084/X.java @@ -0,0 +1,3 @@ +aspect X { + before(): call(* println(..)) {} +} diff --git a/tests/bugs154/pr166084/simple.jar b/tests/bugs154/pr166084/simple.jar Binary files differnew file mode 100644 index 000000000..3151ded97 --- /dev/null +++ b/tests/bugs154/pr166084/simple.jar diff --git a/tests/bugs154/pr168044/AbstractNode.java b/tests/bugs154/pr168044/AbstractNode.java new file mode 100644 index 000000000..bb1401fb4 --- /dev/null +++ b/tests/bugs154/pr168044/AbstractNode.java @@ -0,0 +1,19 @@ +public abstract class AbstractNode < SelfNode extends AbstractNode<SelfNode, DualNode>, DualNode extends AbstractNode<DualNode, SelfNode> > { +} + +class SubClass extends AbstractNode<A,B> { +} + +class A extends AbstractNode<A,B> { } +class B extends AbstractNode<B,A> { } + +abstract class Mad +< + Id extends Comparable<Id>, + Np extends Mad<Id, Np, Nt, Np, Nt>, + Nt extends Mad<Id, Np, Nt, Nt, Np>, + SelfNode extends Mad<Id, Np, Nt, SelfNode, DualNode>, + DualNode extends Mad<Id, Np, Nt, DualNode, SelfNode> +> +{ +} diff --git a/tests/bugs154/pr168063/A.java b/tests/bugs154/pr168063/A.java new file mode 100644 index 000000000..c4831ff9d --- /dev/null +++ b/tests/bugs154/pr168063/A.java @@ -0,0 +1,40 @@ +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + + +public class A { + public static void main(String[] args) throws Exception { + A obj1 = new A(); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(obj1); + oos.close(); + byte[] data = baos.toByteArray(); + + ByteArrayInputStream bais = new ByteArrayInputStream(data); + ObjectInputStream ois = new ObjectInputStream(bais); + Object o = ois.readObject(); + + int before = ((Persistable)obj1).getPersistableId(); + int after = ((Persistable)o).getPersistableId(); + if (before!=after) + System.out.println("The data was lost! before="+before+" after="+after); + else + System.out.println("It worked, data preserved!"); + } +} + +interface Persistable extends Serializable { + abstract public int getPersistableId(); +} + +aspect PersistableImpl { + declare parents: A extends Persistable; + + final public int Persistable.persistableId = 42; + public int Persistable.getPersistableId() { return persistableId; } +} diff --git a/tests/bugs154/pr169706/A.java b/tests/bugs154/pr169706/A.java new file mode 100644 index 000000000..a40ef7bcf --- /dev/null +++ b/tests/bugs154/pr169706/A.java @@ -0,0 +1,8 @@ +public class A { + + @MyAnnotation + public void foo() { + + } + +} diff --git a/tests/bugs154/pr169706/B.java b/tests/bugs154/pr169706/B.java new file mode 100644 index 000000000..120fb1868 --- /dev/null +++ b/tests/bugs154/pr169706/B.java @@ -0,0 +1,3 @@ +public class B extends A { + +} diff --git a/tests/bugs154/pr169706/C.java b/tests/bugs154/pr169706/C.java new file mode 100644 index 000000000..8acb6675c --- /dev/null +++ b/tests/bugs154/pr169706/C.java @@ -0,0 +1,3 @@ +public class C extends B { + +} diff --git a/tests/bugs154/pr169706/MyAnnotation.java b/tests/bugs154/pr169706/MyAnnotation.java new file mode 100644 index 000000000..723084377 --- /dev/null +++ b/tests/bugs154/pr169706/MyAnnotation.java @@ -0,0 +1,3 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation {} diff --git a/tests/bugs154/pr169706/MyAspect.java b/tests/bugs154/pr169706/MyAspect.java new file mode 100644 index 000000000..e533064db --- /dev/null +++ b/tests/bugs154/pr169706/MyAspect.java @@ -0,0 +1,16 @@ +public aspect MyAspect { + + // this throws an exception + before(MyAnnotation myAnnotation) : + //call(* *..*.*(..)) && + call(@MyAnnotation * *(..)) && + @annotation(myAnnotation) { + + } + + // this, however, works fine +// before() : + // call(@MyAnnotation * *(..)) { + // + // } +} diff --git a/tests/bugs154/pr169706/Test.java b/tests/bugs154/pr169706/Test.java new file mode 100644 index 000000000..b8af6a677 --- /dev/null +++ b/tests/bugs154/pr169706/Test.java @@ -0,0 +1,8 @@ +public class Test { + + public static void main(String args[]) { + C c = new C(); + c.foo(); + } + +} diff --git a/tests/bugs154/pr170467/Bug.aj b/tests/bugs154/pr170467/Bug.aj new file mode 100644 index 000000000..4c68eda07 --- /dev/null +++ b/tests/bugs154/pr170467/Bug.aj @@ -0,0 +1,16 @@ +import java.util.*; + +// this should be OK, the parameterized forms of Set are the same + +abstract class BaseClass { } + +aspect BaseClassAspect { + public abstract void BaseClass.setSomething(Set<String> somethings); +} + +class ExtendedBaseClass extends BaseClass { + @Override + public void setSomething(Set<String> somethings) { } +} + + diff --git a/tests/bugs154/pr170467/Bug2.aj b/tests/bugs154/pr170467/Bug2.aj new file mode 100644 index 000000000..89b5121c4 --- /dev/null +++ b/tests/bugs154/pr170467/Bug2.aj @@ -0,0 +1,16 @@ +import java.util.*; + +// Trivial testcase to ensure the basics behave + +abstract class BaseClass { } + +aspect BaseClassAspect { + public abstract void BaseClass.setSomething(Set somethings); +} + +class ExtendedBaseClass extends BaseClass { + @Override + public void setSomething(Set somethings) { } +} + + diff --git a/tests/bugs154/pr171952/Foo.java b/tests/bugs154/pr171952/Foo.java new file mode 100644 index 000000000..d60b9a65c --- /dev/null +++ b/tests/bugs154/pr171952/Foo.java @@ -0,0 +1,6 @@ +import java.util.List; + +public interface Foo { + + <T> List<T> createList(); +}
\ No newline at end of file diff --git a/tests/bugs154/pr171952/FooAspect.java b/tests/bugs154/pr171952/FooAspect.java new file mode 100644 index 000000000..a376442fc --- /dev/null +++ b/tests/bugs154/pr171952/FooAspect.java @@ -0,0 +1,10 @@ +import java.util.ArrayList; +import java.util.List; + +public aspect FooAspect { + + + public <T> List<T> Foo.createList() { + return new ArrayList<T>(); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr171953/test/AbstractExecutable.java b/tests/bugs154/pr171953/test/AbstractExecutable.java new file mode 100644 index 000000000..6d9f880a6 --- /dev/null +++ b/tests/bugs154/pr171953/test/AbstractExecutable.java @@ -0,0 +1,5 @@ +package test; + +public abstract class AbstractExecutable implements AnotherExecutable { + +} diff --git a/tests/bugs154/pr171953/test/AnotherExecutable.java b/tests/bugs154/pr171953/test/AnotherExecutable.java new file mode 100644 index 000000000..75103a696 --- /dev/null +++ b/tests/bugs154/pr171953/test/AnotherExecutable.java @@ -0,0 +1,5 @@ +package test; + +public interface AnotherExecutable extends Executable { + +} diff --git a/tests/bugs154/pr171953/test/Executable.java b/tests/bugs154/pr171953/test/Executable.java new file mode 100644 index 000000000..13cb945b1 --- /dev/null +++ b/tests/bugs154/pr171953/test/Executable.java @@ -0,0 +1,6 @@ +package test; + +public interface Executable { + + void execute(); +} diff --git a/tests/bugs154/pr171953/test/ExecutionAspect.aj b/tests/bugs154/pr171953/test/ExecutionAspect.aj new file mode 100644 index 000000000..1dd0266d8 --- /dev/null +++ b/tests/bugs154/pr171953/test/ExecutionAspect.aj @@ -0,0 +1,12 @@ +package test; + +public aspect ExecutionAspect { + +declare parents: AbstractExecutable implements java.io.Serializable; + + pointcut executions(Executable executable): execution(public void Executable.execute()) && this(executable); + + void around(Executable executable): executions(executable) { + System.err.println(thisJoinPoint); + } +} diff --git a/tests/bugs154/pr171953/test/RunnableAspect.aj b/tests/bugs154/pr171953/test/RunnableAspect.aj new file mode 100644 index 000000000..fa12b7b99 --- /dev/null +++ b/tests/bugs154/pr171953/test/RunnableAspect.aj @@ -0,0 +1,11 @@ +package test; + +public aspect RunnableAspect { + +// public void Executable.run() { +// execute(); +// } +// +// //declare parents: (Executable+ && !Executable) implements Runnable; +// declare parents: AbstractExecutable implements java.io.Serializable; +} diff --git a/tests/bugs154/pr171953/test/SecondTestExecutable.java b/tests/bugs154/pr171953/test/SecondTestExecutable.java new file mode 100644 index 000000000..1743a9728 --- /dev/null +++ b/tests/bugs154/pr171953/test/SecondTestExecutable.java @@ -0,0 +1,13 @@ +package test; + +public class SecondTestExecutable extends AbstractExecutable { + + public void execute() { + // should not happen because of ExecutionAspect prevents execution + throw new RuntimeException(); + } + + public static void main(String[] args) { + new SecondTestExecutable().execute(); + } +} diff --git a/tests/bugs154/pr171953/test/SubTestExecutable.java b/tests/bugs154/pr171953/test/SubTestExecutable.java new file mode 100644 index 000000000..8dd83bd03 --- /dev/null +++ b/tests/bugs154/pr171953/test/SubTestExecutable.java @@ -0,0 +1,9 @@ +package test; + +public class SubTestExecutable extends TestExecutable { + + @Override + public void execute() { + super.execute(); + } +} diff --git a/tests/bugs154/pr171953/test/TestExecutable.java b/tests/bugs154/pr171953/test/TestExecutable.java new file mode 100644 index 000000000..bfd296a2d --- /dev/null +++ b/tests/bugs154/pr171953/test/TestExecutable.java @@ -0,0 +1,7 @@ +package test; + +public class TestExecutable implements Executable { + + public void execute() { + } +} diff --git a/tests/bugs154/pr171953_2/test/AbstractProcessor.java b/tests/bugs154/pr171953_2/test/AbstractProcessor.java new file mode 100644 index 000000000..008fba159 --- /dev/null +++ b/tests/bugs154/pr171953_2/test/AbstractProcessor.java @@ -0,0 +1,5 @@ +package test; + +public abstract class AbstractProcessor implements Processor { + +} diff --git a/tests/bugs154/pr171953_2/test/ListFactory.java b/tests/bugs154/pr171953_2/test/ListFactory.java new file mode 100644 index 000000000..473ccac20 --- /dev/null +++ b/tests/bugs154/pr171953_2/test/ListFactory.java @@ -0,0 +1,9 @@ +package test; + +import java.util.List; + +public interface ListFactory { + + <T> List<T> createList(); + <T> List<T> createList(int initialCapacity); +} diff --git a/tests/bugs154/pr171953_2/test/ListFactoryAspect.aj b/tests/bugs154/pr171953_2/test/ListFactoryAspect.aj new file mode 100644 index 000000000..acfc27e70 --- /dev/null +++ b/tests/bugs154/pr171953_2/test/ListFactoryAspect.aj @@ -0,0 +1,30 @@ +package test; + +import java.util.ArrayList; +import java.util.List; + +public aspect ListFactoryAspect { + + private ListFactory listFactory = new ListFactory() { + public <T> List<T> createList() { + return new ArrayList<T>(); + }; + public <T> List<T> createList(int initialCapacity) { + return new ArrayList<T>(); + }; + }; + + declare parents: Processor implements ListFactoryConsumer; + + public ListFactory ListFactoryConsumer.getListFactory() { + return ListFactoryAspect.aspectOf().listFactory; + } + + public <T> List<T> ListFactoryConsumer.createList() { + return getListFactory().<T>createList(); + } + + public <T> List<T> ListFactoryConsumer.createList(int initialCapacity) { + return getListFactory().<T>createList(initialCapacity); + } +} diff --git a/tests/bugs154/pr171953_2/test/ListFactoryConsumer.java b/tests/bugs154/pr171953_2/test/ListFactoryConsumer.java new file mode 100644 index 000000000..41747d902 --- /dev/null +++ b/tests/bugs154/pr171953_2/test/ListFactoryConsumer.java @@ -0,0 +1,6 @@ +package test; + +public interface ListFactoryConsumer { + + ListFactory getListFactory(); +} diff --git a/tests/bugs154/pr171953_2/test/Processor.java b/tests/bugs154/pr171953_2/test/Processor.java new file mode 100644 index 000000000..c76cdaaf9 --- /dev/null +++ b/tests/bugs154/pr171953_2/test/Processor.java @@ -0,0 +1,5 @@ +package test; + +public interface Processor { + +} diff --git a/tests/bugs154/pr171953_2/test/SimpleListFactoryConsumer.java b/tests/bugs154/pr171953_2/test/SimpleListFactoryConsumer.java new file mode 100644 index 000000000..ab1ec7cf7 --- /dev/null +++ b/tests/bugs154/pr171953_2/test/SimpleListFactoryConsumer.java @@ -0,0 +1,16 @@ +package test; + +import java.util.ArrayList; +import java.util.List; + +public class SimpleListFactoryConsumer extends AbstractProcessor { + + public void run() { + //List<List<String>> list1 = getListFactory().createList(); + List<List<String>> list2 = this.createList(); + } + + public static void main(String[] args) { + new SimpleListFactoryConsumer().run(); + } +} diff --git a/tests/bugs154/pr172107/Instrumentation.aj b/tests/bugs154/pr172107/Instrumentation.aj new file mode 100644 index 000000000..d937dcbb0 --- /dev/null +++ b/tests/bugs154/pr172107/Instrumentation.aj @@ -0,0 +1,40 @@ +import java.lang.reflect.Field; + +import org.aspectj.lang.reflect.*; + +public aspect Instrumentation { + + /** + * Instrument field reads. + */ + pointcut getField() : get(* *) && !within(Instrumentation); + + after() : getField() { + final FieldSignature signature = (FieldSignature) thisJoinPointStaticPart + .getSignature(); + final Field field = signature.getField(); + final SourceLocation sl = thisJoinPointStaticPart.getSourceLocation(); + if (field == null) { + throw new IllegalStateException( + "See pr172107: get FieldSignature#getField()==null in " + + sl.getFileName() + " at line " + sl.getLine()); + } + } + + /** + * Instrument field reads. + */ + pointcut setField() : set(* *) && !within(Instrumentation); + + after() : setField() { + final FieldSignature signature = (FieldSignature) thisJoinPointStaticPart + .getSignature(); + final Field field = signature.getField(); + final SourceLocation sl = thisJoinPointStaticPart.getSourceLocation(); + if (field == null) { + throw new IllegalStateException( + "See pr172107: set FieldSignature#getField()==null in " + + sl.getFileName() + " at line " + sl.getLine()); + } + } +} diff --git a/tests/bugs154/pr172107/ReadWriteAJBug172107.java b/tests/bugs154/pr172107/ReadWriteAJBug172107.java new file mode 100644 index 000000000..999ed5bd6 --- /dev/null +++ b/tests/bugs154/pr172107/ReadWriteAJBug172107.java @@ -0,0 +1,39 @@ +interface I { + static final int CONST = 56; +} + +class A { + protected int prot; + protected String protS; + int def; + String defS; +} + +class B extends A implements I { + void m() { + // protected + super.prot = 1; + super.protS = "1"; + System.out.println(super.protS + super.prot); + prot = 2; + protS = "2"; + System.out.println(protS + prot); + // default + super.def = 1; + super.defS = "1"; + System.out.println(defS + def); + def = 2; + defS = "2"; + System.out.println(defS + def); + // interface + System.out.println(CONST); + } +} + +public class ReadWriteAJBug172107 { + + public static void main(String[] args) { + B b = new B(); + b.m(); + } +} diff --git a/tests/bugs154/pr174449/Foo.java b/tests/bugs154/pr174449/Foo.java new file mode 100644 index 000000000..68a400d7d --- /dev/null +++ b/tests/bugs154/pr174449/Foo.java @@ -0,0 +1,33 @@ +abstract aspect Replicate<T> { + + protected pointcut broadcast(T servant); + + void around(T servant): broadcast(servant) { + System.err.println("around advice executing: servant class is "+servant.getClass()); + proceed(servant); + } + +} + +aspect ReplicateConcreteB extends Replicate<Boo> { + protected pointcut broadcast(Boo servant) : call(* *.setScene(..)) && target(servant); +} + +aspect ReplicateConcreteG extends Replicate<Goo> { + protected pointcut broadcast(Goo servant) : call(* *.setScene(..)) && target(servant); +} + +public class Foo { + public static void main(String []argv) { + new Boo().setScene(); + new Goo().setScene(); + } +} + +class Boo { + public void setScene() {} +} + +class Goo { + public void setScene() {} +} diff --git a/tests/bugs154/pr175806/A.java b/tests/bugs154/pr175806/A.java new file mode 100644 index 000000000..562276c39 --- /dev/null +++ b/tests/bugs154/pr175806/A.java @@ -0,0 +1,12 @@ +public class A { + + public static void main(String []argv) { + int i = 5; + try { + String s = "3"; + System.out.println(s); + } catch (Exception e) { + System.out.println(i); + } + } +} diff --git a/tests/bugs154/pr197719/test/aspects/C1.java b/tests/bugs154/pr197719/test/aspects/C1.java new file mode 100644 index 000000000..363c79a93 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/C1.java @@ -0,0 +1,14 @@ +package test.aspects;
+
+public class C1 {
+
+ @MyAnn
+ protected void aMethod() {
+ System.out.println("Calling aMethod");
+ }
+
+ public void callAMethod() {
+ aMethod(); // Should be a marker here...
+ }
+
+}
diff --git a/tests/bugs154/pr197719/test/aspects/C3.java b/tests/bugs154/pr197719/test/aspects/C3.java new file mode 100644 index 000000000..abcde9b58 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/C3.java @@ -0,0 +1,43 @@ +package test.aspects;
+
+import test.aspects2.C2;
+
+
+public class C3 {
+ /*
+ public void callAMethodC2() {
+ C1 c1 = new C1();
+ c1.aMethod(); // Should be a marker here...
+
+ C2 c2 = new C2();
+ c2.aMethod(); // Should be a marker here...
+ }
+
+ public void innerClassCall() {
+ InnerClass ic = new InnerClass();
+
+ ic.foo();
+ }
+ protected class InnerClass {
+ public void foo() {
+ C1 c1 = new C1();
+ c1.aMethod(); // Should be a marker here...
+
+ C2 c2 = new C2();
+ c2.aMethod(); // Should be a marker here...
+ }
+ }
+
+ public static void main(String [] args) {
+ C1 c1 = new C1();
+
+ c1.aMethod(); // Should be a marker here...
+ c1.callAMethod();
+
+ C3 c2 = new C3();
+
+ c2.callAMethodC2();
+ c2.innerClassCall();
+ }
+ */
+}
diff --git a/tests/bugs154/pr197719/test/aspects/MyAnn.java b/tests/bugs154/pr197719/test/aspects/MyAnn.java new file mode 100644 index 000000000..6610201b8 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/MyAnn.java @@ -0,0 +1,13 @@ +package test.aspects;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface MyAnn {
+}
diff --git a/tests/bugs154/pr197719/test/aspects/MyAnnAspect.java b/tests/bugs154/pr197719/test/aspects/MyAnnAspect.java new file mode 100644 index 000000000..e29619767 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/MyAnnAspect.java @@ -0,0 +1,24 @@ +package test.aspects;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public class MyAnnAspect {
+
+ @Pointcut("call(@MyAnn * *(..))")
+ void validatedMethod() {}
+
+
+ @Around("validatedMethod()")
+ public Object validateMethodImpl(ProceedingJoinPoint thisJoinPoint) throws Throwable {
+ return doInvoke(thisJoinPoint);
+ }
+
+ private Object doInvoke(final ProceedingJoinPoint thisJoinPoint) throws Throwable {
+ System.out.println("Invoking : " + thisJoinPoint);
+ return thisJoinPoint.proceed();
+ }
+}
diff --git a/tests/bugs154/pr197719/test/aspects2/C2.java b/tests/bugs154/pr197719/test/aspects2/C2.java new file mode 100644 index 000000000..799e7ac75 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects2/C2.java @@ -0,0 +1,34 @@ +package test.aspects2;
+
+import test.aspects.C1;
+
+
+public class C2 extends C1 {
+ public void callAMethodC2() {
+ aMethod(); // Should be a marker here...
+ }
+
+ public void innerClassCall() {
+ InnerClass ic = new InnerClass();
+
+ ic.foo();
+ }
+ protected class InnerClass {
+ public void foo() {
+ aMethod(); // Should be a marker here...
+ }
+ }
+
+ public static void main(String [] args) {
+ C1 c1 = new C1();
+
+ c1.callAMethod();
+
+ C2 c2 = new C2();
+
+ c2.aMethod(); // Should be a marker here...
+ c2.callAMethod();
+ c2.callAMethodC2();
+ c2.innerClassCall();
+ }
+}
diff --git a/tests/bugs154/pr205907/Test.aj b/tests/bugs154/pr205907/Test.aj new file mode 100644 index 000000000..c06be67b2 --- /dev/null +++ b/tests/bugs154/pr205907/Test.aj @@ -0,0 +1,6 @@ +aspect Test { + + pointcut p(): bean(foo*); + + before(): p() { } +}
\ No newline at end of file diff --git a/tests/bugs154/pr206732/Advised.aj b/tests/bugs154/pr206732/Advised.aj new file mode 100644 index 000000000..1e3abf13f --- /dev/null +++ b/tests/bugs154/pr206732/Advised.aj @@ -0,0 +1,12 @@ +package bugs; + + + +public class Advised {} + +aspect ITD { + + public void Advised.f() {} + +} + diff --git a/tests/bugs154/pr206732/Ref.aj b/tests/bugs154/pr206732/Ref.aj new file mode 100644 index 000000000..85f6f42e5 --- /dev/null +++ b/tests/bugs154/pr206732/Ref.aj @@ -0,0 +1,17 @@ +package notbugs; + + + +import bugs.Advised; + + + +public class Ref { + + public void g() { + + new Advised().f(); + + } + +}
\ No newline at end of file |