Buggy code:
public class TriggerTest extends BaseJDBCTestCase { private static ThreadLocal TRIGGER_INFO = new ThreadLocal ( ) ; public TriggerTest ( String name ) { } public static Test suite ( ) { } protected void initializeConnection ( Connection conn ) throws SQLException { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testFiringOrder ( ) throws SQLException { } private int [ ] createRandomTriggers ( ) throws SQLException { } public void testFiringConstraintOrder ( ) throws SQLException { } private int assertFiringOrder ( String iud , int modifiedRowCount ) { } private int assertFiringOrder ( String iud , int modifiedRowCount , boolean noAfter ) { } public static void logTriggerInfo ( String info ) { } public void testNPEinTriggerFire ( ) throws SQLException { } public void testClobInTriggerTable ( ) throws IOException , SQLException { } private void testClobInTriggerTable ( int clobSize ) throws IOException , SQLException { } private char [ ] makeArray ( int size , char c ) { } private byte [ ] makeArray ( int size , byte b ) { } public void testBlobInTriggerTable ( ) throws IOException , SQLException { } private void testBlobInTriggerTable ( int blobSize ) throws IOException , SQLException { } private void assertInputStreamContents ( InputStream is , int size , byte expectedValue ) throws IOException { } public void testUpdateTriggerOnClobColumn ( ) throws IOException , SQLException { } private void assertReaderContents ( Reader r , int size , char expectedCharValue ) throws IOException { } private CharArrayReader makeCharArrayReader ( char c , int size ) { } public void testTypesInActionStatement ( ) throws IOException , SQLException { } private void actionTypeTest ( String type ) throws IOException , SQLException { } private void actionTypesSetup ( String type ) throws SQLException { } private void actionTypesInsertTest ( String type ) throws IOException , SQLException { } private void actionTypesUpdateTest ( String type ) throws IOException , SQLException { } private void actionTypesCompareMainToActionForUpdate ( String type , int id ) throws IOException , SQLException { } private void actionTypesDeleteTest ( String type ) throws IOException , SQLException { } private void actionTypesCompareMainToAction ( int actionCount , String type ) throws IOException , SQLException { } public static void setRandomValue ( Random r , PreparedStatement ps , int column , int jdbcType , int precision ) throws IOException , SQLException { } public static Object getRandomValue ( Random r , int jdbcType , int precision ) throws IOException { } private static byte [ ] randomBinary ( Random r , int len ) { } private static String randomString ( Random r , int len ) { } public void testDerby4095OldTriggerRows ( ) throws SQLException { Statement s = createStatement ( ) ; s . executeUpdate ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>APP.TAB<seq2seq4repair_space>(I<seq2seq4repair_space>INT)" ) ; s . executeUpdate ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>APP.LOG<seq2seq4repair_space>(I<seq2seq4repair_space>INT,<seq2seq4repair_space>NAME<seq2seq4repair_space>VARCHAR(30),<seq2seq4repair_space>DELTIME<seq2seq4repair_space>TIMESTAMP)" ) ; s . executeUpdate ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>APP.NAMES(ID<seq2seq4repair_space>INT,<seq2seq4repair_space>NAME<seq2seq4repair_space>VARCHAR(30))" ) ; <START_BUG> s . executeUpdate ( "CREATE<seq2seq4repair_space>TRIGGER<seq2seq4repair_space>APP.MYTRIG<seq2seq4repair_space>AFTER<seq2seq4repair_space>DELETE<seq2seq4repair_space>ON<seq2seq4repair_space>APP.TAB<seq2seq4repair_space>REFERENCING<seq2seq4repair_space>OLD_TABLE<seq2seq4repair_space>AS<seq2seq4repair_space>OLDROWS<seq2seq4repair_space>FOR<seq2seq4repair_space>EACH<seq2seq4repair_space>STATEMENT<seq2seq4repair_space>INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>APP.LOG(i,name,deltime)<seq2seq4repair_space>SELECT<seq2seq4repair_space>OLDROWS.I,<seq2seq4repair_space>NAMES.NAME,<seq2seq4repair_space>CURRENT_TIMESTAMP<seq2seq4repair_space>FROM<seq2seq4repair_space>--DERBY-PROPERTIES<seq2seq4repair_space>joinOrder=FIXED\n<seq2seq4repair_space>NAMES,<seq2seq4repair_space>OLDROWS<seq2seq4repair_space>--DERBY-PROEPERTIES<seq2seq4repair_space>joinStrategy<seq2seq4repair_space>=<seq2seq4repair_space>NESTEDLOOP\n<seq2seq4repair_space>WHERE<seq2seq4repair_space>(OLDROWS.i<seq2seq4repair_space>=<seq2seq4repair_space>NAMES.ID)<seq2seq4repair_space>AND<seq2seq4repair_space>(1<seq2seq4repair_space>=<seq2seq4repair_space>1)" ) ; <END_BUG> s . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>APP.tab<seq2seq4repair_space>values(1)" ) ; s . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>APP.tab<seq2seq4repair_space>values(2)" ) ; s . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>APP.tab<seq2seq4repair_space>values(3)" ) ; s . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>APP.names<seq2seq4repair_space>values(1,'Charlie')" ) ; s . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>APP.names<seq2seq4repair_space>values(2,'Hugh')" ) ; s . executeUpdate ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>APP.names<seq2seq4repair_space>values(3,'Alex')" ) ; s . executeUpdate ( "delete<seq2seq4repair_space>from<seq2seq4repair_space>tab<seq2seq4repair_space>where<seq2seq4repair_space>i<seq2seq4repair_space>=<seq2seq4repair_space>1" ) ; ResultSet loggedDeletes = s . executeQuery ( "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>APP.LOG" ) ; JDBC . assertDrainResults ( loggedDeletes , 1 ) ; s . executeUpdate ( "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>APP.TAB" ) ; s . executeUpdate ( "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>APP.LOG" ) ; s . executeUpdate ( "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>APP.NAMES" ) ; } public void testDerby4095NewTriggerRows ( ) throws SQLException { } }

