From: aclement Date: Mon, 31 Jan 2005 11:32:21 +0000 (+0000) Subject: Bit of missing support... X-Git-Tag: Root_AspectJ5_Development~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=41caa4137c20d581079192659bf43d731aff669f;p=aspectj.git Bit of missing support... --- 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