IDEA-171459 fix type cast for int literals used as byte / short in decompiled code

This commit is contained in:
Dmitry Cherniachenko
2017-04-14 00:00:42 +02:00
committed by Egor.Ushakov
parent 4beda48cf8
commit cd1acfa266
6 changed files with 293 additions and 5 deletions

View File

@@ -876,7 +876,7 @@ public class ExprProcessor implements CodeConstants {
castAlways ||
(!leftType.isSuperset(rightType) && (rightType.equals(VarType.VARTYPE_OBJECT) || leftType.type != CodeConstants.TYPE_OBJECT)) ||
(castNull && rightType.type == CodeConstants.TYPE_NULL && !UNDEFINED_TYPE_STRING.equals(getTypeName(leftType))) ||
(isIntConstant(exprent) && rightType.isStrictSuperset(leftType));
(isIntConstant(exprent) && VarType.VARTYPE_INT.isStrictSuperset(leftType));
boolean quote = cast && exprent.getPrecedence() >= FunctionExprent.getPrecedence(FunctionExprent.FUNCTION_CAST);