Fix:
s . executeUpdate ( "CREATE<seq2seq4repair_space>TRIGGER<seq2seq4repair_space>APP.MYTRIG<seq2seq4repair_space>AFTER<seq2seq4repair_space>DELETE<seq2seq4repair_space>ON<seq2seq4repair_space>APP.TAB<seq2seq4repair_space>REFERENCING<seq2seq4repair_space>OLD_TABLE<seq2seq4repair_space>AS<seq2seq4repair_space>OLDROWS<seq2seq4repair_space>FOR<seq2seq4repair_space>EACH<seq2seq4repair_space>STATEMENT<seq2seq4repair_space>INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>APP.LOG(i,name,deltime)<seq2seq4repair_space>SELECT<seq2seq4repair_space>OLDROWS.I,<seq2seq4repair_space>NAMES.NAME,<seq2seq4repair_space>CURRENT_TIMESTAMP<seq2seq4repair_space>FROM<seq2seq4repair_space>--DERBY-PROPERTIES<seq2seq4repair_space>joinOrder=FIXED\n<seq2seq4repair_space>NAMES,<seq2seq4repair_space>OLDROWS<seq2seq4repair_space>--DERBY-PROPERTIES<seq2seq4repair_space>joinStrategy<seq2seq4repair_space>=<seq2seq4repair_space>NESTEDLOOP\n<seq2seq4repair_space>WHERE<seq2seq4repair_space>(OLDROWS.i<seq2seq4repair_space>=<seq2seq4repair_space>NAMES.ID)<seq2seq4repair_space>AND<seq2seq4repair_space>(1<seq2seq4repair_space>=<seq2seq4repair_space>1)" ) ;