From a5330382082fbb28a761421037901d6b277e966f Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 27 Aug 2004 14:39:46 +0000 Subject: [PATCH] tests for Bugzilla Bug 70404 passing null to array arguments confuzes static join point signature. --- tests/bugs/pr70404/Main.java | 15 +++++++++++++++ tests/bugs/pr70404/Main2.java | 13 +++++++++++++ tests/bugs/pr70404/MainAspect.java | 19 +++++++++++++++++++ .../systemtest/ajc121/Ajc121Tests.java | 9 +++++++++ .../systemtest/ajc121/ajc121-tests.xml | 17 +++++++++++++---- 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 tests/bugs/pr70404/Main.java create mode 100644 tests/bugs/pr70404/Main2.java create mode 100644 tests/bugs/pr70404/MainAspect.java diff --git a/tests/bugs/pr70404/Main.java b/tests/bugs/pr70404/Main.java new file mode 100644 index 000000000..01cff7a87 --- /dev/null +++ b/tests/bugs/pr70404/Main.java @@ -0,0 +1,15 @@ +package dk.infimum.aspectjtest; +public class Main { + + public static void main(String[] args) { + Main obj = new Main(); + //Main m[] = new Main[3]; + + // swap following lines to change behavior + obj.test(null, null); + obj.test(null, new Main[]{}); + } + + void test(Main dummy, Main[] dummy2) {} + +} diff --git a/tests/bugs/pr70404/Main2.java b/tests/bugs/pr70404/Main2.java new file mode 100644 index 000000000..c18eec46c --- /dev/null +++ b/tests/bugs/pr70404/Main2.java @@ -0,0 +1,13 @@ +package dk.infimum.aspectjtest; +public class Main2 { + + public static void main(String[] args) { + Main2 obj = new Main2(); + // swap following lines to change behavior + obj.test(null, new Main2[]{}); + obj.test(null, null); + } + + void test(Main2 dummy, Main2[] dummy2) {} + +} diff --git a/tests/bugs/pr70404/MainAspect.java b/tests/bugs/pr70404/MainAspect.java new file mode 100644 index 000000000..ef1711d2d --- /dev/null +++ b/tests/bugs/pr70404/MainAspect.java @@ -0,0 +1,19 @@ +import org.aspectj.lang.reflect.MethodSignature; + +public aspect MainAspect { + + pointcut testcall(): execution(* test*(..)); + + before(): testcall() { + MethodSignature sig = + (MethodSignature) thisJoinPointStaticPart.getSignature(); + System.out.println(sig); + Class[] params = sig.getParameterTypes(); + for(int i=0;i - - + @@ -432,5 +431,15 @@ - - \ No newline at end of file + + + + + + + + + + -- 2.39.5