diff options
Diffstat (limited to 'bcel-builder/src')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java | 4 |
1 files changed, 3 insertions, 1 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 606beab3e..6a12a8c80 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java @@ -66,6 +66,7 @@ import org.aspectj.apache.bcel.classfile.ConstantInteger; import org.aspectj.apache.bcel.classfile.ConstantLong; import org.aspectj.apache.bcel.classfile.ConstantObject; import org.aspectj.apache.bcel.classfile.ConstantPool; +import org.aspectj.apache.bcel.classfile.ConstantString; import org.aspectj.apache.bcel.classfile.ConstantValue; import org.aspectj.apache.bcel.classfile.Field; import org.aspectj.apache.bcel.classfile.Utility; @@ -126,7 +127,6 @@ public class FieldGen extends FieldGenOrMethodGen { } } - // TODO setting the constant value is a mess... public void setValue(int index) { ConstantPool cp = this.cp; Constant c = cp.getConstant(index); @@ -138,6 +138,8 @@ public class FieldGen extends FieldGenOrMethodGen { value = ((ConstantDouble) c).getValue(); } else if (c instanceof ConstantLong) { value = ((ConstantLong) c).getValue(); + } else if (c instanceof ConstantString) { + value = ((ConstantString)c).getString(cp); } else { value = ((ConstantObject) c).getConstantValue(cp); } |