Buggy code:
public class callable { public static void main ( String [ ] args ) { try { System . out . println ( "CallableStatement<seq2seq4repair_space>Test<seq2seq4repair_space>Starts" ) ; ij . getPropertyArg ( args ) ; String protocol = System . getProperty ( "ij.protocol" ) ; String hostName = TestUtil . getHostName ( ) ; System . setProperty ( "ij.database" , ( ( ( ( ( ( protocol + "////" ) + hostName ) + "//\"" ) + ( System . getProperty ( "derby.system.home" ) ) ) + ( File . separator ) ) + "wombat;create=true\"" ) ) ; ij . getPropertyArg ( args ) ; Connection conn = ij . startJBMS ( ) ; if ( conn == null ) { System . out . println ( "conn<seq2seq4repair_space>didn't<seq2seq4repair_space>work" ) ; return ; } Statement stmt = conn . createStatement ( ) ; stmt . execute ( ( "CREATE<seq2seq4repair_space>PROCEDURE<seq2seq4repair_space>method1(IN<seq2seq4repair_space>P1<seq2seq4repair_space>INT,<seq2seq4repair_space>IN<seq2seq4repair_space>P2<seq2seq4repair_space>INT,<seq2seq4repair_space>OUT<seq2seq4repair_space>P3<seq2seq4repair_space>INT)<seq2seq4repair_space>" + ( "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.functionTests.tests.derbynet.callable.method1'" + "<seq2seq4repair_space>NO<seq2seq4repair_space>SQL<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ) ; CallableStatement cs = conn . prepareCall ( "call<seq2seq4repair_space>method1<seq2seq4repair_space>(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ; cs . setInt ( 1 , 6 ) ; cs . setInt ( 2 , 9 ) ; cs . registerOutParameter ( 3 , Types . INTEGER ) ; cs . execute ( ) ; int sum = cs . getInt ( 3 ) ; System . out . println ( ( "Sum<seq2seq4repair_space>of<seq2seq4repair_space>6<seq2seq4repair_space>and<seq2seq4repair_space>9<seq2seq4repair_space>is:<seq2seq4repair_space>" + sum ) ) ; cs . close ( ) ; stmt . execute ( "DROP<seq2seq4repair_space>PROCEDURE<seq2seq4repair_space>method1" ) ; stmt . execute ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>method2(P1<seq2seq4repair_space>INT)<seq2seq4repair_space>RETURNS<seq2seq4repair_space>INT" + ( "<seq2seq4repair_space>EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.functionTests.tests.derbynet.callable.method2'" + "<seq2seq4repair_space>NO<seq2seq4repair_space>SQL<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ) ; cs = conn . prepareCall ( "?<seq2seq4repair_space>=<seq2seq4repair_space>call<seq2seq4repair_space>method2<seq2seq4repair_space>(?)" ) ; cs . registerOutParameter ( 1 , Types . INTEGER ) ; cs . setInt ( 2 , 6 ) ; cs . execute ( ) ; int ret = cs . getInt ( 1 ) ; System . out . println ( ( "return<seq2seq4repair_space>value:<seq2seq4repair_space>Square<seq2seq4repair_space>of<seq2seq4repair_space>6<seq2seq4repair_space>then<seq2seq4repair_space>plus<seq2seq4repair_space>6<seq2seq4repair_space>is:<seq2seq4repair_space>" + ret ) ) ; cs . close ( ) ; stmt . execute ( ( "CREATE<seq2seq4repair_space>PROCEDURE<seq2seq4repair_space>method3()<seq2seq4repair_space>" + ( "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.functionTests.tests.derbynet.callable.method3'" + "<seq2seq4repair_space>NO<seq2seq4repair_space>SQL<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ) ; cs = conn . prepareCall ( "call<seq2seq4repair_space>method3<seq2seq4repair_space>()" ) ; cs . execute ( ) ; cs . close ( ) ; stmt . execute ( "DROP<seq2seq4repair_space>PROCEDURE<seq2seq4repair_space>method3" ) ; stmt . execute ( ( "CREATE<seq2seq4repair_space>FUNCTION<seq2seq4repair_space>method4()<seq2seq4repair_space>RETURNS<seq2seq4repair_space>INT" + ( "<seq2seq4repair_space>EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.functionTests.tests.derbynet.callable.method4'" + "<seq2seq4repair_space>NO<seq2seq4repair_space>SQL<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ) ; cs = conn . prepareCall ( "?<seq2seq4repair_space>=<seq2seq4repair_space>call<seq2seq4repair_space>method4()" ) ; cs . registerOutParameter ( 1 , Types . INTEGER ) ; cs . execute ( ) ; System . out . println ( ( "return<seq2seq4repair_space>value<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( cs . getInt ( 1 ) ) ) ) ; cs . close ( ) ; if ( ! ( TestUtil . isJCCFramework ( ) ) ) { cs = conn . prepareCall ( "?<seq2seq4repair_space>=<seq2seq4repair_space>call<seq2seq4repair_space>method4()" ) ; try { cs . registerOutParameter ( 1 , Types . INTEGER , "user-def" ) ; System . out . println ( "DERBY-1184<seq2seq4repair_space>FAIL:<seq2seq4repair_space>Expected<seq2seq4repair_space>exception" ) ; } catch ( SQLException expectedException ) { <START_BUG> if ( ! ( "0AX01" . equals ( expectedException . getSQLState ( ) ) ) ) { <END_BUG> System . out . println ( ( "DERBY-1184:<seq2seq4repair_space>Caught<seq2seq4repair_space>UNexpected:<seq2seq4repair_space>" + ( expectedException . getMessage ( ) ) ) ) ; System . out . println ( ( ( ( "DERBY-1184:<seq2seq4repair_space>SQLState:<seq2seq4repair_space>" + ( expectedException . getSQLState ( ) ) ) + ",<seq2seq4repair_space>errorCode:<seq2seq4repair_space>" ) + ( expectedException . getErrorCode ( ) ) ) ) ; } } cs . close ( ) ; } stmt . execute ( ( "CREATE<seq2seq4repair_space>PROCEDURE<seq2seq4repair_space>method4P(" + ( ( ( ( ( ( "IN<seq2seq4repair_space>P1<seq2seq4repair_space>SMALLINT,<seq2seq4repair_space>IN<seq2seq4repair_space>P2<seq2seq4repair_space>INT,<seq2seq4repair_space>IN<seq2seq4repair_space>P3<seq2seq4repair_space>BIGINT,<seq2seq4repair_space>IN<seq2seq4repair_space>P4<seq2seq4repair_space>REAL,<seq2seq4repair_space>" + "IN<seq2seq4repair_space>P5<seq2seq4repair_space>DOUBLE,<seq2seq4repair_space>IN<seq2seq4repair_space>P6<seq2seq4repair_space>DECIMAL(6,3),<seq2seq4repair_space>IN<seq2seq4repair_space>P7<seq2seq4repair_space>DATE,<seq2seq4repair_space>IN<seq2seq4repair_space>P8<seq2seq4repair_space>TIME,<seq2seq4repair_space>IN<seq2seq4repair_space>P9<seq2seq4repair_space>TIMESTAMP,<seq2seq4repair_space>IN<seq2seq4repair_space>P10<seq2seq4repair_space>VARCHAR(20)<seq2seq4repair_space>FOR<seq2seq4repair_space>BIT<seq2seq4repair_space>DATA,<seq2seq4repair_space>" ) + "OUT<seq2seq4repair_space>O1<seq2seq4repair_space>SMALLINT,<seq2seq4repair_space>OUT<seq2seq4repair_space>O2<seq2seq4repair_space>INT,<seq2seq4repair_space>OUT<seq2seq4repair_space>O3<seq2seq4repair_space>BIGINT,<seq2seq4repair_space>OUT<seq2seq4repair_space>O4<seq2seq4repair_space>REAL,<seq2seq4repair_space>" ) + "OUT<seq2seq4repair_space>O5<seq2seq4repair_space>DOUBLE,<seq2seq4repair_space>OUT<seq2seq4repair_space>O6<seq2seq4repair_space>DECIMAL(6,3),<seq2seq4repair_space>OUT<seq2seq4repair_space>O7<seq2seq4repair_space>DATE,<seq2seq4repair_space>OUT<seq2seq4repair_space>O8<seq2seq4repair_space>TIME,<seq2seq4repair_space>OUT<seq2seq4repair_space>O9<seq2seq4repair_space>TIMESTAMP,<seq2seq4repair_space>OUT<seq2seq4repair_space>O10<seq2seq4repair_space>VARCHAR(20)<seq2seq4repair_space>FOR<seq2seq4repair_space>BIT<seq2seq4repair_space>DATA" ) + ")<seq2seq4repair_space>" ) + "EXTERNAL<seq2seq4repair_space>NAME<seq2seq4repair_space>'org.apache.derbyTesting.functionTests.tests.derbynet.callable.method4'" ) + "<seq2seq4repair_space>NO<seq2seq4repair_space>SQL<seq2seq4repair_space>LANGUAGE<seq2seq4repair_space>JAVA<seq2seq4repair_space>PARAMETER<seq2seq4repair_space>STYLE<seq2seq4repair_space>JAVA" ) ) ) ; cs = conn . prepareCall ( "call<seq2seq4repair_space>method4P(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ; cs . setShort ( 1 , ( ( short ) ( 3 ) ) ) ; cs . setInt ( 2 , 4 ) ; cs . setLong ( 3 , 5 ) ; cs . setFloat ( 4 , ( ( float ) ( 6.0 ) ) ) ; cs . setDouble ( 5 , 7.0 ) ; cs . setBigDecimal ( 6 , new BigDecimal ( "88.88" ) ) ; cs . setDate ( 7 , Date . valueOf ( "2002-05-12" ) ) ; cs . setTime ( 8 , Time . valueOf ( "10:05:02" ) ) ; cs . setTimestamp ( 9 , Timestamp . valueOf ( "2002-05-12<seq2seq4repair_space>10:05:02.000000000" ) ) ; byte [ ] ba = new byte [ 2 ] ; ba [ 0 ] = 1 ; ba [ 1 ] = 2 ; cs . setBytes ( 10 , ba ) ; int n = 10 ; cs . registerOutParameter ( ( n + 1 ) , Types . SMALLINT ) ; cs . registerOutParameter ( ( n + 2 ) , Types . INTEGER ) ; cs . registerOutParameter ( ( n + 3 ) , Types . BIGINT ) ; cs . registerOutParameter ( ( n + 4 ) , Types . REAL ) ; cs . registerOutParameter ( ( n + 5 ) , Types . DOUBLE ) ; cs . registerOutParameter ( ( n + 6 ) , Types . DECIMAL ) ; cs . registerOutParameter ( ( n + 7 ) , Types . DATE ) ; cs . registerOutParameter ( ( n + 8 ) , Types . TIME ) ; cs . registerOutParameter ( ( n + 9 ) , Types . TIMESTAMP ) ; cs . registerOutParameter ( ( n + 10 ) , Types . VARBINARY ) ; cs . execute ( ) ; System . out . println ( ( "return<seq2seq4repair_space>short:<seq2seq4repair_space>" + ( cs . getShort ( ( n + 1 ) ) ) ) ) ; System . out . println ( ( "return<seq2seq4repair_space>int:<seq2seq4repair_space>" + ( cs . getInt ( ( n + 2 ) ) ) ) ) ; System . out . println ( ( "return<seq2seq4repair_space>long:<seq2seq4repair_space>" + ( cs . getLong ( ( n + 3 ) ) ) ) ) ;

Fix:
if ( ! ( "0A000" . equals ( expectedException . getSQLState ( ) ) ) ) {