From a94daf713edea58cb249b184a55c116ee3ce54b4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 14 Oct 2017 22:25:20 +0200 Subject: [PATCH 1/5] IDEA-127533 int field is displayed as char --- .../java/decompiler/main/ClassWriter.java | 5 + .../modules/decompiler/ExprProcessor.java | 18 +- .../decompiler/exps/AssignmentExprent.java | 6 +- .../modules/decompiler/exps/ConstExprent.java | 15 + .../decompiler/exps/FunctionExprent.java | 13 + testData/classes/pkg/TestConstType.class | Bin 0 -> 2120 bytes testData/results/TestClassLoop.dec | 4 +- testData/results/TestConstType.dec | 337 ++++++++++++++++++ testData/src/pkg/TestConstType.java | 106 ++++++ 9 files changed, 493 insertions(+), 11 deletions(-) create mode 100644 testData/classes/pkg/TestConstType.class create mode 100644 testData/results/TestConstType.dec create mode 100644 testData/src/pkg/TestConstType.java diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index afa2473..585ff5a 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -459,6 +459,11 @@ public class ClassWriter { } else { buffer.append(" = "); + + if (initializer.type == Exprent.EXPRENT_CONST) { + ((ConstExprent) initializer).adjustConstType(fieldType); + } + // FIXME: special case field initializer. Can map to more than one method (constructor) and bytecode intruction. buffer.append(initializer.toJava(indent, tracer)); } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java index 9296bb3..9b48600 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java @@ -896,23 +896,25 @@ public class ExprProcessor implements CodeConstants { VarType rightType = exprent.getExprType(); - TextBuffer res = exprent.toJava(indent, tracer); - boolean cast = 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)); + + boolean quote = cast && exprent.getPrecedence() >= FunctionExprent.getPrecedence(FunctionExprent.FUNCTION_CAST); - if (cast) { - if (exprent.getPrecedence() >= FunctionExprent.getPrecedence(FunctionExprent.FUNCTION_CAST)) { - res.enclose("(", ")"); - } + if (cast) buffer.append('(').append(getCastTypeName(leftType)).append(')'); - res.prepend("(" + getCastTypeName(leftType) + ")"); + if (quote) buffer.append('('); + + if (exprent.type == Exprent.EXPRENT_CONST) { + ((ConstExprent) exprent).adjustConstType(leftType); } - buffer.append(res); + buffer.append(exprent.toJava(indent, tracer)); + + if (quote) buffer.append(')'); return cast; } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java index 95ebdc5..ef08e12 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,6 +138,10 @@ public class AssignmentExprent extends Exprent { buffer.append(left.toJava(indent, tracer)); } + if (right.type == EXPRENT_CONST) { + ((ConstExprent) right).adjustConstType(leftType); + } + TextBuffer res = right.toJava(indent, tracer); if (condType == CONDITION_NONE && 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 4b9b687..179b2ba 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java @@ -389,6 +389,21 @@ public class ConstExprent extends Exprent { this.constType = constType; } + public void adjustConstType(VarType expectedType) { + // 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 (getIntValue() != 0) { + setConstType(VarType.VARTYPE_CHAR); + } + } + // CHAR => INT in the INT context + else if (expectedType.equals(VarType.VARTYPE_INT) && + constType.equals(VarType.VARTYPE_CHAR)) { + setConstType(VarType.VARTYPE_INT); + } + } + public Object getValue() { return value; } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java index 48206a7..7eb7405 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java @@ -459,7 +459,20 @@ public class FunctionExprent extends Exprent { .append(wrapOperandString(lstOperands.get(1), true, indent, tracer)); } + // try to determine more accurate type for 'char' literals if (funcType >= FUNCTION_EQ) { + if (funcType <= FUNCTION_LE) { + Exprent left = lstOperands.get(0); + Exprent right = lstOperands.get(1); + + if (right.type == EXPRENT_CONST) { + ((ConstExprent) right).adjustConstType(left.getExprType()); + } + else if (left.type == EXPRENT_CONST) { + ((ConstExprent) left).adjustConstType(right.getExprType()); + } + } + return wrapOperandString(lstOperands.get(0), false, indent, tracer) .append(OPERATORS[funcType - FUNCTION_EQ + 11]) .append(wrapOperandString(lstOperands.get(1), true, indent, tracer)); diff --git a/testData/classes/pkg/TestConstType.class b/testData/classes/pkg/TestConstType.class new file mode 100644 index 0000000000000000000000000000000000000000..57d4fec11e4920937a29e6a9143552ed071e4635 GIT binary patch literal 2120 zcmZuyO-vkR7=DIjciCm2vrD0+P(j3&p9*McZTV?|1=S4@8Q<~ z+VN@-^@s%U9Qp+Yf`q{!F5$93G=Nty6vQw_1g?01J6{mK8}mT>1ML02DbOnr7q}&` zBXCdPGl8!>Fd&=15ynYYrD=6r%P;o(%w zOiY>SxQx|gp}iE(Xeb+AU0!URv@&)imCV?ao2yo*20dfha*eWC*bor|1t}gVnXt{+ z@`$;*e~ZLLt5)Edv0yPC#Rtz)7i@3zbprnt;;;qhr&a>PzBcOvf;p5?1i&zGiv57lsb z6ol-DCL$4=IO^lNMmCy0ht^~SAE2Pg^8lXv&WUDXsgyQbA)g?;IK`3fp1})f;Ybse z)qQU{7J*Y$_qYPbMge(^t%~h7TYZyJLOXX6a1Dwr55!gl?+1!dO-pqsrst)c4>>j~ zcr))+Hl_C>Nop4Zbv0`0uiQ-blhZGx%LyE(S z%M>40T&}o6@e##G6;~=grnpLRwc_K7pCKP)VI9XQQw?)n%kOO+j<8;9Sg|LW^ET%7 zJbS&Y(6C$f%lpE5BZDuh}pYOvA?9;-%{fr zc+*elz|ZK!FX+n4_@i9L&vV^<8y+$flJRj*)eiJ3V`~RKV$BO=Hu5JXvf&!%K)6=cBUvMw%~eYa%Nn>y>|t^D;TR&6Vu0ZdGOWvVG0N2;KKzAY zG_RV*bJaA?V7gQ_`Qa@sHH=aYyK%vdLn|iBTRW@X!U^`}&FW+8V2iMgu*v)&+YH-j zwpq3whSz-;HO3aPGF(F}W27WKTubzY>$ 8 +10 <-> 10 +11 <-> 11 +14 <-> 13 +17 <-> 16 +20 <-> 19 +21 <-> 20 +24 <-> 23 +25 <-> 24 +27 <-> 27 +31 <-> 31 +32 <-> 32 +34 <-> 33 +35 <-> 34 +36 <-> 35 +37 <-> 36 +38 <-> 37 +39 <-> 38 +40 <-> 39 +41 <-> 40 +42 <-> 41 +43 <-> 42 +44 <-> 43 +45 <-> 44 +46 <-> 45 +47 <-> 46 +48 <-> 47 +49 <-> 48 +50 <-> 49 +51 <-> 50 +52 <-> 51 +53 <-> 52 +54 <-> 53 +55 <-> 54 +56 <-> 55 +57 <-> 56 +58 <-> 57 +59 <-> 58 +60 <-> 59 +63 <-> 62 +64 <-> 63 +66 <-> 64 +67 <-> 65 +69 <-> 66 +70 <-> 67 +72 <-> 68 +73 <-> 69 +75 <-> 71 +76 <-> 71 +79 <-> 71 +85 <-> 77 +87 <-> 88 +88 <-> 89 +90 <-> 79 +91 <-> 80 +93 <-> 91 +94 <-> 92 +96 <-> 85 +97 <-> 86 +99 <-> 82 +100 <-> 83 +102 <-> 94 +104 <-> 97 diff --git a/testData/src/pkg/TestConstType.java b/testData/src/pkg/TestConstType.java new file mode 100644 index 0000000..d4c0192 --- /dev/null +++ b/testData/src/pkg/TestConstType.java @@ -0,0 +1,106 @@ +package pkg; + +public class TestConstType { + private char lineBreak = '\n'; + private char zero = 0; + + public void setLineBreak(char os) { + switch (os) { + case 'u': + lineBreak = '\r'; + break; + + case 'w': + lineBreak = '\n'; + break; + } + } + + public void init() { + setLineBreak('w'); + } + + public String convertIndentation(String text) { + if (text.charAt(0) == '\t') { + text = text.replace('\t', ' '); + } + return text; + } + + public void printalot() { + System.out.println('a'); + System.out.println('\t'); + + System.out.println(0); + System.out.println(65); + System.out.println(120); + System.out.println(32760); + System.out.println(32761); + System.out.println(35000); + System.out.println(50000); + System.out.println(128000); + System.out.println(60793); + System.out.println(60737); + System.out.println(60777); + System.out.println(60785); + System.out.println(60835); + System.out.println(60843); + System.out.println(60851); + System.out.println(60859); + System.out.println(1048576); + System.out.println(49152); + System.out.println(44100); + System.out.println(44101); + System.out.println(44102); + System.out.println(44103); + System.out.println(60000); + System.out.println(64000); + System.out.println(65000); + System.out.println(45000); + } + + public char guessType(int val) { + if (0 <= val && val <= 127) { + return 'X'; + } + else if (-128 <= val && val <= 127) { + return 'B'; + } + else if (128 <= val && val <= 32767) { + return 'Y'; + } + else if (-32768 <= val && val <= 32767) { + return 'S'; + } + else if (32768 <= val && val <= 0xFFFF) { + return 'C'; + } + else { + return 'I'; + } + } + + public int getTypeMaxValue(char type) { + int maxValue; + switch (type) { + case 'X': + maxValue = 128; + break; + case 'B': + maxValue = 127; + break; + case 'Y': + maxValue = 32768; + break; + case 'S': + maxValue = 32767; + break; + case 'C': + maxValue = 0xFFFF; + break; + default: + maxValue = Integer.MAX_VALUE; + } + return maxValue; + } +} From e6b0c488667ca9fe3ee63330d389c55b1282178a Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 14 Oct 2017 22:36:03 +0200 Subject: [PATCH 2/5] IDEA-127533 int field is displayed as char - show only reasonable ascii as chars --- build.xml | 4 +- .../modules/decompiler/exps/ConstExprent.java | 20 ++++--- .../java/decompiler/util/TextUtil.java | 59 ++++++++++++++++++- 3 files changed, 72 insertions(+), 11 deletions(-) diff --git a/build.xml b/build.xml index 9f4c208..33000ff 100644 --- a/build.xml +++ b/build.xml @@ -26,7 +26,7 @@ - + @@ -39,7 +39,7 @@ - + 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 179b2ba..2a91a65 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java @@ -28,12 +28,13 @@ import org.jetbrains.java.decompiler.struct.match.MatchNode; import org.jetbrains.java.decompiler.struct.match.IMatchable.MatchProperties; import org.jetbrains.java.decompiler.struct.match.MatchNode.RuleValue; import org.jetbrains.java.decompiler.util.InterpreterUtil; +import org.jetbrains.java.decompiler.util.TextUtil; import java.util.*; import java.util.Map.Entry; public class ConstExprent extends Exprent { - private static final Map ESCAPES = new HashMap() {{ + private static final Map CHAR_ESCAPES = new HashMap() {{ put(new Integer(0x8), "\\b"); /* \u0008: backspace BS */ put(new Integer(0x9), "\\t"); /* \u0009: horizontal tab HT */ put(new Integer(0xA), "\\n"); /* \u000a: linefeed LF */ @@ -127,17 +128,17 @@ public class ConstExprent extends Exprent { return new TextBuffer(Boolean.toString(((Integer)value).intValue() != 0)); case CodeConstants.TYPE_CHAR: Integer val = (Integer)value; - String ret = ESCAPES.get(val); + String ret = CHAR_ESCAPES.get(val); if (ret == null) { char c = (char)val.intValue(); - if (c >= 32 && c < 127 || !ascii && InterpreterUtil.isPrintableUnicode(c)) { + if (isPrintableAscii(c) || !ascii && TextUtil.isPrintableUnicode(c)) { ret = String.valueOf(c); } else { - ret = InterpreterUtil.charToUnicodeLiteral(c); + ret = TextUtil.charToUnicodeLiteral(c); } } - return new TextBuffer(ret).enclose("\'", "\'"); + return new TextBuffer(ret).enclose("'", "'"); case CodeConstants.TYPE_BYTE: case CodeConstants.TYPE_BYTECHAR: case CodeConstants.TYPE_SHORT: @@ -306,7 +307,7 @@ public class ConstExprent extends Exprent { buffer.append("\\\'"); break; default: - if (c >= 32 && c < 127 || !ascii && InterpreterUtil.isPrintableUnicode(c)) { + if (c >= 32 && c < 127 || !ascii && TextUtil.isPrintableUnicode(c)) { buffer.append(c); } else { @@ -393,7 +394,7 @@ 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 (getIntValue() != 0) { + if (isPrintableAscii(getIntValue())) { setConstType(VarType.VARTYPE_CHAR); } } @@ -404,6 +405,11 @@ public class ConstExprent extends Exprent { } } + private static boolean isPrintableAscii(int c) { + return c >= 32 && c < 127; + } + + public Object getValue() { return value; } diff --git a/src/org/jetbrains/java/decompiler/util/TextUtil.java b/src/org/jetbrains/java/decompiler/util/TextUtil.java index 14e24f9..21f10e4 100644 --- a/src/org/jetbrains/java/decompiler/util/TextUtil.java +++ b/src/org/jetbrains/java/decompiler/util/TextUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,23 @@ */ package org.jetbrains.java.decompiler.util; +import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.main.ClassesProcessor; import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.TextBuffer; +import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; +import java.util.Arrays; +import java.util.HashSet; + public class TextUtil { + private static final HashSet KEYWORDS = new HashSet<>(Arrays.asList( + "abstract", "default", "if", "private", "this", "boolean", "do", "implements", "protected", "throw", "break", "double", "import", + "public", "throws", "byte", "else", "instanceof", "return", "transient", "case", "extends", "int", "short", "try", "catch", "final", + "interface", "static", "void", "char", "finally", "long", "strictfp", "volatile", "class", "float", "native", "super", "while", + "const", "for", "new", "switch", "continue", "goto", "package", "synchronized", "true", "false", "null", "assert")); + public static void writeQualifiedSuper(TextBuffer buf, String qualifier) { ClassesProcessor.ClassNode classNode = (ClassesProcessor.ClassNode)DecompilerContext.getProperty(DecompilerContext.CURRENT_CLASS_NODE); if (!qualifier.equals(classNode.classStruct.qualifiedName)) { @@ -28,4 +39,48 @@ public class TextUtil { } buf.append("super"); } -} + + public static String getIndentString(int length) { + if (length == 0) return ""; + StringBuilder buf = new StringBuilder(); + String indent = (String)DecompilerContext.getProperty(IFernflowerPreferences.INDENT_STRING); + while (length-- > 0) { + buf.append(indent); + } + return buf.toString(); + } + + public static boolean isPrintableUnicode(char c) { + int t = Character.getType(c); + return t != Character.UNASSIGNED && t != Character.LINE_SEPARATOR && t != Character.PARAGRAPH_SEPARATOR && + t != Character.CONTROL && t != Character.FORMAT && t != Character.PRIVATE_USE && t != Character.SURROGATE; + } + + public static String charToUnicodeLiteral(int value) { + String sTemp = Integer.toHexString(value); + sTemp = ("0000" + sTemp).substring(sTemp.length()); + return "\\u" + sTemp; + } + + public static boolean isValidIdentifier(String id, int version) { + return isJavaIdentifier(id) && !isKeyword(id, version); + } + + private static boolean isJavaIdentifier(String id) { + if (id.isEmpty() || !Character.isJavaIdentifierStart(id.charAt(0))) { + return false; + } + + for (int i = 1; i < id.length(); i++) { + if (!Character.isJavaIdentifierPart(id.charAt(i))) { + return false; + } + } + + return true; + } + + private static boolean isKeyword(String id, int version) { + return KEYWORDS.contains(id) || version > CodeConstants.BYTECODE_JAVA_5 && "enum".equals(id); + } +} \ No newline at end of file From 7dc01f9a556f8575a974b6e6be82cfff2ef38f20 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 14 Oct 2017 22:37:03 +0200 Subject: [PATCH 3/5] IDEA-127533 int field is displayed as char - show \n etc as chars --- .../java/decompiler/modules/decompiler/exps/ConstExprent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2a91a65..31fe3cd 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java @@ -394,7 +394,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); } } From c7bfae7450842199b6957117b37b88f01e7f8b4f Mon Sep 17 00:00:00 2001 From: UniquePassive Date: Sun, 15 Oct 2017 01:50:14 +0200 Subject: [PATCH 4/5] Output ints rather than chars for numbers in additions/substractions too --- .../modules/decompiler/exps/FunctionExprent.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java index 7eb7405..7ee6cfb 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java @@ -454,9 +454,19 @@ public class FunctionExprent extends Exprent { tracer.addMapping(bytecode); if (funcType <= FUNCTION_USHR) { - return wrapOperandString(lstOperands.get(0), false, indent, tracer) + Exprent left = lstOperands.get(0); + Exprent right = lstOperands.get(1); + + if (right.type == EXPRENT_CONST) { + ((ConstExprent) right).adjustConstType(left.getExprType()); + } + else if (left.type == EXPRENT_CONST) { + ((ConstExprent) left).adjustConstType(right.getExprType()); + } + + return wrapOperandString(left, false, indent, tracer) .append(OPERATORS[funcType]) - .append(wrapOperandString(lstOperands.get(1), true, indent, tracer)); + .append(wrapOperandString(right, true, indent, tracer)); } // try to determine more accurate type for 'char' literals From bb2efb2f162701ac24f3534a43d53b560f3f8c7a Mon Sep 17 00:00:00 2001 From: UniquePassive Date: Tue, 17 Oct 2017 17:48:16 +0200 Subject: [PATCH 5/5] Output ints rather than chars for numbers in ternary operators --- .../decompiler/exps/FunctionExprent.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java index 7ee6cfb..b8f212d 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java @@ -507,11 +507,21 @@ public class FunctionExprent extends Exprent { } return res.append(".length"); case FUNCTION_IIF: + Exprent left = lstOperands.get(1); + Exprent right = lstOperands.get(2); + + if (right.type == EXPRENT_CONST) { + ((ConstExprent) right).adjustConstType(left.getExprType()); + } + else if (left.type == EXPRENT_CONST) { + ((ConstExprent) left).adjustConstType(right.getExprType()); + } + return wrapOperandString(lstOperands.get(0), true, indent, tracer) - .append("?") - .append(wrapOperandString(lstOperands.get(1), true, indent, tracer)) - .append(":") - .append(wrapOperandString(lstOperands.get(2), true, indent, tracer)); + .append("?") + .append(wrapOperandString(left, true, indent, tracer)) + .append(":") + .append(wrapOperandString(right, true, indent, tracer)); case FUNCTION_IPP: return wrapOperandString(lstOperands.get(0), true, indent, tracer).append("++"); case FUNCTION_PPI: