aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-01-05 15:44:25 -0800
committerAndy Clement <aclement@pivotal.io>2016-01-05 15:44:25 -0800
commit482995299ca0078f67c6a6038d3ce7e3745663e9 (patch)
tree7e60622f507595f7c6da89afb8c225fbd3401a32 /bcel-builder
parentd9029474077ebd405ec34d44913eed3051f2691e (diff)
downloadaspectj-482995299ca0078f67c6a6038d3ce7e3745663e9.tar.gz
aspectj-482995299ca0078f67c6a6038d3ce7e3745663e9.zip
Fix 485055: declare @field failing for final String fields (see also Bug 327141)
Diffstat (limited to 'bcel-builder')
-rw-r--r--bcel-builder/bcel-src.zipbin55121 -> 0 bytes
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/generic/FieldGen.java4
2 files changed, 3 insertions, 1 deletions
diff --git a/bcel-builder/bcel-src.zip b/bcel-builder/bcel-src.zip
deleted file mode 100644
index a3a9951b7..000000000
--- a/bcel-builder/bcel-src.zip
+++ /dev/null
Binary files differ
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);
}