Buggy code:
public final double getDouble ( String columnName ) throws SQLException { } public final BigDecimal getBigDecimal ( String columnName , int scale ) throws SQLException { } public final BigDecimal getBigDecimal ( String columnName ) throws SQLException { } public final Date getDate ( String columnName ) throws SQLException { } public final Date getDate ( String columnName , Calendar cal ) throws SQLException { } public final Time getTime ( String columnName ) throws SQLException { } public final Time getTime ( String columnName , Calendar cal ) throws SQLException { } public final Timestamp getTimestamp ( String columnName ) throws SQLException { } public final Timestamp getTimestamp ( String columnName , Calendar cal ) throws SQLException { } public final String getString ( String columnName ) throws SQLException { } public final byte [ ] getBytes ( String columnName ) throws SQLException { } public final InputStream getBinaryStream ( String columnName ) throws SQLException { } public final InputStream getAsciiStream ( String columnName ) throws SQLException { } public final InputStream getUnicodeStream ( String columnName ) throws SQLException { } public final Reader getCharacterStream ( String columnName ) throws SQLException { } public final Blob getBlob ( String columnName ) throws SQLException { } public final Clob getClob ( String columnName ) throws SQLException { } public final Array getArray ( String columnName ) throws SQLException { } public final Ref getRef ( String columnName ) throws SQLException { } public final Object getObject ( String columnName ) throws SQLException { } public final Object getObject ( String columnName , Map map ) throws SQLException { } public final SQLWarning getWarnings ( ) throws SQLException { } public final void clearWarnings ( ) throws SQLException { } private void clearWarningsX ( ) { } public String getCursorName ( ) throws SQLException { } public ResultSetMetaData getMetaData ( ) throws SQLException { } ColumnMetaData getMetaDataX ( ) throws SqlException { } public final int findColumn ( String columnName ) throws SQLException { } protected final int findColumnX ( String columnName , String operation ) throws SqlException { } public boolean isBeforeFirst ( ) throws SQLException { } private boolean isBeforeFirstX ( ) throws SqlException { } public boolean isAfterLast ( ) throws SQLException { } private boolean isAfterLastX ( ) throws SqlException { } public boolean isFirst ( ) throws SQLException { } private boolean isFirstX ( ) { } public boolean isLast ( ) throws SQLException { } private boolean isLastX ( ) throws SqlException { } public void beforeFirst ( ) throws SQLException { } private void beforeFirstX ( ) throws SqlException { } public void afterLast ( ) throws SQLException { } private void afterLastX ( ) throws SqlException { } public boolean first ( ) throws SQLException { } private boolean firstX ( ) throws SqlException { } public boolean last ( ) throws SQLException { } private boolean lastX ( ) throws SqlException { } public int getRow ( ) throws SQLException { } private int getRowX ( ) throws SqlException { } public boolean absolute ( int row ) throws SQLException { } private boolean absoluteX ( int row ) throws SqlException { } public boolean relative ( int rows ) throws SQLException { } private boolean relativeX ( int rows ) throws SqlException { } public boolean previous ( ) throws SQLException { } private boolean previousX ( ) throws SqlException { } public void setFetchDirection ( int direction ) throws SQLException { } public int getFetchDirection ( ) throws SQLException { } public void setFetchSize ( int rows ) throws SQLException { try { synchronized ( connection_ ) { if ( agent_ . loggingEnabled ( ) ) { agent_ . logWriter_ . traceEntry ( this , "setFetchSize" , rows ) ; } checkForClosedResultSet ( "setFetchSize" ) ; <START_BUG> if ( ( rows < 0 ) || ( ( ( maxRows_ ) != 0 ) && ( rows > ( maxRows_ ) ) ) ) { <END_BUG> throw new SqlException ( agent_ . logWriter_ , new ClientMessageId ( org . apache . derby . shared . common . reference . SQLState . INVALID_FETCH_SIZE ) , rows ) . getSQLException ( ) ; } setFetchSize_ ( rows ) ; } } catch ( SqlException se ) { throw se . getSQLException ( ) ; } } public int getFetchSize ( ) throws SQLException { } public int getType ( ) throws SQLException { } public int getConcurrency ( ) throws SQLException { } public boolean rowUpdated ( ) throws SQLException { } public boolean rowInserted ( ) throws SQLException { } public boolean rowDeleted ( ) throws SQLException { } public void updateNull ( int column ) throws SQLException { } public void updateBoolean ( int column , boolean x ) throws SQLException { } public void updateByte ( int column , byte x ) throws SQLException { } public void updateShort ( int column , short x ) throws SQLException { } public void updateInt ( int column , int x ) throws SQLException { } public void updateLong ( int column , long x ) throws SQLException { } public void updateFloat ( int column , float x ) throws SQLException { } public void updateDouble ( int column , double x ) throws SQLException { } public void updateBigDecimal ( int column , BigDecimal x ) throws SQLException { } public void updateDate ( int column , Date x ) throws SQLException { } public void updateTime ( int column , Time x ) throws SQLException { } public void updateTimestamp ( int column , Timestamp x ) throws SQLException { } public void updateString ( int column , String x ) throws SQLException { } public void updateBytes ( int column , byte [ ] x ) throws SQLException { } public void updateBinaryStream ( int column , InputStream x , int length ) throws SQLException { }

Fix:
if ( rows < 0 ) {