diff options
author | aclement <aclement> | 2011-09-14 00:04:38 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-09-14 00:04:38 +0000 |
commit | e72228e3682ad8cb6503d2c0b1c06ac059ae7e1a (patch) | |
tree | 4aea13f1eff3f3d1a43655349db3c9d5f7677422 /tests/bugs1612 | |
parent | 950868d6c436e2ba44dab96be5b32aa9ead7fc1c (diff) | |
download | aspectj-e72228e3682ad8cb6503d2c0b1c06ac059ae7e1a.tar.gz aspectj-e72228e3682ad8cb6503d2c0b1c06ac059ae7e1a.zip |
354470
Diffstat (limited to 'tests/bugs1612')
-rw-r--r-- | tests/bugs1612/pr354470/Code.java | 48 | ||||
-rw-r--r-- | tests/bugs1612/pr354470/Code2.java | 39 | ||||
-rw-r--r-- | tests/bugs1612/pr354470/Code3.java | 41 |
3 files changed, 128 insertions, 0 deletions
diff --git a/tests/bugs1612/pr354470/Code.java b/tests/bugs1612/pr354470/Code.java new file mode 100644 index 000000000..044966200 --- /dev/null +++ b/tests/bugs1612/pr354470/Code.java @@ -0,0 +1,48 @@ +import org.aspectj.lang.annotation.*; +import java.lang.annotation.*; +import java.lang.reflect.*; + +@Aspect("perthis(transactional())") +public class Code { + @Pointcut("execution(@Transactional * * (..))") + public void transactional() { } + + public static void main(String[] args) { + print(AAA.class); + print(BBB.class); + print(CCC.class); + } + + public static void print(Class clazz) { + System.out.println(clazz.getName()); + Class[] ifs = clazz.getInterfaces(); + if (ifs!=null) { + for (int i=0;i<ifs.length;i++) { + System.out.println(ifs[i]); + } + } + Field[] fs = clazz.getDeclaredFields(); + if (fs!=null) { + for (int i=0;i<fs.length;i++) { + System.out.println(fs[i]); + } + } + } +} + +class AAA { + public void m() { } +} + +class BBB { + public void m() { } +} + +class CCC { + @Transactional + public void m() { } +} + + +@Retention(RetentionPolicy.RUNTIME) @interface Transactional {} + diff --git a/tests/bugs1612/pr354470/Code2.java b/tests/bugs1612/pr354470/Code2.java new file mode 100644 index 000000000..1cc1ea49b --- /dev/null +++ b/tests/bugs1612/pr354470/Code2.java @@ -0,0 +1,39 @@ +import org.aspectj.lang.annotation.*; +import java.lang.annotation.*; +import java.lang.reflect.*; +import org.aspectj.lang.*; + +@Aspect("perthis(transactional())") +public class Code2 { + @Pointcut("execution(@Transactional * * (..))") + public void transactional() { } + + @Before("execution(* *(..))") + public void m(JoinPoint.StaticPart thisJoinPointStaticPart) { + System.out.println(thisJoinPointStaticPart); + } + + public static void main(String[] args) { + new AAA().m(); + new BBB().m(); + new CCC().m(); + } + +} + +class AAA { + public void m() { } +} + +class BBB { + public void m() { } +} + +class CCC { + @Transactional + public void m() { } +} + + +@Retention(RetentionPolicy.RUNTIME) @interface Transactional {} + diff --git a/tests/bugs1612/pr354470/Code3.java b/tests/bugs1612/pr354470/Code3.java new file mode 100644 index 000000000..7199b68e1 --- /dev/null +++ b/tests/bugs1612/pr354470/Code3.java @@ -0,0 +1,41 @@ +import org.aspectj.lang.annotation.*; +import java.lang.annotation.*; +import java.lang.reflect.*; +import org.aspectj.lang.*; + +@Aspect("perthis(transactional())") +public class Code3 { + @Pointcut("execution(@Transactional * * (..))") + public void transactional() { } + + @Before("execution(* *(..))") + public void m(JoinPoint.StaticPart thisJoinPointStaticPart) { + System.out.println(thisJoinPointStaticPart); + } + + public static void main(String[] args) { + new AAA().m(); + new BBB().m(); + new CCC().m(); + } + +} + +aspect XXX { + @Transactional public void CCC.m() {} +} + +class AAA { + public void m() { } +} + +class BBB { + public void m() { } +} + +class CCC { +} + + +@Retention(RetentionPolicy.RUNTIME) @interface Transactional {} + |