From 654dbbc6587f8117e7e2e7daf9bf6eab1bfba39c Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 30 Jun 2011 17:30:33 +0000 Subject: 350800 --- tests/bugs1612/pr350800/AbstractAdapter.java | 9 ++++++++ tests/bugs1612/pr350800/AbstractProbingAspect.java | 22 ++++++++++++++++++++ tests/bugs1612/pr350800/Adapter.java | 9 ++++++++ tests/bugs1612/pr350800/ProbingAspect.java | 16 +++++++++++++++ tests/bugs1612/pr350800_2/AbstractAdapter.java | 9 ++++++++ .../bugs1612/pr350800_2/AbstractProbingAspect.java | 20 ++++++++++++++++++ tests/bugs1612/pr350800_2/Adapter.java | 9 ++++++++ tests/bugs1612/pr350800_2/ProbingAspect.java | 14 +++++++++++++ tests/bugs1612/pr350800_3/AbstractAdapter.java | 9 ++++++++ .../bugs1612/pr350800_3/AbstractProbingAspect.java | 24 ++++++++++++++++++++++ tests/bugs1612/pr350800_3/Adapter.java | 14 +++++++++++++ tests/bugs1612/pr350800_3/ProbingAspect.java | 16 +++++++++++++++ 12 files changed, 171 insertions(+) create mode 100644 tests/bugs1612/pr350800/AbstractAdapter.java create mode 100644 tests/bugs1612/pr350800/AbstractProbingAspect.java create mode 100644 tests/bugs1612/pr350800/Adapter.java create mode 100644 tests/bugs1612/pr350800/ProbingAspect.java create mode 100644 tests/bugs1612/pr350800_2/AbstractAdapter.java create mode 100644 tests/bugs1612/pr350800_2/AbstractProbingAspect.java create mode 100644 tests/bugs1612/pr350800_2/Adapter.java create mode 100644 tests/bugs1612/pr350800_2/ProbingAspect.java create mode 100644 tests/bugs1612/pr350800_3/AbstractAdapter.java create mode 100644 tests/bugs1612/pr350800_3/AbstractProbingAspect.java create mode 100644 tests/bugs1612/pr350800_3/Adapter.java create mode 100644 tests/bugs1612/pr350800_3/ProbingAspect.java (limited to 'tests/bugs1612') diff --git a/tests/bugs1612/pr350800/AbstractAdapter.java b/tests/bugs1612/pr350800/AbstractAdapter.java new file mode 100644 index 000000000..660bb1cd2 --- /dev/null +++ b/tests/bugs1612/pr350800/AbstractAdapter.java @@ -0,0 +1,9 @@ +package test.aop; + +import java.io.Serializable; + +public abstract class AbstractAdapter { + + protected abstract T execute(T message); + +} diff --git a/tests/bugs1612/pr350800/AbstractProbingAspect.java b/tests/bugs1612/pr350800/AbstractProbingAspect.java new file mode 100644 index 000000000..7ac8acc9e --- /dev/null +++ b/tests/bugs1612/pr350800/AbstractProbingAspect.java @@ -0,0 +1,22 @@ +package test.aop; + +import java.io.Serializable; + +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 AbstractProbingAspect { + + @Pointcut("") + protected abstract void adapterMethodExecution(); + + @Around("adapterMethodExecution()") + public T around(ProceedingJoinPoint thisJoinPoint) throws Throwable { + return (T) thisJoinPoint.proceed(); + } + + protected abstract String extractFunctionName(T command); +} diff --git a/tests/bugs1612/pr350800/Adapter.java b/tests/bugs1612/pr350800/Adapter.java new file mode 100644 index 000000000..0f1015f69 --- /dev/null +++ b/tests/bugs1612/pr350800/Adapter.java @@ -0,0 +1,9 @@ +package test.aop; + +public class Adapter extends AbstractAdapter { + + @Override + public String execute(String message) { + return message; + } +} diff --git a/tests/bugs1612/pr350800/ProbingAspect.java b/tests/bugs1612/pr350800/ProbingAspect.java new file mode 100644 index 000000000..51d410e66 --- /dev/null +++ b/tests/bugs1612/pr350800/ProbingAspect.java @@ -0,0 +1,16 @@ +package test.aop; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class ProbingAspect extends AbstractProbingAspect { + + @Pointcut("execution(String test.aop.Adapter.execute(String))") + protected void adapterMethodExecution() {}; + + @Override + protected String extractFunctionName(String command) { + return String.valueOf(command); + } +} diff --git a/tests/bugs1612/pr350800_2/AbstractAdapter.java b/tests/bugs1612/pr350800_2/AbstractAdapter.java new file mode 100644 index 000000000..660bb1cd2 --- /dev/null +++ b/tests/bugs1612/pr350800_2/AbstractAdapter.java @@ -0,0 +1,9 @@ +package test.aop; + +import java.io.Serializable; + +public abstract class AbstractAdapter { + + protected abstract T execute(T message); + +} diff --git a/tests/bugs1612/pr350800_2/AbstractProbingAspect.java b/tests/bugs1612/pr350800_2/AbstractProbingAspect.java new file mode 100644 index 000000000..b6cb370eb --- /dev/null +++ b/tests/bugs1612/pr350800_2/AbstractProbingAspect.java @@ -0,0 +1,20 @@ +package test.aop; + +import java.io.Serializable; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +public abstract aspect AbstractProbingAspect { + + abstract pointcut adapterMethodExecution(); + + + T around(): adapterMethodExecution() { + return (T) proceed(); + } + + protected abstract String extractFunctionName(T command); +} diff --git a/tests/bugs1612/pr350800_2/Adapter.java b/tests/bugs1612/pr350800_2/Adapter.java new file mode 100644 index 000000000..0f1015f69 --- /dev/null +++ b/tests/bugs1612/pr350800_2/Adapter.java @@ -0,0 +1,9 @@ +package test.aop; + +public class Adapter extends AbstractAdapter { + + @Override + public String execute(String message) { + return message; + } +} diff --git a/tests/bugs1612/pr350800_2/ProbingAspect.java b/tests/bugs1612/pr350800_2/ProbingAspect.java new file mode 100644 index 000000000..01e24e3c0 --- /dev/null +++ b/tests/bugs1612/pr350800_2/ProbingAspect.java @@ -0,0 +1,14 @@ +package test.aop; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +public aspect ProbingAspect extends AbstractProbingAspect { + + pointcut adapterMethodExecution(): execution(String test.aop.Adapter.execute(String)); + + @Override + protected String extractFunctionName(String command) { + return String.valueOf(command); + } +} diff --git a/tests/bugs1612/pr350800_3/AbstractAdapter.java b/tests/bugs1612/pr350800_3/AbstractAdapter.java new file mode 100644 index 000000000..660bb1cd2 --- /dev/null +++ b/tests/bugs1612/pr350800_3/AbstractAdapter.java @@ -0,0 +1,9 @@ +package test.aop; + +import java.io.Serializable; + +public abstract class AbstractAdapter { + + protected abstract T execute(T message); + +} diff --git a/tests/bugs1612/pr350800_3/AbstractProbingAspect.java b/tests/bugs1612/pr350800_3/AbstractProbingAspect.java new file mode 100644 index 000000000..bd25c5ba4 --- /dev/null +++ b/tests/bugs1612/pr350800_3/AbstractProbingAspect.java @@ -0,0 +1,24 @@ +package test.aop; + +import java.io.Serializable; + +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 AbstractProbingAspect { + + @Pointcut("") + protected abstract void adapterMethodExecution(); + + @Around("adapterMethodExecution()") + public T around(ProceedingJoinPoint thisJoinPoint) throws Throwable { + T t = (T) thisJoinPoint.proceed(); + System.out.println(">"+extractFunctionName(t)); + return t; + } + + protected abstract String extractFunctionName(T command); +} diff --git a/tests/bugs1612/pr350800_3/Adapter.java b/tests/bugs1612/pr350800_3/Adapter.java new file mode 100644 index 000000000..5a359b6ba --- /dev/null +++ b/tests/bugs1612/pr350800_3/Adapter.java @@ -0,0 +1,14 @@ +package test.aop; + +public class Adapter extends AbstractAdapter { + + @Override + public String execute(String message) { + return message; + } + + + public static void main(String []argv) { + new Adapter().execute("hello"); + } +} diff --git a/tests/bugs1612/pr350800_3/ProbingAspect.java b/tests/bugs1612/pr350800_3/ProbingAspect.java new file mode 100644 index 000000000..51d410e66 --- /dev/null +++ b/tests/bugs1612/pr350800_3/ProbingAspect.java @@ -0,0 +1,16 @@ +package test.aop; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class ProbingAspect extends AbstractProbingAspect { + + @Pointcut("execution(String test.aop.Adapter.execute(String))") + protected void adapterMethodExecution() {}; + + @Override + protected String extractFunctionName(String command) { + return String.valueOf(command); + } +} -- cgit v1.2.3