diff options
author | aclement <aclement> | 2010-01-29 20:28:37 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-01-29 20:28:37 +0000 |
commit | c37f7b59681af275495aecd5a8f509d65b1f8fdd (patch) | |
tree | 8207ceca77f92c392b7a65a4d9378a6c891bcba1 /bcel-builder | |
parent | 56821892311d53bb86b9990062ee018439d5beff (diff) | |
download | aspectj-c37f7b59681af275495aecd5a8f509d65b1f8fdd.tar.gz aspectj-c37f7b59681af275495aecd5a8f509d65b1f8fdd.zip |
slight FieldGen change to allow constant initialization - not great but it works
Diffstat (limited to 'bcel-builder')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java index fdda9109a..27a585bc8 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java @@ -72,7 +72,7 @@ import org.aspectj.apache.bcel.classfile.annotation.RuntimeAnnos; * Template class for building up a field. The only extraordinary thing one can do is to add a constant value attribute to a field * (which must of course be compatible with the declared type). * - * @version $Id: FieldGen.java,v 1.9 2009/09/15 19:40:14 aclement Exp $ + * @version $Id: FieldGen.java,v 1.10 2010/01/29 20:28:37 aclement Exp $ * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> * @see Field */ @@ -122,12 +122,17 @@ public class FieldGen extends FieldGenOrMethodGen { } } - private void setValue(int index) { +// TODO setting the constant value is a mess... + public void setValue(int index) { ConstantPool cp = this.cp; Constant c = cp.getConstant(index); value = ((ConstantObject) c).getConstantValue(cp); } + public void setValue(String constantString) { + value = constantString; + } + public void wipeValue() { value = null; } @@ -197,6 +202,10 @@ public class FieldGen extends FieldGenOrMethodGen { return (value == null ? null : value.toString()); } + public void setInitialStringValue(String value) { + this.value = value; + } + /** * Return string representation close to declaration format, `public static final short MAX = 100', e.g.. */ |