From c7608950f0deb6f9951435f58209ad60aaf28e06 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 18 Nov 2005 09:01:17 +0000 Subject: test and fix for 116626 from Matthew. --- tests/bugs150/pr116626/TestAspect.aj | 19 +++++++++++++++++++ tests/bugs150/pr116626/aop.xml | 9 +++++++++ tests/bugs150/pr116626/com/foo/bar/Test.java | 28 ++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 tests/bugs150/pr116626/TestAspect.aj create mode 100644 tests/bugs150/pr116626/aop.xml create mode 100644 tests/bugs150/pr116626/com/foo/bar/Test.java (limited to 'tests/bugs150') diff --git a/tests/bugs150/pr116626/TestAspect.aj b/tests/bugs150/pr116626/TestAspect.aj new file mode 100644 index 000000000..105a53eb9 --- /dev/null +++ b/tests/bugs150/pr116626/TestAspect.aj @@ -0,0 +1,19 @@ +package com.foo.bar; + +public privileged aspect TestAspect { + + pointcut TestToArray(Test mt) : + target(mt) && + !within(TestAspect); + + + Object[] around(Test mt, Object[] objs) : + TestToArray(mt) && + args(objs) && + execution(Object[] Test.getObjs(Object[])) { + + objs = proceed(mt, objs); + System.out.println("GO Aspects!"); + return objs; + } +} diff --git a/tests/bugs150/pr116626/aop.xml b/tests/bugs150/pr116626/aop.xml new file mode 100644 index 000000000..93ca6dd43 --- /dev/null +++ b/tests/bugs150/pr116626/aop.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/bugs150/pr116626/com/foo/bar/Test.java b/tests/bugs150/pr116626/com/foo/bar/Test.java new file mode 100644 index 000000000..5b255baee --- /dev/null +++ b/tests/bugs150/pr116626/com/foo/bar/Test.java @@ -0,0 +1,28 @@ +package com.foo.bar; + +import java.util.*; + +public class Test { + + Set intsSet; + + public Test() { + this.intsSet = new HashSet(); + } + + public T[] getObjs(T[] a) { + return intsSet.toArray(a); + } + + public static void main(String[] args) { + System.out.println("AAA :-)"); + new TTT().foo(); + } +} + +class TTT { + public void foo() { + Test mt = new Test(); + Object[] arr = mt.getObjs(new Object[]{}); + } +} -- cgit v1.2.3