diff options
author | Andy Clement <aclement@pivotal.io> | 2016-01-05 15:44:25 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2016-01-05 15:44:25 -0800 |
commit | 482995299ca0078f67c6a6038d3ce7e3745663e9 (patch) | |
tree | 7e60622f507595f7c6da89afb8c225fbd3401a32 /bcel-builder/src | |
parent | d9029474077ebd405ec34d44913eed3051f2691e (diff) | |
download | aspectj-482995299ca0078f67c6a6038d3ce7e3745663e9.tar.gz aspectj-482995299ca0078f67c6a6038d3ce7e3745663e9.zip |
Fix 485055: declare @field failing for final String fields (see also Bug 327141)
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); } |