From 41caa4137c20d581079192659bf43d731aff669f Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 31 Jan 2005 11:32:21 +0000 Subject: [PATCH] Bit of missing support... --- .../org/aspectj/apache/bcel/generic/InstructionFactory.java | 4 +++- bcel-builder/src/org/aspectj/apache/bcel/generic/PUSH.java | 6 +++++- 2 files changed, 8 insertions(+), 2 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 8524f03be..9943e0949 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java @@ -61,7 +61,7 @@ import org.aspectj.apache.bcel.Constants; * byte code generating backend of a compiler. You can subclass it to * add your own create methods. * - * @version $Id: InstructionFactory.java,v 1.2 2004/11/19 16:45:19 aclement Exp $ + * @version $Id: InstructionFactory.java,v 1.3 2005/01/31 11:32:21 aclement Exp $ * @author M. Dahm * @see Constants */ @@ -154,6 +154,8 @@ public class InstructionFactory push = new PUSH(cp, (Boolean)value); else if(value instanceof Character) push = new PUSH(cp, (Character)value); + else if (value instanceof ObjectType) + push = new PUSH(cp, (ObjectType)value); else throw new ClassGenException("Illegal type: " + value.getClass()); diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/PUSH.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/PUSH.java index ce5300fbe..16e5fdf1e 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/PUSH.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/PUSH.java @@ -59,7 +59,7 @@ import org.aspectj.apache.bcel.Constants; * Wrapper class for push operations, which are implemented either as BIPUSH, * LDC or xCONST_n instructions. * - * @version $Id: PUSH.java,v 1.4 2004/11/22 08:31:27 aclement Exp $ + * @version $Id: PUSH.java,v 1.5 2005/01/31 11:32:21 aclement Exp $ * @author M. Dahm */ public final class PUSH @@ -83,6 +83,10 @@ public final class PUSH else // If everything fails create a Constant pool entry instruction = new LDC(cp.addInteger(value)); } + + public PUSH(ConstantPoolGen cp, ObjectType t) { + instruction = new LDC_W(cp.addClass(t)); + } /** * @param cp Constant pool -- 2.39.5