Buggy code:
public class TernaryOperatorNode extends ValueNode { String operator ; String methodName ; int operatorType ; ValueNode receiver ; ValueNode leftOperand ; ValueNode rightOperand ; String resultInterfaceType ; String receiverInterfaceType ; String leftInterfaceType ; String rightInterfaceType ; int trimType ; public static final int TRIM = 0 ; public static final int LOCATE = 1 ; public static final int SUBSTRING = 2 ; public static final int LIKE = 3 ; public static final int TIMESTAMPADD = 4 ; public static final int TIMESTAMPDIFF = 5 ; static final String [ ] TernaryOperators = new String [ ] { "trim" , "LOCATE" , "substring" , "like" , "TIMESTAMPADD" , "TIMESTAMPDIFF" } ; static final String [ ] TernaryMethodNames = new String [ ] { "trim" , "locate" , "substring" , "like" , "timestampAdd" , "timestampDiff" } ; static final String [ ] TernaryResultType = new String [ ] { ClassName . StringDataValue , ClassName . NumberDataValue , ClassName . ConcatableDataValue , ClassName . BooleanDataValue , ClassName . DateTimeDataValue , ClassName . NumberDataValue } ; static final String [ ] [ ] TernaryArgType = new String [ ] [ ] { new String [ ] { ClassName . StringDataValue , ClassName . StringDataValue , "java.lang.Integer" } , new String [ ] { ClassName . StringDataValue , ClassName . StringDataValue , ClassName . NumberDataValue } , new String [ ] { ClassName . ConcatableDataValue , ClassName . NumberDataValue , ClassName . NumberDataValue } , new String [ ] { ClassName . DataValueDescriptor , ClassName . DataValueDescriptor , ClassName . DataValueDescriptor } , new String [ ] { ClassName . DateTimeDataValue , "java.lang.Integer" , ClassName . NumberDataValue } , new String [ ] { ClassName . DateTimeDataValue , "java.lang.Integer" , ClassName . DateTimeDataValue } } ; public void init ( Object receiver , Object leftOperand , Object rightOperand , Object operatorType , Object trimType ) { } public String toString ( ) { } public void printSubNodes ( int depth ) { } public ValueNode bindExpression ( FromList fromList , SubqueryList subqueryList , Vector aggregateVector ) throws StandardException { } public ValueNode preprocess ( int numTables , FromList outerFromList , SubqueryList outerSubqueryList , PredicateList outerPredicateList ) throws StandardException { } public void generateExpression ( ExpressionClassBuilder acb , MethodBuilder mb ) throws StandardException { } public void setLeftOperand ( ValueNode newLeftOperand ) { } public ValueNode getLeftOperand ( ) { } public void setRightOperand ( ValueNode newRightOperand ) { } public ValueNode getRightOperand ( ) { } public boolean categorize ( JBitSet referencedTabs , boolean simplePredsOnly ) throws StandardException { } public ValueNode remapColumnReferencesToExpressions ( ) throws StandardException { } public boolean isConstantExpression ( ) { } public boolean constantExpression ( PredicateList whereClause ) { } public Visitable accept ( Visitor v ) throws StandardException { } private ValueNode trimBind ( ) throws StandardException { } private void setResultType ( TypeId resultType ) throws StandardException { } public ValueNode locateBind ( ) throws StandardException { } protected ValueNode castArgToString ( ValueNode vn ) throws StandardException { } public ValueNode substrBind ( ) throws StandardException { } private ValueNode timestampAddBind ( ) throws StandardException { } private ValueNode timestampDiffBind ( ) throws StandardException { bindDateTimeArg ( rightOperand , 2 ) ; bindDateTimeArg ( receiver , 3 ) ; <START_BUG> setType ( DataTypeDescriptor . getBuiltInDataTypeDescriptor ( Types . INTEGER ) ) ; <END_BUG> return this ; } private void bindDateTimeArg ( ValueNode arg , int argNumber ) throws StandardException { } private boolean bindParameter ( ValueNode arg , int jdbcType ) throws StandardException { } public ValueNode getReceiver ( ) { } private void throwBadType ( String funcName , String type ) throws StandardException { } protected void bindToBuiltIn ( ) throws StandardException { } private DataTypeDescriptor getVarcharDescriptor ( ) { } protected boolean isEquivalent ( ValueNode o ) throws StandardException { } }

Fix:
setType ( DataTypeDescriptor . getBuiltInDataTypeDescriptor ( Types . BIGINT ) ) ;