Buggy code:
private throws DRDAProtocolException { } private int parseACCSEC ( ) throws DRDAProtocolException { } private String parseOPNQRY ( ) throws SQLException , DRDAProtocolException { } private void parseOPNQRYobjects ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private int parseOUTOVROPT ( ) throws DRDAProtocolException { } private int parseQRYBLKSZ ( ) throws DRDAProtocolException { } private int parseQRYROWSET ( int minVal ) throws DRDAProtocolException { } private int parseQRYCLSIMP ( ) throws DRDAProtocolException { } private int parseQRYCLSRLS ( ) throws DRDAProtocolException { } private int parseQRYOPTVAL ( ) throws DRDAProtocolException { } private void writeQRYPOPRM ( ) throws DRDAProtocolException { } private void writeQRYNOPRM ( int svrCod ) throws DRDAProtocolException { } private void writeOPNQFLRM ( SQLException e ) throws DRDAProtocolException { } private void writePKGNAMCSN ( String pkgcnstknStr ) throws DRDAProtocolException { } private void writePKGNAMCSN ( ) throws DRDAProtocolException { } private DRDAStatement parseCNTQRY ( ) throws SQLException , DRDAProtocolException { } private void skipRemainder ( boolean onlySkipSameIds ) throws DRDAProtocolException { } private void parseCNTQRYobjects ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void parseOUTOVR ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeOPNQRYRM ( boolean isDssObject , DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeENDQRYRM ( int svrCod ) throws DRDAProtocolException { } private void writeABNUOWRM ( ) throws DRDAProtocolException { } private String parseRDBNAM ( ) throws DRDAProtocolException { } private void writeACCSECRD ( int securityCheckCode ) throws DRDAProtocolException { } private int parseSECCHK ( ) throws DRDAProtocolException { } private void writeSECCHKRM ( int securityCheckCode ) throws DRDAProtocolException { } private int svrcodFromSecchkcd ( int securityCheckCode ) { } private int parseACCRDB ( ) throws DRDAProtocolException { } private String parseTYPDEFNAM ( ) throws DRDAProtocolException { } private void setStmtOrDbByteOrder ( boolean setDatabase , DRDAStatement stmt , String typDefNam ) { } private void writeACCRDBRM ( int svrcod ) throws DRDAProtocolException { } private void writeTYPDEFOVR ( ) throws DRDAProtocolException { } private void parseTYPDEFOVR ( DRDAStatement st ) throws DRDAProtocolException { } private int parsePRPSQLSTT ( ) throws SQLException , DRDAProtocolException { } private String parsePRPSQLSTTobjects ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private boolean parseTYPSQLDA ( ) throws DRDAProtocolException { } protected void parseSQLATTR ( DRDAStatement stmt ) throws DRDAProtocolException { } private boolean parseDSCSQLSTT ( ) throws SQLException , DRDAProtocolException { } private void parseEXCSQLSTT ( ) throws SQLException , DRDAProtocolException { } private void parseRDBCMTOK ( ) throws DRDAProtocolException { } private void parseEXCSQLSTTobjects ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeSQLCINRD ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeSQLRSLRD ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeRSLSETRM ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void parseSQLDTA ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void parseSQLDTA_work ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private int getByteOrder ( ) { } private ArrayList readAndSetParams ( int i , DRDAStatement stmt , int drdaType , EmbedParameterSetMetaData pmeta , ArrayList paramExtPositions , int paramLenNumBytes ) throws SQLException , DRDAProtocolException { } private long readLobLength ( int extLenIndicator ) throws DRDAProtocolException { } private void readAndSetAllExtParams ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void readAndSetExtParam ( int i , DRDAStatement stmt , int drdaType , int extLen ) throws SQLException , DRDAProtocolException { } private int parseEXCSQLIMM ( ) throws SQLException , DRDAProtocolException { } private boolean parseEXCSQLSET ( ) throws SQLException , DRDAProtocolException { } private String parseEXECSQLIMMobjects ( ) throws SQLException , DRDAProtocolException { } private void parseEXCSQLSETobjects ( ) throws SQLException , DRDAProtocolException { } private boolean canIgnoreStmt ( String stmt ) { } private void writeRDBUPDRM ( ) throws DRDAProtocolException { } private String parsePKGNAMCT ( ) throws DRDAProtocolException { } private String parsePKGNAMCSN ( ) throws DRDAProtocolException { } private String parseSQLSTTDss ( ) throws DRDAProtocolException { } private String parseEncodedString ( ) throws DRDAProtocolException { } private String parseVCMorVCS ( ) throws DRDAProtocolException { } private String parseNOCMorNOCS ( ) throws DRDAProtocolException { } private String parseCcsidMBC ( int length ) throws DRDAProtocolException { } private String parseCcsidSBC ( int length ) throws DRDAProtocolException { } private DRDAStatement parseCLSQRY ( ) throws SQLException , DRDAProtocolException { } private void parseMONITOR ( ) throws DRDAProtocolException { } private void writeSQLCARDs ( SQLException e , int updateCount ) throws DRDAProtocolException { } private void writeSQLCARDs ( SQLException e , int updateCount , boolean sendSQLERRRM ) throws DRDAProtocolException { } private int getSqlCode ( int severity ) { } private void writeSQLCARD ( SQLException e , int severity , int updateCount , long rowCount ) throws DRDAProtocolException { } private void writeNullSQLCARDobject ( ) throws DRDAProtocolException { } private void writeSQLERRRM ( int severity ) throws DRDAProtocolException { } private void writeCMDCHKRM ( int severity ) throws DRDAProtocolException { } private int getExceptionSeverity ( SQLException e ) { } private void writeSQLCAGRP ( SQLException e , int sqlcode , int updateCount , long rowCount ) throws DRDAProtocolException { String sqlerrmc ; String sqlState ; String severeExceptionInfo = null ; SQLException nextException = null ; if ( ( rowCount < 0 ) && ( updateCount < 0 ) ) { writer . writeByte ( NULLDATA ) ; return ; } if ( e == null ) { sqlerrmc = null ; sqlState = "<seq2seq4repair_space>" ; } else { if ( sqlcode < 0 ) { if ( ( SanityManager . DEBUG ) && ( server . debugOutput ) ) { trace ( "handle<seq2seq4repair_space>SQLException<seq2seq4repair_space>here" ) ; trace ( ( "reason<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; trace ( ( "SQLState<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( e . getSQLState ( ) ) ) ) ; trace ( ( "vendorCode<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( e . getErrorCode ( ) ) ) ) ; trace ( ( "nextException<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( e . getNextException ( ) ) ) ) ; server . consoleExceptionPrint ( e ) ; trace ( "wrapping<seq2seq4repair_space>SQLException<seq2seq4repair_space>into<seq2seq4repair_space>SQLCARD..." ) ; } } sqlState = e . getSQLState ( ) ; if ( e instanceof EmbedSQLException ) { EmbedSQLException ce = ( ( EmbedSQLException ) ( e ) ) ; boolean severeException = ( ce . getErrorCode ( ) ) >= ( ExceptionSeverity . SESSION_SEVERITY ) ; sqlerrmc = "" ; byte [ ] sep = new byte [ ] { 20 } ; byte [ ] errSep = new byte [ ] { 20 , 20 , 20 } ; String separator = new String ( sep ) ; String errSeparator = new String ( errSep ) ; String dbname = null ; if ( ( database ) != null ) dbname = database . dbName ; do { String messageId = ce . getMessageId ( ) ; Object [ ] args = ce . getArguments ( ) ; for ( int i = 0 ; ( args != null ) && ( i < ( args . length ) ) ; i ++ ) <START_BUG> sqlerrmc += ( args [ i ] . toString ( ) ) + separator ; <END_BUG>

Fix:
sqlerrmc += ( args [ i ] ) + separator ;