diff --git a/jode/jode/expr/ConstOperator.java b/jode/jode/expr/ConstOperator.java index ccc14d1..86df76b 100644 --- a/jode/jode/expr/ConstOperator.java +++ b/jode/jode/expr/ConstOperator.java @@ -111,12 +111,16 @@ public class ConstOperator extends NoArgOperator { if (type.isOfType(Type.tFloat)) return value+"F"; if (!type.isOfType(Type.tInt) && type.isOfType(Type.tUInt) - && !isInitializer) + && !isInitializer + && (parent == null + || parent.getOperator().getOperatorIndex() != ASSIGN_OP)) { /* One of the strange things in java. All constants * are int and must be explicitly casted to byte,...,short. - * But in initializers this cast is unnecessary. + * But in assignments and initializers this cast is unnecessary. + * See JLS section 5.2 */ return "("+type+") "+value; + } return value; }