Buggy code:
public class SetFunction implements Serializable { private HashSet distinctValues ; private boolean isDistinct ; private int setType ; private int typeCode ; private Type type ; private ArrayType arrayType ; private Type returnType ; private long count ; private boolean hasNull ; private boolean every = true ; private boolean some = false ; private long currentLong ; private double currentDouble ; private BigDecimal currentBigDecimal ; private Object currentValue ; SetFunction ( Session session , int setType , Type type , Type returnType , boolean isDistinct , ArrayType arrayType ) { } void add ( Session session , Object item ) { } Object getValue ( Session session ) { } static Type getType ( Session session , int setType , Type type ) { if ( setType == ( OpTypes . COUNT ) ) { return Type . SQL_BIGINT ; } if ( type == null ) { throw Error . error ( U_S0500 ) ; } int typeCode = ( type . isIntervalType ( ) ) ? Types . SQL_INTERVAL : type . typeCode ; switch ( setType ) { case OpTypes . AVG : case OpTypes . MEDIAN : { switch ( typeCode ) { case Types . TINYINT : case Types . SQL_SMALLINT : case Types . SQL_INTEGER : case Types . SQL_BIGINT : case Types . SQL_NUMERIC : case Types . SQL_DECIMAL : int scale = session . database . sqlAvgScale ; if ( scale <= ( type . scale ) ) { return type ; } int digits = ( ( NumberType ) ( type ) ) . getDecimalPrecision ( ) ; return NumberType . getNumberType ( SQL_DECIMAL , ( digits + scale ) , scale ) ; case Types . SQL_REAL : case Types . SQL_FLOAT : case Types . SQL_DOUBLE : case Types . SQL_INTERVAL : case Types . SQL_DATE : case Types . SQL_TIMESTAMP : case Types . SQL_TIMESTAMP_WITH_TIME_ZONE : return type ; default : throw Error . error ( X_42563 ) ; } } case OpTypes . SUM : { switch ( typeCode ) { case Types . TINYINT : case Types . SQL_SMALLINT : case Types . SQL_INTEGER : return Type . SQL_BIGINT ; case Types . SQL_BIGINT : return Type . SQL_DECIMAL_BIGINT_SQR ; case Types . SQL_REAL : case Types . SQL_FLOAT : case Types . SQL_DOUBLE : return Type . SQL_DOUBLE ; case Types . SQL_NUMERIC : case Types . SQL_DECIMAL : return Type . getType ( type . typeCode , null , null , ( ( type . precision ) * 2 ) , type . scale ) ; case Types . SQL_INTERVAL : return IntervalType . newIntervalType ( type . typeCode , maxIntervalPrecision , type . scale ) ; default : throw Error . error ( X_42563 ) ; } } case OpTypes . MIN : case OpTypes . MAX : if ( ( type . isArrayType ( ) ) || ( type . isLobType ( ) ) ) { throw Error . error ( X_42563 ) ; } return type ; case OpTypes . EVERY : case OpTypes . SOME : if ( type . isBooleanType ( ) ) { return Type . SQL_BOOLEAN ; } break ; case OpTypes . STDDEV_POP : case OpTypes . STDDEV_SAMP : case OpTypes . VAR_POP : case OpTypes . VAR_SAMP : if ( type . isNumberType ( ) ) { return Type . SQL_DOUBLE ; } break ; case OpTypes . USER_AGGREGATE : return type ; case OpTypes . APPROX_COUNT_DISTINCT : switch ( typeCode ) { case Types . TINYINT : case Types . SQL_SMALLINT : case Types . SQL_INTEGER : case Types . SQL_BIGINT : case Types . SQL_DECIMAL : case Types . SQL_TIMESTAMP : return Type . SQL_BIGINT ; default : <START_BUG> throw Error . error ( X_42565 ) ; <END_BUG> } default : throw Error . runtimeError ( U_S0500 , "SetFunction" ) ; } throw Error . error ( X_42563 ) ; } static final BigInteger multiplier = BigInteger . valueOf ( 4294967296L ) ; long hi ; long lo ; void addLong ( long value ) { } BigInteger getLongSum ( ) { } private double sk ; private double vk ; private long n ; private boolean initialized ; private boolean sample ; private void addDataPoint ( Number x ) { } private Number getVariance ( ) { } private Number getStdDev ( ) { } }

Fix:
throw Error . error ( X_42561 ) ;