diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java index 0f0e141..612fd37 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java @@ -371,7 +371,8 @@ public class ConstExprent extends Exprent { // BYTECHAR and SHORTCHAR => CHAR in the CHAR context if (expectedType.equals(VarType.VARTYPE_CHAR) && (constType.equals(VarType.VARTYPE_BYTECHAR) || constType.equals(VarType.VARTYPE_SHORTCHAR))) { - if (isPrintableAscii(getIntValue())) { + int intValue = getIntValue(); + if (isPrintableAscii(intValue) || CHAR_ESCAPES.containsKey(intValue)) { setConstType(VarType.VARTYPE_CHAR); } } diff --git a/testData/classes/pkg/TestPrimitives.class b/testData/classes/pkg/TestPrimitives.class index 8ed2ef7..be15ee5 100644 Binary files a/testData/classes/pkg/TestPrimitives.class and b/testData/classes/pkg/TestPrimitives.class differ diff --git a/testData/results/TestPrimitives.dec b/testData/results/TestPrimitives.dec index d6fcbc4..eae376a 100644 --- a/testData/results/TestPrimitives.dec +++ b/testData/results/TestPrimitives.dec @@ -74,11 +74,17 @@ public class TestPrimitives { boolean res = c > -1;// 77 res = c > 0;// 78 res = c > 1;// 79 - res = c > 'a';// 80 - res = c > 'Z';// 81 - res = c > 127;// 82 - res = c > 255;// 83 - return res;// 84 + res = c > '\b';// 80 + res = c > '\t';// 81 + res = c > '\n';// 82 + res = c > '\f';// 83 + res = c > '\r';// 84 + res = c > ' ';// 85 + res = c > 'a';// 86 + res = c > 'Z';// 87 + res = c > 127;// 88 + res = c > 255;// 89 + return res;// 90 } } @@ -241,9 +247,27 @@ class 'pkg/TestPrimitives' { 3b 78 43 78 45 79 - 48 79 - 50 79 - 52 80 + 47 79 + 4f 79 + 51 80 + 53 80 + 5b 80 + 5d 81 + 5f 81 + 67 81 + 69 82 + 6b 82 + 73 82 + 75 83 + 77 83 + 7f 83 + 81 84 + 83 84 + 8b 84 + 8d 85 + 90 85 + 98 85 + 9a 86 } } @@ -291,3 +315,9 @@ Lines mapping: 82 <-> 79 83 <-> 80 84 <-> 81 +85 <-> 82 +86 <-> 83 +87 <-> 84 +88 <-> 85 +89 <-> 86 +90 <-> 87 diff --git a/testData/src/pkg/TestPrimitives.java b/testData/src/pkg/TestPrimitives.java index b4aa878..39041ef 100644 --- a/testData/src/pkg/TestPrimitives.java +++ b/testData/src/pkg/TestPrimitives.java @@ -77,6 +77,12 @@ public class TestPrimitives { boolean res = (c > -1); res = (c > 0); res = (c > 1); + res = (c > '\b'); + res = (c > '\t'); + res = (c > '\n'); + res = (c > '\f'); + res = (c > '\r'); + res = (c > ' '); res = (c > 'a'); res = (c > 'Z'); res = (c > 127);