From 654dbbc6587f8117e7e2e7daf9bf6eab1bfba39c Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 30 Jun 2011 17:30:33 +0000 Subject: [PATCH] 350800 --- tests/bugs1612/pr350800/AbstractAdapter.java | 9 +++++++ .../pr350800/AbstractProbingAspect.java | 22 +++++++++++++++++ tests/bugs1612/pr350800/Adapter.java | 9 +++++++ tests/bugs1612/pr350800/ProbingAspect.java | 16 +++++++++++++ .../bugs1612/pr350800_2/AbstractAdapter.java | 9 +++++++ .../pr350800_2/AbstractProbingAspect.java | 20 ++++++++++++++++ tests/bugs1612/pr350800_2/Adapter.java | 9 +++++++ tests/bugs1612/pr350800_2/ProbingAspect.java | 14 +++++++++++ .../bugs1612/pr350800_3/AbstractAdapter.java | 9 +++++++ .../pr350800_3/AbstractProbingAspect.java | 24 +++++++++++++++++++ tests/bugs1612/pr350800_3/Adapter.java | 14 +++++++++++ tests/bugs1612/pr350800_3/ProbingAspect.java | 16 +++++++++++++ .../systemtest/ajc1612/Ajc1612Tests.java | 21 ++++++++++++---- .../aspectj/systemtest/ajc1612/ajc1612.xml | 19 +++++++++++++++ 14 files changed, 206 insertions(+), 5 deletions(-) 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 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); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java index b3190ef0a..fad23bc16 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -25,6 +25,18 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // runTest("anno copying"); // } + public void testGenericsNpe_pr350800() { + runTest("generics npe"); + } + + public void testGenericsNpe_pr350800_code() { + runTest("generics npe - code"); + } + + public void testGenericsNpe_pr350800_3() { + runTest("generics npe - 3"); + } + public void testOrdering_pr349961() { runTest("ordering"); } @@ -32,11 +44,10 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testOrdering_pr349961_2() { runTest("ordering - 2"); } -/* - public void testVerifyError_pr347395() { - runTest("verifyerror - inline"); - } - */ + + /* + * public void testVerifyError_pr347395() { runTest("verifyerror - inline"); } + */ public void testDuplicateMethods_349398() { runTest("duplicate methods"); diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml index 25e7c8c74..403fe4ff6 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -2,6 +2,25 @@ + + + + + + + + + + + + + + + + + + + -- 2.39.5