Buggy code:
public class closed implements Runnable { private static boolean jsr169_test = false ; public static void main ( String [ ] args ) { } static boolean shutdownTest ( String databaseName , String shutdownString ) throws SQLException { boolean passed = true ; Connection c1 = TestUtil . getConnection ( "wombat" , null ) ; Connection c2 = TestUtil . getConnection ( "wombat" , null ) ; Connection c3a = TestUtil . getConnection ( "wombat" , null ) ; Connection c3b = TestUtil . getConnection ( "wombat" , null ) ; try { c3a . createStatement ( ) . execute ( "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>CLOSED.LOCKME" ) ; } catch ( SQLException sqle ) { } try { c3a . createStatement ( ) . execute ( "DROP<seq2seq4repair_space>PROCEDURE<seq2seq4repair_space>SLEEP" ) ; } catch ( SQLException sqle ) { } c3a . createStatement ( ) . execute ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>CLOSED.LOCKME(i<seq2seq4repair_space>int)" ) ; <START_BUG> c3a . createStatement ( ) . execute ( "create<seq2seq4repair_space>procedure<seq2seq4repair_space>sleep(t<seq2seq4repair_space>INTEGER)<seq2seq4repair_space>dynamic<seq2seq4repair_space>result<seq2seq4repair_space>sets<seq2seq4repair_space>0<seq2seq4repair_space>language<seq2seq4repair_space>java<seq2seq4repair_space>external<seq2seq4repair_space>name<seq2seq4repair_space>'java.lang.Thread.sleep'<seq2seq4repair_space>parameter<seq2seq4repair_space>style<seq2seq4repair_space>java" ) ; <END_BUG> c3a . setAutoCommit ( false ) ; c3a . createStatement ( ) . execute ( "LOCK<seq2seq4repair_space>TABLE<seq2seq4repair_space>CLOSED.LOCKME<seq2seq4repair_space>IN<seq2seq4repair_space>SHARE<seq2seq4repair_space>MODE" ) ; closed r2 = new closed ( c2 , "CALL<seq2seq4repair_space>sleep(10000)" ) ; closed r3 = new closed ( c3b , "LOCK<seq2seq4repair_space>TABLE<seq2seq4repair_space>CLOSED.LOCKME<seq2seq4repair_space>IN<seq2seq4repair_space>EXCLUSIVE<seq2seq4repair_space>MODE" ) ; Thread t2 = new Thread ( r2 ) ; t2 . start ( ) ; Thread t3 = new Thread ( r3 ) ; t3 . start ( ) ; try { Thread . currentThread ( ) . sleep ( 2000 ) ; } catch ( InterruptedException ie ) { System . out . println ( ie ) ; } SQLException s = null ; try { TestUtil . getConnection ( databaseName , shutdownString ) ; } catch ( SQLException sqle ) { s = sqle ; } try { t2 . join ( ) ; } catch ( InterruptedException ie ) { System . out . println ( ie ) ; } try { t3 . join ( ) ; } catch ( InterruptedException ie ) { System . out . println ( ie ) ; } System . out . println ( r2 . result ) ; System . out . println ( r3 . result ) ; if ( s != null ) JDBCDisplayUtil . ShowException ( System . out , s ) ; if ( ! ( c1 . isClosed ( ) ) ) { passed = false ; System . out . println ( ( ( ( "FAIL<seq2seq4repair_space>--<seq2seq4repair_space>connection<seq2seq4repair_space>not<seq2seq4repair_space>shutdown<seq2seq4repair_space>" + databaseName ) + ";" ) + shutdownString ) ) ; c1 . close ( ) ; } if ( ! ( c2 . isClosed ( ) ) ) { passed = false ; System . out . println ( ( ( ( "FAIL<seq2seq4repair_space>--<seq2seq4repair_space>active<seq2seq4repair_space>connection<seq2seq4repair_space>not<seq2seq4repair_space>shutdown<seq2seq4repair_space>" + databaseName ) + ";" ) + shutdownString ) ) ; c2 . close ( ) ; } System . out . println ( "Shutdown<seq2seq4repair_space>test<seq2seq4repair_space>completed." ) ; return passed ; } private Connection cc ; private String sql ; String result ; private closed ( Connection cc , String sql ) { } public void run ( ) { } static boolean testStatement ( Connection conn ) throws SQLException { } static boolean testPreparedStatement ( Connection conn ) throws SQLException { } static boolean testResultSet ( Connection conn ) throws SQLException { } static boolean testConnection ( Connection conn ) throws SQLException { } static boolean testDerby62 ( Connection conn ) throws SQLException { } }

Fix:
c3a . createStatement ( ) . execute ( "create<seq2seq4repair_space>procedure<seq2seq4repair_space>sleep(t<seq2seq4repair_space>BIGINT)<seq2seq4repair_space>dynamic<seq2seq4repair_space>result<seq2seq4repair_space>sets<seq2seq4repair_space>0<seq2seq4repair_space>language<seq2seq4repair_space>java<seq2seq4repair_space>external<seq2seq4repair_space>name<seq2seq4repair_space>'java.lang.Thread.sleep'<seq2seq4repair_space>parameter<seq2seq4repair_space>style<seq2seq4repair_space>java" ) ;