Buggy code:
private 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 int getExceptionSeverity ( SQLException e ) { } private void writeSQLCAGRP ( SQLException e , int sqlcode , int updateCount , long rowCount ) throws DRDAProtocolException { } private void writeSQLCAXGRP ( int updateCount , long rowCount , String sqlerrmc , SQLException nextException ) throws DRDAProtocolException { } private void writeSQLCAERRWARN ( int updateCount , long rowCount ) { } private void writeSQLDIAGGRP ( SQLException nextException ) throws DRDAProtocolException { } private void writeSQLDIAGSTT ( ) throws DRDAProtocolException { } private void writeSQLDIAGCI ( SQLException nextException ) throws DRDAProtocolException { } private void writeSQLNUMROW ( SQLException nextException ) throws DRDAProtocolException { } private void writeSQLNUMGRP ( SQLException nextException ) throws DRDAProtocolException { } private void writeSQLDCROW ( long rowNum , int sqlCode , String sqlState , String dbname , String sqlerrmc ) throws DRDAProtocolException { } private void writeSQLDCGRP ( long rowNum , int sqlCode , String sqlState , String dbname , String sqlerrmc ) throws DRDAProtocolException { } private void writeSQLDIAGCN ( ) throws DRDAProtocolException { } private void writeSQLDARD ( DRDAStatement stmt , boolean rtnOutput , SQLException e ) throws SQLException , DRDAProtocolException { } private void writeQRYDSC ( DRDAStatement stmt , boolean FDODSConly ) throws SQLException , DRDAProtocolException { } private void writeSQLDTAGRP ( DRDAStatement stmt , ResultSetMetaData rsmeta , EmbedParameterSetMetaData pmeta , int colStart , int colEnd , boolean first ) throws SQLException , DRDAProtocolException { } private void writeSQLDHROW ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeQRYDTA ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private boolean writeFDODTA ( DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void splitQRYDTA ( DRDAStatement stmt , int blksize ) throws SQLException , DRDAProtocolException { } private void doneData ( DRDAStatement stmt , ResultSet rs ) throws SQLException , DRDAProtocolException { } private boolean positionCursor ( DRDAStatement stmt , ResultSet rs ) throws SQLException , DRDAProtocolException { } private void writeSQLDAGRP ( ResultSetMetaData rsmeta , EmbedParameterSetMetaData pmeta , int elemNum , boolean rtnOutput ) throws SQLException , DRDAProtocolException { } private void writeVCMorVCS ( String s ) throws DRDAProtocolException { } private void writeSQLUDTGRP ( ResultSetMetaData rsmeta , EmbedParameterSetMetaData pmeta , int jdbcElemNum , boolean rtnOutput ) throws SQLException , DRDAProtocolException { } private void writeSQLDOPTGRP ( ResultSetMetaData rsmeta , EmbedParameterSetMetaData pmeta , int jdbcElemNum , boolean rtnOutput ) throws SQLException , DRDAProtocolException { } private void writeSQLDXGRP ( ResultSetMetaData rsmeta , EmbedParameterSetMetaData pmeta , int jdbcElemNum , boolean rtnOutput ) throws SQLException , DRDAProtocolException { } protected void writeFdocaVal ( int index , Object val , int drdaType , int precision , int scale , boolean valNull , DRDAStatement stmt ) throws SQLException , DRDAProtocolException { } private void writeNullability ( int drdaType , boolean valNull ) { } private void copyToRequired ( int [ ] req ) { } private void removeFromRequired ( int codePoint ) { } private void checkRequired ( int codePoint ) throws DRDAProtocolException { } private void tooMany ( int codePoint ) throws DRDAProtocolException { } private void tooBig ( int codePoint ) throws DRDAProtocolException { } private void badObjectLength ( int codePoint ) throws DRDAProtocolException { } private void rdbNotFound ( String rdbnam ) throws DRDAProtocolException { } private void invalidValue ( int codePoint ) throws DRDAProtocolException { } private void invalidCodePoint ( int codePoint ) throws DRDAProtocolException { } private void codePointNotSupported ( int codePoint ) throws DRDAProtocolException { } private void valueNotSupported ( int codePoint ) throws DRDAProtocolException { } private void verifyRequiredObject ( int codePoint , int reqCodePoint ) throws DRDAProtocolException { } private void verifyInOrderACCSEC_SECCHK ( int codePoint , int reqCodePoint ) throws DRDAProtocolException { } private void rdbnamMismatch ( int codePoint ) throws DRDAProtocolException { } private void closeSession ( ) { } private void handleException ( Exception e ) { } private void sendUnexpectedException ( Exception e ) { } private boolean closed ( ) { } private boolean getLogConnections ( ) { } private long getTimeSlice ( ) { } protected void trace ( String value ) { } public static void showmem ( ) { } private String convertToHexString ( byte [ ] buf ) { } private void checkValidTypDefNam ( String typdefnam ) throws DRDAProtocolException { } private void checkLength ( int codepoint , int reqlen ) throws DRDAProtocolException { } private boolean readBoolean ( int codepoint ) throws DRDAProtocolException { checkLength ( codepoint , 1 ) ; <START_BUG> int val = reader . readByte ( ) ; <END_BUG>

Fix:
byte val = reader . readByte ( ) ;