diff options
author | aclement <aclement> | 2006-07-04 16:53:37 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-07-04 16:53:37 +0000 |
commit | 4a8b8532694b79c106efd1eb70070e71174b6f1a (patch) | |
tree | a5d6e894e69bb05a76f3c4f5e14a37adc61aa2be /tests/bugs153/pr149305 | |
parent | 6becfea965f575ea82af8581d8551b4ed5537ed8 (diff) | |
download | aspectj-4a8b8532694b79c106efd1eb70070e71174b6f1a.tar.gz aspectj-4a8b8532694b79c106efd1eb70070e71174b6f1a.zip |
testcode for 149305, 149096, 149305
Diffstat (limited to 'tests/bugs153/pr149305')
6 files changed, 126 insertions, 0 deletions
diff --git a/tests/bugs153/pr149305/case1/AbstractOzonator.java b/tests/bugs153/pr149305/case1/AbstractOzonator.java new file mode 100644 index 000000000..ccd500465 --- /dev/null +++ b/tests/bugs153/pr149305/case1/AbstractOzonator.java @@ -0,0 +1,26 @@ +package ajtest2; + +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 abstract class AbstractOzonator +{ + + @Pointcut("") + protected abstract void readMethodExecution(); + + @Pointcut("readMethodExecution() && this(ozonated)") + private void ozonatedReadExecution(Object ozonated){}; + + @Around("ozonatedReadExecution(ozonated)") + public Object aroundGetterCallNoRecurse( ProceedingJoinPoint thisJoinPoint, + Object ozonated) throws Throwable + { + System.out.println("thisJoinPoint="+thisJoinPoint+", ozonated="+ozonated); + return thisJoinPoint.proceed(); + } + +} diff --git a/tests/bugs153/pr149305/case1/IdentityOzonator.java b/tests/bugs153/pr149305/case1/IdentityOzonator.java new file mode 100644 index 000000000..dd649772e --- /dev/null +++ b/tests/bugs153/pr149305/case1/IdentityOzonator.java @@ -0,0 +1,11 @@ +package ajtest2; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class IdentityOzonator extends AbstractOzonator +{ + @Pointcut("execution(public * ajtest2.User+.get*(..)) ") + protected void readMethodExecution() {} +} diff --git a/tests/bugs153/pr149305/case1/User.java b/tests/bugs153/pr149305/case1/User.java new file mode 100644 index 000000000..8cba50670 --- /dev/null +++ b/tests/bugs153/pr149305/case1/User.java @@ -0,0 +1,24 @@ +package ajtest2; + +public class User +{ + private String name; + + public String getName() + { + return name; + } + + public void setName( String name) + { + this.name = name; + } + + static public void main(String args[]) + { + User u = new User(); + System.out.println(u.getName()); + u.setName("blah blah"); + System.out.println(u.getName()); + } +} diff --git a/tests/bugs153/pr149305/case2/com/codesrc/ozonator/AbstractOzonator.java b/tests/bugs153/pr149305/case2/com/codesrc/ozonator/AbstractOzonator.java new file mode 100644 index 000000000..6b0890fa4 --- /dev/null +++ b/tests/bugs153/pr149305/case2/com/codesrc/ozonator/AbstractOzonator.java @@ -0,0 +1,27 @@ +package com.codesrc.ozonator; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import com.codesrc.ozonator.identity.User; + +@Aspect +public abstract class AbstractOzonator +{ + + @Pointcut("") + protected abstract void readMethodExecution(); + + @Pointcut("readMethodExecution() && this(ozonated)") + private void ozonatedReadExecution(Object ozonated){}; + + @Around("ozonatedReadExecution(ozonated)") + public Object aroundGetterCallNoRecurse( ProceedingJoinPoint thisJoinPoint, + Object ozonated) throws Throwable + { + System.out.println("thisJoinPoint="+thisJoinPoint+", ozonated="+ozonated); + return thisJoinPoint.proceed(); + } + +} diff --git a/tests/bugs153/pr149305/case2/com/codesrc/ozonator/identity/IdentityOzonator.java b/tests/bugs153/pr149305/case2/com/codesrc/ozonator/identity/IdentityOzonator.java new file mode 100644 index 000000000..31e0209e4 --- /dev/null +++ b/tests/bugs153/pr149305/case2/com/codesrc/ozonator/identity/IdentityOzonator.java @@ -0,0 +1,13 @@ +package com.codesrc.ozonator.identity; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +import com.codesrc.ozonator.AbstractOzonator; + +@Aspect +public class IdentityOzonator extends AbstractOzonator +{ + @Pointcut("execution(public * com.codesrc.ozonator.identity.User+.get*(..)) ") + protected void readMethodExecution() {} +} diff --git a/tests/bugs153/pr149305/case2/com/codesrc/ozonator/identity/User.java b/tests/bugs153/pr149305/case2/com/codesrc/ozonator/identity/User.java new file mode 100644 index 000000000..9ac828c1a --- /dev/null +++ b/tests/bugs153/pr149305/case2/com/codesrc/ozonator/identity/User.java @@ -0,0 +1,25 @@ +package com.codesrc.ozonator.identity; + +public class User +{ + private String name; + + public String getName() + { + return name; + } + + public void setName( String name) + { + this.name = name; + } + + static public void main(String args[]) + { + User u = new User(); + System.out.println(u.getName()); + u.setName("blah blah"); + System.out.println(u.getName()); + } + +} |