From a75b7fa48b233e41ed7aeb7d50fbdd411eadd8e6 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 1 Dec 2005 15:00:22 +0000 Subject: [PATCH] test and fix for 118781 --- tests/bugs150/pr118781/MyAspect.java | 13 ++++++++++++ tests/bugs150/pr118781/MyClass.java | 21 +++++++++++++++++++ tests/bugs150/pr118781/MyMain.java | 15 +++++++++++++ .../systemtest/ajc150/Ajc150Tests.java | 2 +- .../org/aspectj/systemtest/ajc150/ajc150.xml | 5 +++++ weaver/src/org/aspectj/weaver/World.java | 7 +++++-- 6 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 tests/bugs150/pr118781/MyAspect.java create mode 100644 tests/bugs150/pr118781/MyClass.java create mode 100644 tests/bugs150/pr118781/MyMain.java diff --git a/tests/bugs150/pr118781/MyAspect.java b/tests/bugs150/pr118781/MyAspect.java new file mode 100644 index 000000000..9ba114ee3 --- /dev/null +++ b/tests/bugs150/pr118781/MyAspect.java @@ -0,0 +1,13 @@ +package blah; + +public aspect MyAspect { + + pointcut callPointCut(): call(public * blah.MyClass+.*(..)); + + Object around() : callPointCut() { + System.out.println("start of around"); + Object result = proceed(); + System.out.println("end of around"); + return result; + } +} diff --git a/tests/bugs150/pr118781/MyClass.java b/tests/bugs150/pr118781/MyClass.java new file mode 100644 index 000000000..c29be0ca9 --- /dev/null +++ b/tests/bugs150/pr118781/MyClass.java @@ -0,0 +1,21 @@ +package blah; + +import java.util.Random; + +public class MyClass { + public Integer[] getRandomInt(String[][] param) + { + for (int i = 0; i < param.length; i++) + { + System.out.print("[" + i + "] = ["); + for (int j = 0; j < param[i].length; j++) + { + System.out.print(param[i][j]); + if (j != param[i].length-1) + System.out.print(','); + } + System.out.println(']'); + } + return new Integer[] { new Integer(new Random().nextInt())}; + } +} diff --git a/tests/bugs150/pr118781/MyMain.java b/tests/bugs150/pr118781/MyMain.java new file mode 100644 index 000000000..4618c48fb --- /dev/null +++ b/tests/bugs150/pr118781/MyMain.java @@ -0,0 +1,15 @@ +package blah; + +/** */ +public class MyMain { + + /** + * @param args + */ + public static void main(String[] args) + { + MyClass mc = new MyClass(); + mc.getRandomInt(new String[][]{{ "a", "b", +"c"},{"x","y","z"}}); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 8e22e8ed3..c373bd9fe 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -50,9 +50,9 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { */ public void testGeneratingCodeForAnOldRuntime_pr116679_1() { runTest("generating code for a 1.2.1 runtime - 1");} public void testGeneratingCodeForAnOldRuntime_pr116679_2() { runTest("generating code for a 1.2.1 runtime - 2");} - public void testAmbiguousMethod_pr118599_1() { runTest("ambiguous method when binary weaving - 1");} public void testAmbiguousMethod_pr118599_2() { runTest("ambiguous method when binary weaving - 2");} + public void testAroundAdviceArrayAdviceSigs_pr118781() { runTest("verify error with around advice array sigs");} public void testAtDeclareParents_pr117681() { runTest("at declare parents");} public void testPrivilegeProblem_pr87525() { runTest("privilege problem with switch");} public void testGenericAspects_pr115237() { runTest("aspectOf and generic aspects");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index bdad37215..c68ec595b 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -92,6 +92,11 @@ + + + + + diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index b353a7241..4a21711d4 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -209,8 +209,8 @@ public abstract class World implements Dump.INode { // no existing resolved type, create one if (ty.isArray()) { ResolvedType componentType = resolve(ty.getComponentType(),allowMissing); - String brackets = signature.substring(0,signature.lastIndexOf("[")+1); - ret = new ResolvedType.Array(signature, brackets+componentType.getErasureSignature(), + //String brackets = signature.substring(0,signature.lastIndexOf("[")+1); + ret = new ResolvedType.Array(signature, "["+componentType.getErasureSignature(), this, componentType); } else { @@ -690,6 +690,9 @@ public abstract class World implements Dump.INode { * method/ctor as opposed to those you see declared on a generic type. */ public ResolvedType put(String key, ResolvedType type) { + if (key.indexOf("String")!=-1) { + int stop=1; + } if (type.isParameterizedType() && type.isParameterizedWithAMemberTypeVariable()) { if (debug) System.err.println("Not putting a parameterized type that utilises member declared type variables into the typemap: key="+key+" type="+type); -- 2.39.5