Buggy code:
public class DatabaseClassLoadingTest extends BaseJDBCTestCase { public DatabaseClassLoadingTest ( String name ) { } public static Test suite ( ) { final TestSuite suite = new TestSuite ( "DatabaseClassLoadingTest" ) ; Test test = suite ; if ( JDBC . vmSupportsJDBC3 ( ) ) { String [ ] orderedTests = new String [ ] { "testJarHandling" , "testWithNoInstalledJars" , "testWithNoClasspath" , "testSetClasspath" , "testAddContact" , "testGetResource" , "testAlterTable" , "testClassPathRollback" , "testReplaceJar" , "testReplacedClass" , "testSecondJar" , "testSignedJar" , "testCreateDatabaseJar" , "testHackedJarReplacedClass" , "testInvalidJar" , "testRemoveJar" , "testLoadJavaClassIndirectly" , "testLoadJavaClassDirectly" , "testLoadJavaClassDirectly2" , "testLoadJavaClassDirectly3" , "testLoadDerbyClassIndirectly" , "testIndirectLoading" , "testTableFunctionInJar" , "test_5352" } ; for ( int i = 0 ; i < ( orderedTests . length ) ; i ++ ) { suite . addTest ( new DatabaseClassLoadingTest ( orderedTests [ i ] ) ) ; } suite . addTest ( SecurityManagerSetup . noSecurityManager ( new DatabaseClassLoadingTest ( "testDatabaseInJar" ) ) ) ; suite . addTest ( SecurityManagerSetup . noSecurityManager ( new DatabaseClassLoadingTest ( "testDatabaseInClasspath" ) ) ) ; suite . addTest ( SecurityManagerSetup . noSecurityManager ( new DatabaseClassLoadingTest ( "testClassLoadOrdering" ) ) ) ; test = new org . apache . derbyTesting . junit . SupportFilesSetup ( suite , new String [ ] { "functionTests//tests//lang//dcl_emc1.jar" , "functionTests//tests//lang//dcl_emcaddon.jar" , "functionTests//tests//lang//dcl_emc2.jar" , "functionTests//tests//lang//dcl_emc2s.jar" , "functionTests//tests//lang//dcl_emc2sm.jar" , "functionTests//tests//lang//dcl_emc2l.jar" , "functionTests//tests//lang//dcl_java.jar" , "functionTests//tests//lang//dcl_ot1.jar" , "functionTests//tests//lang//dcl_ot2.jar" , "functionTests//tests//lang//dcl_ot3.jar" , "functionTests//tests//lang//dcl_id.jar" , "functionTests//tests//lang//dummy_vti.jar" } ) ; } return new CleanDatabaseTestSetup ( test ) { protected void decorateSQL ( Statement s ) throws SQLException { s . executeUpdate ( "create<seq2seq4repair_space>schema<seq2seq4repair_space>emc" ) ; s . executeUpdate ( "create<seq2seq4repair_space>schema<seq2seq4repair_space>\"emcAddOn\"" ) ; s . executeUpdate ( ( "create<seq2seq4repair_space>table<seq2seq4repair_space>emc.contacts<seq2seq4repair_space>" + "(id<seq2seq4repair_space>int<seq2seq4repair_space>primary<seq2seq4repair_space>key,<seq2seq4repair_space>e_mail<seq2seq4repair_space>varchar(30))" ) ) ; s . executeUpdate ( ( "create<seq2seq4repair_space>procedure<seq2seq4repair_space>EMC.ADDCONTACT(id<seq2seq4repair_space>INT,<seq2seq4repair_space>e_mail<seq2seq4repair_space>VARCHAR(30))<seq2seq4repair_space>" + ( ( "MODIFIES<seq2seq4repair_space>SQL<seq2seq4repair_space>DATA<seq2seq4repair_space>" + "external<seq2seq4repair_space>name<seq2seq4repair_space>'org.apache.derbyTesting.databaseclassloader.emc.addContact'<seq2seq4repair_space>" ) + "language<seq2seq4repair_space>java<seq2seq4repair_space>parameter<seq2seq4repair_space>style<seq2seq4repair_space>java" ) ) ) ; <START_BUG> s . executeUpdate ( ( "create<seq2seq4repair_space>function<seq2seq4repair_space>EMC.GETARTICLE(path<seq2seq4repair_space>VARCHAR(40))<seq2seq4repair_space>" + ( ( ( "RETURNS<seq2seq4repair_space>VARCHAR(256)<seq2seq4repair_space>" + "NO<seq2seq4repair_space>SQL<seq2seq4repair_space>" ) + "external<seq2seq4repair_space>name<seq2seq4repair_space>'org.apache.derbyTesting.databaseclassloader.emc.getArticle'<seq2seq4repair_space>" ) + "language<seq2seq4repair_space>java<seq2seq4repair_space>parameter<seq2seq4repair_space>style<seq2seq4repair_space>java" ) ) ) ; <END_BUG> s . executeUpdate ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>EMC.GETSIGNERS(" + ( ( "CLASS_NAME<seq2seq4repair_space>VARCHAR(256))<seq2seq4repair_space>RETURNS<seq2seq4repair_space>VARCHAR(60)<seq2seq4repair_space>" + "NO<seq2seq4repair_space>SQL<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.databaseclassloader.emc.getSigners'" ) ) ) ; s . executeUpdate ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>\"emcAddOn\".VALIDCONTACT(E_MAIL<seq2seq4repair_space>VARCHAR(30))<seq2seq4repair_space>" + ( ( "RETURNS<seq2seq4repair_space>SMALLINT<seq2seq4repair_space>" + "READS<seq2seq4repair_space>SQL<seq2seq4repair_space>DATA<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.databaseclassloader.addon.vendor.util.valid'" ) ) ) ; } } ; } public void testWithNoInstalledJars ( ) throws SQLException { } public void testJarHandling ( ) throws MalformedURLException , SQLException { } public void testWithNoClasspath ( ) throws MalformedURLException , SQLException { } public void testSetClasspath ( ) throws SQLException { } public void testAddContact ( ) throws SQLException { } public void testGetResource ( ) throws SQLException { } private static void getResourceTests ( Connection conn ) throws SQLException { } public void testAlterTable ( ) throws SQLException { } public void testClassPathRollback ( ) throws MalformedURLException , SQLException { } public void testReplaceJar ( ) throws MalformedURLException , SQLException { } public void testReplacedClass ( ) throws SQLException { } public void testSecondJar ( ) throws MalformedURLException , SQLException { } public void testSignedJar ( ) throws MalformedURLException , SQLException { } private static void signersTests ( Connection conn ) throws SQLException { } public void testHackedJarReplacedClass ( ) throws MalformedURLException , SQLException { } public void testInvalidJar ( ) throws MalformedURLException , SQLException { } public void testRemoveJar ( ) throws SQLException { } public void testCreateDatabaseJar ( ) throws Exception { } public void testDatabaseInJar ( ) throws SQLException { } public void testDatabaseInClasspath ( ) throws MalformedURLException , SQLException { } public void testLoadJavaClassIndirectly ( ) throws MalformedURLException , SQLException { } public void testLoadJavaClassDirectly ( ) throws MalformedURLException , SQLException { } public void testLoadJavaClassDirectly2 ( ) throws MalformedURLException , SQLException { } public void testLoadJavaClassDirectly3 ( ) throws MalformedURLException , SQLException { } public void testLoadDerbyClassIndirectly ( ) throws MalformedURLException , SQLException { } private void loadJavaClass ( String method , String expectedSQLState ) throws MalformedURLException , SQLException { } private static void readOnlyTest ( DataSource ds ) throws SQLException { } public void testClassLoadOrdering ( ) throws MalformedURLException , SQLException { } private void checkLoading ( String order ) throws SQLException { } private void checkCorrectLoader ( String className , PreparedStatement ps1 , PreparedStatement ps2 , PreparedStatement ps3 ) throws SQLException { } public void testIndirectLoading ( ) throws MalformedURLException , SQLException { } public void testTableFunctionInJar ( ) throws MalformedURLException , SQLException { } public void test_5352 ( ) throws MalformedURLException , SQLException { } private void installJar ( String resource , String jarName ) throws MalformedURLException , SQLException { } private void replaceJar ( String resource , String jarName ) throws MalformedURLException , SQLException { } private void removeJar ( String jarName ) throws SQLException { } private void setDBClasspath ( String cp ) throws SQLException { } private void derby2035Workaround ( ) throws SQLException { } private static void createArchive ( String jarName , File dbDir , String dbName ) throws Exception { } static void addEntries ( ZipOutputStream zos , File dir , String dbName , int old ) throws Exception { } private static void addFile ( ZipOutputStream zos , File f , String dbName , int old ) throws IOException { } private static void setContextClassLoader ( final URL url ) { } }

Fix:
s . executeUpdate ( ( "create<seq2seq4repair_space>function<seq2seq4repair_space>EMC.GETARTICLE(path<seq2seq4repair_space>VARCHAR(60))<seq2seq4repair_space>" + ( ( ( "RETURNS<seq2seq4repair_space>VARCHAR(256)<seq2seq4repair_space>" + "NO<seq2seq4repair_space>SQL<seq2seq4repair_space>" ) + "external<seq2seq4repair_space>name<seq2seq4repair_space>'org.apache.derbyTesting.databaseclassloader.emc.getArticle'<seq2seq4repair_space>" ) + "language<seq2seq4repair_space>java<seq2seq4repair_space>parameter<seq2seq4repair_space>style<seq2seq4repair_space>java" ) ) ) ;