diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java index 50c206c..b791e62 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java @@ -891,7 +891,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) && VarType.VARTYPE_INT.isStrictSuperset(leftType)); + (isIntConstant(exprent) && rightType.isStrictSuperset(leftType)); boolean quote = cast && exprent.getPrecedence() >= FunctionExprent.getPrecedence(FunctionExprent.FUNCTION_CAST); diff --git a/testData/classes/pkg/MoreAnnotations$TestEnum.class b/testData/classes/pkg/MoreAnnotations$TestEnum.class index d221ad6..5e4765d 100644 Binary files a/testData/classes/pkg/MoreAnnotations$TestEnum.class and b/testData/classes/pkg/MoreAnnotations$TestEnum.class differ diff --git a/testData/classes/pkg/MoreAnnotations.class b/testData/classes/pkg/MoreAnnotations.class index 36178de..85146c8 100644 Binary files a/testData/classes/pkg/MoreAnnotations.class and b/testData/classes/pkg/MoreAnnotations.class differ diff --git a/testData/results/MoreAnnotations.dec b/testData/results/MoreAnnotations.dec index 7ca5d12..37302cc 100644 --- a/testData/results/MoreAnnotations.dec +++ b/testData/results/MoreAnnotations.dec @@ -33,11 +33,11 @@ public @interface MoreAnnotations { String annotatedWithEmptyArrays = ""; @MoreAnnotations( intArray = {1, 0, 2147483647, -2147483648}, - byteArray = {(byte)1, (byte)0, (byte)127, (byte)-128}, + byteArray = {1, 0, 127, -128, -1}, floatArray = {1.0F, 0.0F, 3.4028235E38F, 1.4E-45F, 0.0F / 0.0, 1.0F / 0.0, -1.0F / 0.0}, doubleArray = {1.0D, 0.0D, 1.7976931348623157E308D, 4.9E-324D, 0.0D / 0.0, 1.0D / 0.0, -1.0D / 0.0}, booleanArray = {true, false}, - shortArray = {(short)1, (short)0, (short)32767, (short)-32768}, + shortArray = {1, 0, 32767, -32768, -1}, longArray = {1L, 0L, 9223372036854775807L, -9223372036854775808L}, charArray = {'a', '\n', '\u0001', '\u0000', '\uffff', '\u0000'}, enumArray = {MoreAnnotations.TestEnum.FirstValue, MoreAnnotations.TestEnum.SecondValue}, @@ -73,7 +73,7 @@ public @interface MoreAnnotations { int[] intArray() default {1, 0, 2147483647, -2147483648}; - byte[] byteArray() default {(byte)1, (byte)0, (byte)127, (byte)-128}; + byte[] byteArray() default {1, 0, 127, -128, -1}; float[] floatArray() default {1.0F, 0.0F, 3.4028235E38F, 1.4E-45F, 0.0F / 0.0, 1.0F / 0.0, -1.0F / 0.0}; @@ -81,7 +81,7 @@ public @interface MoreAnnotations { boolean[] booleanArray() default {true, false}; - short[] shortArray() default {(short)1, (short)0, (short)32767, (short)-32768}; + short[] shortArray() default {1, 0, 32767, -32768, -1}; long[] longArray() default {1L, 0L, 9223372036854775807L, -9223372036854775808L}; diff --git a/testData/src/pkg/MoreAnnotations.java b/testData/src/pkg/MoreAnnotations.java index e66835e..d29abce 100644 --- a/testData/src/pkg/MoreAnnotations.java +++ b/testData/src/pkg/MoreAnnotations.java @@ -16,16 +16,16 @@ public @interface MoreAnnotations { Class classValue() default CharSequence.class; int[] intArray() default { 1, 0, Integer.MAX_VALUE, Integer.MIN_VALUE }; - byte[] byteArray() default { 1, 0, Byte.MAX_VALUE, Byte.MIN_VALUE }; + byte[] byteArray() default { 1, 0, Byte.MAX_VALUE, Byte.MIN_VALUE, (byte)0xFF }; float[] floatArray() default { 1, 0, Float.MAX_VALUE, Float.MIN_VALUE, Float.NaN, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY }; double[] doubleArray() default { 1, 0, Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY }; boolean[] booleanArray() default { true, false }; - short[] shortArray() default { 1, 0, Short.MAX_VALUE, Short.MIN_VALUE }; + short[] shortArray() default { 1, 0, Short.MAX_VALUE, Short.MIN_VALUE, (short)0xFFFF }; long[] longArray() default { 1, 0, Long.MAX_VALUE, Long.MIN_VALUE }; char[] charArray() default { 1, 0, Character.MAX_VALUE, Character.MIN_VALUE }; TestEnum[] enumArray() default { TestEnum.FirstValue }; NestedAnnotation[] annotationArray() default { @NestedAnnotation }; - String[] stringArray() default { "first", "second", ""}; + String[] stringArray() default { "first", "second", "" }; Class[] classArray() default { CharSequence.class, String.class, StringBuilder.class }; @interface NestedAnnotation { @@ -66,16 +66,16 @@ public @interface MoreAnnotations { @MoreAnnotations( intArray = { 1, 0, Integer.MAX_VALUE, Integer.MIN_VALUE }, - byteArray = { 1, 0, Byte.MAX_VALUE, Byte.MIN_VALUE }, + byteArray = { 1, 0, Byte.MAX_VALUE, Byte.MIN_VALUE, (byte)0xFF }, floatArray = { 1, 0, Float.MAX_VALUE, Float.MIN_VALUE, Float.NaN, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY }, doubleArray = { 1, 0, Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY }, booleanArray = { true, false }, - shortArray = { 1, 0, Short.MAX_VALUE, Short.MIN_VALUE }, + shortArray = { 1, 0, Short.MAX_VALUE, Short.MIN_VALUE, (short)0xFFFF }, longArray = { 1, 0, Long.MAX_VALUE, Long.MIN_VALUE }, charArray = { 'a', '\n', 1, 0, Character.MAX_VALUE, Character.MIN_VALUE }, - enumArray = { TestEnum.FirstValue , TestEnum.SecondValue}, + enumArray = { TestEnum.FirstValue , TestEnum.SecondValue }, annotationArray = { @NestedAnnotation("a"), @NestedAnnotation("b") }, - stringArray = { "first", "second", ""}, + stringArray = { "first", "second", "" }, classArray = { CharSequence.class, String.class, StringBuilder.class } ) String annotatedWithArrays = "";