diff options
author | Andy Clement <aclement@pivotal.io> | 2018-02-28 11:53:14 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-03-09 17:18:45 -0800 |
commit | 7d47cba01043c93bab95b59e66b727580351e85f (patch) | |
tree | 07a7fed0235f2d0e3b9221ebf097e5c24d16aaf0 /bcel-builder | |
parent | 6b620ba3aa4b0c9d29560dfa42f8c67dcafb1229 (diff) | |
download | aspectj-7d47cba01043c93bab95b59e66b727580351e85f.tar.gz aspectj-7d47cba01043c93bab95b59e66b727580351e85f.zip |
Bug#531694: generate more optional thisJoinPoint construction code
This commit introduces some new methods into the
runtime Factory class and modifies code generation
to use them (and to use the form of the LDC bytecode
that loads class constants).
Diffstat (limited to 'bcel-builder')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java | 1 | ||||
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java index c5db1904a..4e1e6c8a8 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java @@ -761,6 +761,7 @@ public class InstructionFactory implements InstructionConstants { iList.append(new InstructionCP(Instruction.LDC_W, classIndex)); } } else { + className = className.replace('/', '.'); iList.append(InstructionFactory.PUSH(cp, className)); iList.append(this.createInvoke("java.lang.Class", "forName", ObjectType.CLASS, Type.STRINGARRAY1, Constants.INVOKESTATIC)); diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java index e1dc47348..9ce007b4f 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java @@ -89,9 +89,9 @@ public abstract class Type { public static final BasicType CHAR = new BasicType(Constants.T_CHAR); public static final ObjectType OBJECT = new ObjectType("java.lang.Object"); public static final ObjectType STRING = new ObjectType("java.lang.String"); - public static final ObjectType OBJECT_ARRAY = new ObjectType("java.lang.Object[]"); - public static final ObjectType STRING_ARRAY = new ObjectType("java.lang.String[]"); - public static final ObjectType CLASS_ARRAY = new ObjectType("java.lang.Class[]"); + public static final ArrayType OBJECT_ARRAY = new ArrayType("java.lang.Object",1); + public static final ArrayType STRING_ARRAY = new ArrayType("java.lang.String",1); + public static final ArrayType CLASS_ARRAY = new ArrayType("java.lang.Class",1); public static final ObjectType STRINGBUFFER = new ObjectType("java.lang.StringBuffer"); public static final ObjectType STRINGBUILDER = new ObjectType("java.lang.StringBuilder"); public static final ObjectType THROWABLE = new ObjectType("java.lang.Throwable"); @@ -130,6 +130,7 @@ public abstract class Type { commonTypes.put(CLASS.getSignature(), CLASS); commonTypes.put(OBJECT.getSignature(), OBJECT); commonTypes.put(STRING_ARRAY.getSignature(), STRING_ARRAY); + commonTypes.put(CLASS_ARRAY.getSignature(), CLASS_ARRAY); commonTypes.put(OBJECT_ARRAY.getSignature(), OBJECT_ARRAY); commonTypes.put(INTEGER.getSignature(), INTEGER); commonTypes.put(EXCEPTION.getSignature(), EXCEPTION); |