Buggy code:
ps . setString ( 1 , null ) ; ps . setString ( 2 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "s1NULLs1NULLCONI" ) ; ps . close ( ) ; s . executeUpdate ( ( ( ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>SAME_NOCALL(INTEGER)<seq2seq4repair_space>" + ( ( "RETURNS<seq2seq4repair_space>INTEGER<seq2seq4repair_space>" + "RETURNS<seq2seq4repair_space>NULL<seq2seq4repair_space>ON<seq2seq4repair_space>NULL<seq2seq4repair_space>INPUT<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'" ) ) + ( RoutineTest . class . getName ( ) ) ) + ".same'<seq2seq4repair_space>" ) + "LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ; s . executeUpdate ( ( ( ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>SAME_CALL(INTEGER)<seq2seq4repair_space>" + ( ( "RETURNS<seq2seq4repair_space>INTEGER<seq2seq4repair_space>" + "CALLED<seq2seq4repair_space>ON<seq2seq4repair_space>NULL<seq2seq4repair_space>INPUT<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'" ) ) + ( RoutineTest . class . getName ( ) ) ) + ".same'<seq2seq4repair_space>" ) + "LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>SAME_NOCALL(SAME_NOCALL(?))" ) ; ps . setInt ( 1 , 41 ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "41" ) ; ps . setNull ( 1 , Types . INTEGER ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>SAME_NOCALL(SAME_CALL(?))" ) ; ps . setInt ( 1 , 47 ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "47" ) ; ps . setNull ( 1 , Types . INTEGER ) ; assertStatementError ( "39004" , ps ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>SAME_CALL(SAME_NOCALL(?))" ) ; ps . setInt ( 1 , 41 ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "41" ) ; ps . setNull ( 1 , Types . INTEGER ) ; assertStatementError ( "39004" , ps ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>SAME_CALL(SAME_CALL(?))" ) ; ps . setInt ( 1 , 53 ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "53" ) ; ps . setNull ( 1 , Types . INTEGER ) ; assertStatementError ( "39004" , ps ) ; ps . close ( ) ; s . executeUpdate ( ( ( ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>NOON_NOCALL(TIME)<seq2seq4repair_space>" + ( ( "RETURNS<seq2seq4repair_space>TIME<seq2seq4repair_space>" + "RETURNS<seq2seq4repair_space>NULL<seq2seq4repair_space>ON<seq2seq4repair_space>NULL<seq2seq4repair_space>INPUT<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'" ) ) + ( RoutineTest . class . getName ( ) ) ) + ".nullAtNoon'<seq2seq4repair_space>" ) + "LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ; s . executeUpdate ( ( ( ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>NOON_CALL(TIME)<seq2seq4repair_space>" + ( ( "RETURNS<seq2seq4repair_space>TIME<seq2seq4repair_space>" + "CALLED<seq2seq4repair_space>ON<seq2seq4repair_space>NULL<seq2seq4repair_space>INPUT<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'" ) ) + ( RoutineTest . class . getName ( ) ) ) + ".nullAtNoon'<seq2seq4repair_space>" ) + "LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ; Time noon = Time . valueOf ( "12:00:00" ) ; Time tea = Time . valueOf ( "15:30:00" ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>NOON_NOCALL(?)" ) ; ps . setTime ( 1 , tea ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , tea . toString ( ) ) ; ps . setTime ( 1 , noon ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ; ps . setTime ( 1 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>NOON_CALL(?)" ) ; ps . setTime ( 1 , tea ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , tea . toString ( ) ) ; ps . setTime ( 1 , noon ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ; ps . setTime ( 1 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:00:00" ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>NOON_NOCALL(NOON_NOCALL(?))" ) ; ps . setTime ( 1 , tea ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , tea . toString ( ) ) ; ps . setTime ( 1 , noon ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ; ps . setTime ( 1 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>NOON_NOCALL(NOON_CALL(?))" ) ; ps . setTime ( 1 , tea ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , tea . toString ( ) ) ; ps . setTime ( 1 , noon ) ; <START_BUG> JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:00:00" ) ; <END_BUG> ps . setTime ( 1 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:30:00" ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>NOON_CALL(NOON_NOCALL(?))" ) ; ps . setTime ( 1 , tea ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , tea . toString ( ) ) ; ps . setTime ( 1 , noon ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:00:00" ) ; ps . setTime ( 1 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:00:00" ) ; ps . close ( ) ; ps = prepareStatement ( "VALUES<seq2seq4repair_space>NOON_CALL(NOON_CALL(?))" ) ; ps . setTime ( 1 , tea ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , tea . toString ( ) ) ; ps . setTime ( 1 , noon ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:00:00" ) ; ps . setTime ( 1 , null ) ; JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , "11:30:00" ) ; ps . close ( ) ; s . close ( ) ; } public void testAggregateArgument ( ) throws SQLException { } public static String concat ( String s1 , String s2 ) { } public static int same ( int i ) { } public static Time nullAtNoon ( Time t ) { } public static int checkCount ( int count ) throws SQLException { } }

Fix:
JDBC . assertSingleValueResultSet ( ps . executeQuery ( ) , null ) ;