if (exp instanceof IntLiteral) {
IntLiteral intLiteral = (IntLiteral) exp;
IntLiteral convertToMinValue = intLiteral.convertToMinValue();
if (convertToMinValue == intLiteral) {
// not a min value literal so we convert it to an unary expression
r = new UnaryExpression(exp, op);
} else {
r = convertToMinValue;
}
} else if (exp instanceof LongLiteral) {
LongLiteral longLiteral = (LongLiteral) exp;
LongLiteral convertToMinValue = longLiteral.convertToMinValue();
if (convertToMinValue == longLiteral) {
// not a min value literal so we convert it to an unary expression
r = new UnaryExpression(exp, op);
} else {
r = convertToMinValue;
}
} else {
r = new UnaryExpression(exp, op);
}
} else {
r = new UnaryExpression(exp, op);
}
r.sourceStart = this.intStack[this.intPtr--];
r.sourceEnd = exp.sourceEnd;
this.expressionStack[this.expressionPtr] = r;
}