fix: don't print commented case value if it is an instruction (#850)

This commit is contained in:
Skylot
2020-02-11 18:40:25 +00:00
parent 4859629850
commit fcb70e69c1
@@ -297,10 +297,13 @@ public class RegionGen extends InsnGen {
code.add(fn.getAlias());
} else {
staticField(code, fn.getFieldInfo());
// print original value, sometimes replace with incorrect field
// print original value, sometimes replaced with incorrect field
FieldInitAttr valueAttr = fn.get(AType.FIELD_INIT);
if (valueAttr != null && valueAttr.getValue() != null) {
code.add(" /*").add(valueAttr.getValue().toString()).add("*/");
if (valueAttr != null) {
Object value = valueAttr.getValue();
if (value != null && valueAttr.getValueType() == FieldInitAttr.InitType.CONST) {
code.add(" /*").add(value.toString()).add("*/");
}
}
}
} else if (k instanceof Integer) {