From 499b8bcb0e89b39a63008fc68b44df9ed39d0750 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 18 Oct 2007 11:02:00 +0000 Subject: these tests are now for 1.5.4, not 1.6.0 --- tests/bugs154/pr165631/Bug.java | 13 +++++++ tests/bugs154/pr165631/Bug2.java | 15 +++++++ tests/bugs154/pr165885/Abstract.java | 7 ++++ tests/bugs154/pr165885/Aspect.java | 6 +++ tests/bugs154/pr165885/Concrete.java | 11 ++++++ tests/bugs154/pr166084/Simple.java | 14 +++++++ tests/bugs154/pr166084/X.java | 3 ++ tests/bugs154/pr166084/simple.jar | Bin 0 -> 579 bytes tests/bugs154/pr168044/AbstractNode.java | 19 +++++++++ tests/bugs154/pr168063/A.java | 40 +++++++++++++++++++ tests/bugs154/pr169706/A.java | 8 ++++ tests/bugs154/pr169706/B.java | 3 ++ tests/bugs154/pr169706/C.java | 3 ++ tests/bugs154/pr169706/MyAnnotation.java | 3 ++ tests/bugs154/pr169706/MyAspect.java | 16 ++++++++ tests/bugs154/pr169706/Test.java | 8 ++++ tests/bugs154/pr170467/Bug.aj | 16 ++++++++ tests/bugs154/pr170467/Bug2.aj | 16 ++++++++ tests/bugs154/pr171952/Foo.java | 6 +++ tests/bugs154/pr171952/FooAspect.java | 10 +++++ .../bugs154/pr171953/test/AbstractExecutable.java | 5 +++ tests/bugs154/pr171953/test/AnotherExecutable.java | 5 +++ tests/bugs154/pr171953/test/Executable.java | 6 +++ tests/bugs154/pr171953/test/ExecutionAspect.aj | 12 ++++++ tests/bugs154/pr171953/test/RunnableAspect.aj | 11 ++++++ .../pr171953/test/SecondTestExecutable.java | 13 +++++++ tests/bugs154/pr171953/test/SubTestExecutable.java | 9 +++++ tests/bugs154/pr171953/test/TestExecutable.java | 7 ++++ .../bugs154/pr171953_2/test/AbstractProcessor.java | 5 +++ tests/bugs154/pr171953_2/test/ListFactory.java | 9 +++++ tests/bugs154/pr171953_2/test/ListFactoryAspect.aj | 30 ++++++++++++++ .../pr171953_2/test/ListFactoryConsumer.java | 6 +++ tests/bugs154/pr171953_2/test/Processor.java | 5 +++ .../pr171953_2/test/SimpleListFactoryConsumer.java | 16 ++++++++ tests/bugs154/pr172107/Instrumentation.aj | 40 +++++++++++++++++++ tests/bugs154/pr172107/ReadWriteAJBug172107.java | 39 +++++++++++++++++++ tests/bugs154/pr174449/Foo.java | 33 ++++++++++++++++ tests/bugs154/pr175806/A.java | 12 ++++++ tests/bugs154/pr197719/test/aspects/C1.java | 14 +++++++ tests/bugs154/pr197719/test/aspects/C3.java | 43 +++++++++++++++++++++ tests/bugs154/pr197719/test/aspects/MyAnn.java | 13 +++++++ .../bugs154/pr197719/test/aspects/MyAnnAspect.java | 24 ++++++++++++ tests/bugs154/pr197719/test/aspects2/C2.java | 34 ++++++++++++++++ tests/bugs154/pr205907/Test.aj | 6 +++ tests/bugs154/pr206732/Advised.aj | 12 ++++++ tests/bugs154/pr206732/Ref.aj | 17 ++++++++ tests/bugs160/pr165631/Bug.java | 13 ------- tests/bugs160/pr165631/Bug2.java | 15 ------- tests/bugs160/pr165885/Abstract.java | 7 ---- tests/bugs160/pr165885/Aspect.java | 6 --- tests/bugs160/pr165885/Concrete.java | 11 ------ tests/bugs160/pr166084/Simple.java | 14 ------- tests/bugs160/pr166084/X.java | 3 -- tests/bugs160/pr166084/simple.jar | Bin 579 -> 0 bytes tests/bugs160/pr168044/AbstractNode.java | 19 --------- tests/bugs160/pr168063/A.java | 40 ------------------- tests/bugs160/pr169706/A.java | 8 ---- tests/bugs160/pr169706/B.java | 3 -- tests/bugs160/pr169706/C.java | 3 -- tests/bugs160/pr169706/MyAnnotation.java | 3 -- tests/bugs160/pr169706/MyAspect.java | 16 -------- tests/bugs160/pr169706/Test.java | 8 ---- tests/bugs160/pr170467/Bug.aj | 16 -------- tests/bugs160/pr170467/Bug2.aj | 16 -------- tests/bugs160/pr171952/Foo.java | 6 --- tests/bugs160/pr171952/FooAspect.java | 10 ----- .../bugs160/pr171953/test/AbstractExecutable.java | 5 --- tests/bugs160/pr171953/test/AnotherExecutable.java | 5 --- tests/bugs160/pr171953/test/Executable.java | 6 --- tests/bugs160/pr171953/test/ExecutionAspect.aj | 12 ------ tests/bugs160/pr171953/test/RunnableAspect.aj | 11 ------ .../pr171953/test/SecondTestExecutable.java | 13 ------- tests/bugs160/pr171953/test/SubTestExecutable.java | 9 ----- tests/bugs160/pr171953/test/TestExecutable.java | 7 ---- .../bugs160/pr171953_2/test/AbstractProcessor.java | 5 --- tests/bugs160/pr171953_2/test/ListFactory.java | 9 ----- tests/bugs160/pr171953_2/test/ListFactoryAspect.aj | 30 -------------- .../pr171953_2/test/ListFactoryConsumer.java | 6 --- tests/bugs160/pr171953_2/test/Processor.java | 5 --- .../pr171953_2/test/SimpleListFactoryConsumer.java | 16 -------- tests/bugs160/pr172107/Instrumentation.aj | 40 ------------------- tests/bugs160/pr172107/ReadWriteAJBug172107.java | 39 ------------------- tests/bugs160/pr174449/Foo.java | 33 ---------------- tests/bugs160/pr175806/A.java | 12 ------ 84 files changed, 643 insertions(+), 480 deletions(-) create mode 100644 tests/bugs154/pr165631/Bug.java create mode 100644 tests/bugs154/pr165631/Bug2.java create mode 100644 tests/bugs154/pr165885/Abstract.java create mode 100644 tests/bugs154/pr165885/Aspect.java create mode 100644 tests/bugs154/pr165885/Concrete.java create mode 100644 tests/bugs154/pr166084/Simple.java create mode 100644 tests/bugs154/pr166084/X.java create mode 100644 tests/bugs154/pr166084/simple.jar create mode 100644 tests/bugs154/pr168044/AbstractNode.java create mode 100644 tests/bugs154/pr168063/A.java create mode 100644 tests/bugs154/pr169706/A.java create mode 100644 tests/bugs154/pr169706/B.java create mode 100644 tests/bugs154/pr169706/C.java create mode 100644 tests/bugs154/pr169706/MyAnnotation.java create mode 100644 tests/bugs154/pr169706/MyAspect.java create mode 100644 tests/bugs154/pr169706/Test.java create mode 100644 tests/bugs154/pr170467/Bug.aj create mode 100644 tests/bugs154/pr170467/Bug2.aj create mode 100644 tests/bugs154/pr171952/Foo.java create mode 100644 tests/bugs154/pr171952/FooAspect.java create mode 100644 tests/bugs154/pr171953/test/AbstractExecutable.java create mode 100644 tests/bugs154/pr171953/test/AnotherExecutable.java create mode 100644 tests/bugs154/pr171953/test/Executable.java create mode 100644 tests/bugs154/pr171953/test/ExecutionAspect.aj create mode 100644 tests/bugs154/pr171953/test/RunnableAspect.aj create mode 100644 tests/bugs154/pr171953/test/SecondTestExecutable.java create mode 100644 tests/bugs154/pr171953/test/SubTestExecutable.java create mode 100644 tests/bugs154/pr171953/test/TestExecutable.java create mode 100644 tests/bugs154/pr171953_2/test/AbstractProcessor.java create mode 100644 tests/bugs154/pr171953_2/test/ListFactory.java create mode 100644 tests/bugs154/pr171953_2/test/ListFactoryAspect.aj create mode 100644 tests/bugs154/pr171953_2/test/ListFactoryConsumer.java create mode 100644 tests/bugs154/pr171953_2/test/Processor.java create mode 100644 tests/bugs154/pr171953_2/test/SimpleListFactoryConsumer.java create mode 100644 tests/bugs154/pr172107/Instrumentation.aj create mode 100644 tests/bugs154/pr172107/ReadWriteAJBug172107.java create mode 100644 tests/bugs154/pr174449/Foo.java create mode 100644 tests/bugs154/pr175806/A.java create mode 100644 tests/bugs154/pr197719/test/aspects/C1.java create mode 100644 tests/bugs154/pr197719/test/aspects/C3.java create mode 100644 tests/bugs154/pr197719/test/aspects/MyAnn.java create mode 100644 tests/bugs154/pr197719/test/aspects/MyAnnAspect.java create mode 100644 tests/bugs154/pr197719/test/aspects2/C2.java create mode 100644 tests/bugs154/pr205907/Test.aj create mode 100644 tests/bugs154/pr206732/Advised.aj create mode 100644 tests/bugs154/pr206732/Ref.aj delete mode 100644 tests/bugs160/pr165631/Bug.java delete mode 100644 tests/bugs160/pr165631/Bug2.java delete mode 100644 tests/bugs160/pr165885/Abstract.java delete mode 100644 tests/bugs160/pr165885/Aspect.java delete mode 100644 tests/bugs160/pr165885/Concrete.java delete mode 100644 tests/bugs160/pr166084/Simple.java delete mode 100644 tests/bugs160/pr166084/X.java delete mode 100644 tests/bugs160/pr166084/simple.jar delete mode 100644 tests/bugs160/pr168044/AbstractNode.java delete mode 100644 tests/bugs160/pr168063/A.java delete mode 100644 tests/bugs160/pr169706/A.java delete mode 100644 tests/bugs160/pr169706/B.java delete mode 100644 tests/bugs160/pr169706/C.java delete mode 100644 tests/bugs160/pr169706/MyAnnotation.java delete mode 100644 tests/bugs160/pr169706/MyAspect.java delete mode 100644 tests/bugs160/pr169706/Test.java delete mode 100644 tests/bugs160/pr170467/Bug.aj delete mode 100644 tests/bugs160/pr170467/Bug2.aj delete mode 100644 tests/bugs160/pr171952/Foo.java delete mode 100644 tests/bugs160/pr171952/FooAspect.java delete mode 100644 tests/bugs160/pr171953/test/AbstractExecutable.java delete mode 100644 tests/bugs160/pr171953/test/AnotherExecutable.java delete mode 100644 tests/bugs160/pr171953/test/Executable.java delete mode 100644 tests/bugs160/pr171953/test/ExecutionAspect.aj delete mode 100644 tests/bugs160/pr171953/test/RunnableAspect.aj delete mode 100644 tests/bugs160/pr171953/test/SecondTestExecutable.java delete mode 100644 tests/bugs160/pr171953/test/SubTestExecutable.java delete mode 100644 tests/bugs160/pr171953/test/TestExecutable.java delete mode 100644 tests/bugs160/pr171953_2/test/AbstractProcessor.java delete mode 100644 tests/bugs160/pr171953_2/test/ListFactory.java delete mode 100644 tests/bugs160/pr171953_2/test/ListFactoryAspect.aj delete mode 100644 tests/bugs160/pr171953_2/test/ListFactoryConsumer.java delete mode 100644 tests/bugs160/pr171953_2/test/Processor.java delete mode 100644 tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java delete mode 100644 tests/bugs160/pr172107/Instrumentation.aj delete mode 100644 tests/bugs160/pr172107/ReadWriteAJBug172107.java delete mode 100644 tests/bugs160/pr174449/Foo.java delete mode 100644 tests/bugs160/pr175806/A.java (limited to 'tests') 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 {} + +interface B extends A {} + +class C implements A { +} + +class D extends C { +} + +aspect X { + declare parents: D implements B; +} 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 {} + +interface B extends A {} + +class C implements A {} + +interface A1 {} + +class D extends C implements A1 { +} + +aspect X { + declare parents: D implements B; +} + 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 { + + 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 { + + 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 new file mode 100644 index 000000000..3151ded97 Binary files /dev/null and b/tests/bugs154/pr166084/simple.jar differ 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, DualNode extends AbstractNode > { +} + +class SubClass extends AbstractNode { +} + +class A extends AbstractNode { } +class B extends AbstractNode { } + +abstract class Mad +< + Id extends Comparable, + Np extends Mad, + Nt extends Mad, + SelfNode extends Mad, + DualNode extends Mad +> +{ +} 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 somethings); +} + +class ExtendedBaseClass extends BaseClass { + @Override + public void setSomething(Set 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 { + + List 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 List Foo.createList() { + return new ArrayList(); + } +} \ 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 { + + List createList(); + List 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 List createList() { + return new ArrayList(); + }; + public List createList(int initialCapacity) { + return new ArrayList(); + }; + }; + + declare parents: Processor implements ListFactoryConsumer; + + public ListFactory ListFactoryConsumer.getListFactory() { + return ListFactoryAspect.aspectOf().listFactory; + } + + public List ListFactoryConsumer.createList() { + return getListFactory().createList(); + } + + public List ListFactoryConsumer.createList(int initialCapacity) { + return getListFactory().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> list1 = getListFactory().createList(); + List> 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 { + + 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 { + protected pointcut broadcast(Boo servant) : call(* *.setScene(..)) && target(servant); +} + +aspect ReplicateConcreteG extends Replicate { + 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 diff --git a/tests/bugs160/pr165631/Bug.java b/tests/bugs160/pr165631/Bug.java deleted file mode 100644 index e1ceb22ad..000000000 --- a/tests/bugs160/pr165631/Bug.java +++ /dev/null @@ -1,13 +0,0 @@ -interface A {} - -interface B extends A {} - -class C implements A { -} - -class D extends C { -} - -aspect X { - declare parents: D implements B; -} diff --git a/tests/bugs160/pr165631/Bug2.java b/tests/bugs160/pr165631/Bug2.java deleted file mode 100644 index 0754042e9..000000000 --- a/tests/bugs160/pr165631/Bug2.java +++ /dev/null @@ -1,15 +0,0 @@ -interface A {} - -interface B extends A {} - -class C implements A {} - -interface A1 {} - -class D extends C implements A1 { -} - -aspect X { - declare parents: D implements B; -} - diff --git a/tests/bugs160/pr165885/Abstract.java b/tests/bugs160/pr165885/Abstract.java deleted file mode 100644 index b2de830c4..000000000 --- a/tests/bugs160/pr165885/Abstract.java +++ /dev/null @@ -1,7 +0,0 @@ -package package1; - -public abstract class Abstract { - - protected Object field; - -} diff --git a/tests/bugs160/pr165885/Aspect.java b/tests/bugs160/pr165885/Aspect.java deleted file mode 100644 index 127a8f271..000000000 --- a/tests/bugs160/pr165885/Aspect.java +++ /dev/null @@ -1,6 +0,0 @@ -public aspect Aspect { - - declare warning : set(* *) : "foo"; - - -} diff --git a/tests/bugs160/pr165885/Concrete.java b/tests/bugs160/pr165885/Concrete.java deleted file mode 100644 index 520d75a75..000000000 --- a/tests/bugs160/pr165885/Concrete.java +++ /dev/null @@ -1,11 +0,0 @@ -package bug.package2; - -import package1.Abstract; - -public class Concrete extends Abstract { - - public void method() { - field = null; - } - -} diff --git a/tests/bugs160/pr166084/Simple.java b/tests/bugs160/pr166084/Simple.java deleted file mode 100644 index c5992b4ee..000000000 --- a/tests/bugs160/pr166084/Simple.java +++ /dev/null @@ -1,14 +0,0 @@ -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/bugs160/pr166084/X.java b/tests/bugs160/pr166084/X.java deleted file mode 100644 index e60c2c397..000000000 --- a/tests/bugs160/pr166084/X.java +++ /dev/null @@ -1,3 +0,0 @@ -aspect X { - before(): call(* println(..)) {} -} diff --git a/tests/bugs160/pr166084/simple.jar b/tests/bugs160/pr166084/simple.jar deleted file mode 100644 index 3151ded97..000000000 Binary files a/tests/bugs160/pr166084/simple.jar and /dev/null differ diff --git a/tests/bugs160/pr168044/AbstractNode.java b/tests/bugs160/pr168044/AbstractNode.java deleted file mode 100644 index bb1401fb4..000000000 --- a/tests/bugs160/pr168044/AbstractNode.java +++ /dev/null @@ -1,19 +0,0 @@ -public abstract class AbstractNode < SelfNode extends AbstractNode, DualNode extends AbstractNode > { -} - -class SubClass extends AbstractNode { -} - -class A extends AbstractNode { } -class B extends AbstractNode { } - -abstract class Mad -< - Id extends Comparable, - Np extends Mad, - Nt extends Mad, - SelfNode extends Mad, - DualNode extends Mad -> -{ -} diff --git a/tests/bugs160/pr168063/A.java b/tests/bugs160/pr168063/A.java deleted file mode 100644 index c4831ff9d..000000000 --- a/tests/bugs160/pr168063/A.java +++ /dev/null @@ -1,40 +0,0 @@ -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/bugs160/pr169706/A.java b/tests/bugs160/pr169706/A.java deleted file mode 100644 index a40ef7bcf..000000000 --- a/tests/bugs160/pr169706/A.java +++ /dev/null @@ -1,8 +0,0 @@ -public class A { - - @MyAnnotation - public void foo() { - - } - -} diff --git a/tests/bugs160/pr169706/B.java b/tests/bugs160/pr169706/B.java deleted file mode 100644 index 120fb1868..000000000 --- a/tests/bugs160/pr169706/B.java +++ /dev/null @@ -1,3 +0,0 @@ -public class B extends A { - -} diff --git a/tests/bugs160/pr169706/C.java b/tests/bugs160/pr169706/C.java deleted file mode 100644 index 8acb6675c..000000000 --- a/tests/bugs160/pr169706/C.java +++ /dev/null @@ -1,3 +0,0 @@ -public class C extends B { - -} diff --git a/tests/bugs160/pr169706/MyAnnotation.java b/tests/bugs160/pr169706/MyAnnotation.java deleted file mode 100644 index 723084377..000000000 --- a/tests/bugs160/pr169706/MyAnnotation.java +++ /dev/null @@ -1,3 +0,0 @@ -import java.lang.annotation.*; - -@Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation {} diff --git a/tests/bugs160/pr169706/MyAspect.java b/tests/bugs160/pr169706/MyAspect.java deleted file mode 100644 index e533064db..000000000 --- a/tests/bugs160/pr169706/MyAspect.java +++ /dev/null @@ -1,16 +0,0 @@ -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/bugs160/pr169706/Test.java b/tests/bugs160/pr169706/Test.java deleted file mode 100644 index b8af6a677..000000000 --- a/tests/bugs160/pr169706/Test.java +++ /dev/null @@ -1,8 +0,0 @@ -public class Test { - - public static void main(String args[]) { - C c = new C(); - c.foo(); - } - -} diff --git a/tests/bugs160/pr170467/Bug.aj b/tests/bugs160/pr170467/Bug.aj deleted file mode 100644 index 4c68eda07..000000000 --- a/tests/bugs160/pr170467/Bug.aj +++ /dev/null @@ -1,16 +0,0 @@ -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 somethings); -} - -class ExtendedBaseClass extends BaseClass { - @Override - public void setSomething(Set somethings) { } -} - - diff --git a/tests/bugs160/pr170467/Bug2.aj b/tests/bugs160/pr170467/Bug2.aj deleted file mode 100644 index 89b5121c4..000000000 --- a/tests/bugs160/pr170467/Bug2.aj +++ /dev/null @@ -1,16 +0,0 @@ -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/bugs160/pr171952/Foo.java b/tests/bugs160/pr171952/Foo.java deleted file mode 100644 index d60b9a65c..000000000 --- a/tests/bugs160/pr171952/Foo.java +++ /dev/null @@ -1,6 +0,0 @@ -import java.util.List; - -public interface Foo { - - List createList(); -} \ No newline at end of file diff --git a/tests/bugs160/pr171952/FooAspect.java b/tests/bugs160/pr171952/FooAspect.java deleted file mode 100644 index a376442fc..000000000 --- a/tests/bugs160/pr171952/FooAspect.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.ArrayList; -import java.util.List; - -public aspect FooAspect { - - - public List Foo.createList() { - return new ArrayList(); - } -} \ No newline at end of file diff --git a/tests/bugs160/pr171953/test/AbstractExecutable.java b/tests/bugs160/pr171953/test/AbstractExecutable.java deleted file mode 100644 index 6d9f880a6..000000000 --- a/tests/bugs160/pr171953/test/AbstractExecutable.java +++ /dev/null @@ -1,5 +0,0 @@ -package test; - -public abstract class AbstractExecutable implements AnotherExecutable { - -} diff --git a/tests/bugs160/pr171953/test/AnotherExecutable.java b/tests/bugs160/pr171953/test/AnotherExecutable.java deleted file mode 100644 index 75103a696..000000000 --- a/tests/bugs160/pr171953/test/AnotherExecutable.java +++ /dev/null @@ -1,5 +0,0 @@ -package test; - -public interface AnotherExecutable extends Executable { - -} diff --git a/tests/bugs160/pr171953/test/Executable.java b/tests/bugs160/pr171953/test/Executable.java deleted file mode 100644 index 13cb945b1..000000000 --- a/tests/bugs160/pr171953/test/Executable.java +++ /dev/null @@ -1,6 +0,0 @@ -package test; - -public interface Executable { - - void execute(); -} diff --git a/tests/bugs160/pr171953/test/ExecutionAspect.aj b/tests/bugs160/pr171953/test/ExecutionAspect.aj deleted file mode 100644 index 1dd0266d8..000000000 --- a/tests/bugs160/pr171953/test/ExecutionAspect.aj +++ /dev/null @@ -1,12 +0,0 @@ -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/bugs160/pr171953/test/RunnableAspect.aj b/tests/bugs160/pr171953/test/RunnableAspect.aj deleted file mode 100644 index fa12b7b99..000000000 --- a/tests/bugs160/pr171953/test/RunnableAspect.aj +++ /dev/null @@ -1,11 +0,0 @@ -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/bugs160/pr171953/test/SecondTestExecutable.java b/tests/bugs160/pr171953/test/SecondTestExecutable.java deleted file mode 100644 index 1743a9728..000000000 --- a/tests/bugs160/pr171953/test/SecondTestExecutable.java +++ /dev/null @@ -1,13 +0,0 @@ -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/bugs160/pr171953/test/SubTestExecutable.java b/tests/bugs160/pr171953/test/SubTestExecutable.java deleted file mode 100644 index 8dd83bd03..000000000 --- a/tests/bugs160/pr171953/test/SubTestExecutable.java +++ /dev/null @@ -1,9 +0,0 @@ -package test; - -public class SubTestExecutable extends TestExecutable { - - @Override - public void execute() { - super.execute(); - } -} diff --git a/tests/bugs160/pr171953/test/TestExecutable.java b/tests/bugs160/pr171953/test/TestExecutable.java deleted file mode 100644 index bfd296a2d..000000000 --- a/tests/bugs160/pr171953/test/TestExecutable.java +++ /dev/null @@ -1,7 +0,0 @@ -package test; - -public class TestExecutable implements Executable { - - public void execute() { - } -} diff --git a/tests/bugs160/pr171953_2/test/AbstractProcessor.java b/tests/bugs160/pr171953_2/test/AbstractProcessor.java deleted file mode 100644 index 008fba159..000000000 --- a/tests/bugs160/pr171953_2/test/AbstractProcessor.java +++ /dev/null @@ -1,5 +0,0 @@ -package test; - -public abstract class AbstractProcessor implements Processor { - -} diff --git a/tests/bugs160/pr171953_2/test/ListFactory.java b/tests/bugs160/pr171953_2/test/ListFactory.java deleted file mode 100644 index 473ccac20..000000000 --- a/tests/bugs160/pr171953_2/test/ListFactory.java +++ /dev/null @@ -1,9 +0,0 @@ -package test; - -import java.util.List; - -public interface ListFactory { - - List createList(); - List createList(int initialCapacity); -} diff --git a/tests/bugs160/pr171953_2/test/ListFactoryAspect.aj b/tests/bugs160/pr171953_2/test/ListFactoryAspect.aj deleted file mode 100644 index acfc27e70..000000000 --- a/tests/bugs160/pr171953_2/test/ListFactoryAspect.aj +++ /dev/null @@ -1,30 +0,0 @@ -package test; - -import java.util.ArrayList; -import java.util.List; - -public aspect ListFactoryAspect { - - private ListFactory listFactory = new ListFactory() { - public List createList() { - return new ArrayList(); - }; - public List createList(int initialCapacity) { - return new ArrayList(); - }; - }; - - declare parents: Processor implements ListFactoryConsumer; - - public ListFactory ListFactoryConsumer.getListFactory() { - return ListFactoryAspect.aspectOf().listFactory; - } - - public List ListFactoryConsumer.createList() { - return getListFactory().createList(); - } - - public List ListFactoryConsumer.createList(int initialCapacity) { - return getListFactory().createList(initialCapacity); - } -} diff --git a/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java b/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java deleted file mode 100644 index 41747d902..000000000 --- a/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java +++ /dev/null @@ -1,6 +0,0 @@ -package test; - -public interface ListFactoryConsumer { - - ListFactory getListFactory(); -} diff --git a/tests/bugs160/pr171953_2/test/Processor.java b/tests/bugs160/pr171953_2/test/Processor.java deleted file mode 100644 index c76cdaaf9..000000000 --- a/tests/bugs160/pr171953_2/test/Processor.java +++ /dev/null @@ -1,5 +0,0 @@ -package test; - -public interface Processor { - -} diff --git a/tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java b/tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java deleted file mode 100644 index ab1ec7cf7..000000000 --- a/tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java +++ /dev/null @@ -1,16 +0,0 @@ -package test; - -import java.util.ArrayList; -import java.util.List; - -public class SimpleListFactoryConsumer extends AbstractProcessor { - - public void run() { - //List> list1 = getListFactory().createList(); - List> list2 = this.createList(); - } - - public static void main(String[] args) { - new SimpleListFactoryConsumer().run(); - } -} diff --git a/tests/bugs160/pr172107/Instrumentation.aj b/tests/bugs160/pr172107/Instrumentation.aj deleted file mode 100644 index d937dcbb0..000000000 --- a/tests/bugs160/pr172107/Instrumentation.aj +++ /dev/null @@ -1,40 +0,0 @@ -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/bugs160/pr172107/ReadWriteAJBug172107.java b/tests/bugs160/pr172107/ReadWriteAJBug172107.java deleted file mode 100644 index 999ed5bd6..000000000 --- a/tests/bugs160/pr172107/ReadWriteAJBug172107.java +++ /dev/null @@ -1,39 +0,0 @@ -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/bugs160/pr174449/Foo.java b/tests/bugs160/pr174449/Foo.java deleted file mode 100644 index 68a400d7d..000000000 --- a/tests/bugs160/pr174449/Foo.java +++ /dev/null @@ -1,33 +0,0 @@ -abstract aspect Replicate { - - 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 { - protected pointcut broadcast(Boo servant) : call(* *.setScene(..)) && target(servant); -} - -aspect ReplicateConcreteG extends Replicate { - 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/bugs160/pr175806/A.java b/tests/bugs160/pr175806/A.java deleted file mode 100644 index 562276c39..000000000 --- a/tests/bugs160/pr175806/A.java +++ /dev/null @@ -1,12 +0,0 @@ -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); - } - } -} -- cgit v1.2.3