Buggy code:
public class OracleDictionary extends DBDictionary { public static final String SELECT_HINT = "openjpa.hint.OracleSelectHint" ; public static final String VENDOR_ORACLE = "oracle" ; private static final int BEHAVE_OTHER = 0 ; private static final int BEHAVE_ORACLE = 1 ; private static final int BEHAVE_DATADIRECT31 = 2 ; private static Blob EMPTY_BLOB = null ; private static Clob EMPTY_CLOB = null ; private static final Localizer _loc = Localizer . forPackage ( OracleDictionary . class ) ; public boolean useTriggersForAutoAssign = false ; public String autoAssignSequenceName = null ; public boolean openjpa3GeneratedKeyNames = false ; public boolean useSetFormOfUseForUnicode = true ; private boolean _checkedUpdateBug = false ; private boolean _warnedCharColumn = false ; private boolean _warnedNcharColumn = false ; private int _driverBehavior = - 1 ; private Method _putBytes = null ; private Method _putString = null ; private Method _putChars = null ; private int defaultBatchLimit = 100 ; public OracleDictionary ( ) { } public void endConfiguration ( ) { } public void connectedConfiguration ( Connection conn ) throws SQLException { } private void cacheDriverBehavior ( String driverVendor ) { } public void ensureDriverVendor ( ) { } public boolean supportsLocking ( Select sel ) { } protected SQLBuffer getSelects ( Select sel , boolean distinctIdentifiers , boolean forUpdate ) { } public boolean canOuterJoin ( int syntax , ForeignKey fk ) { } public SQLBuffer toNativeJoin ( Join join ) { } public SQLBuffer toSelect ( SQLBuffer select , JDBCFetchConfiguration fetch , SQLBuffer tables , SQLBuffer where , SQLBuffer group , SQLBuffer having , SQLBuffer order , boolean distinct , boolean forUpdate , long start , long end , Select sel ) { } private boolean requiresSubselectForRange ( long start , long end , boolean distinct , SQLBuffer order ) { } public String getSelectOperation ( JDBCFetchConfiguration fetch ) { } public void setString ( PreparedStatement stmnt , int idx , String val , Column col ) throws SQLException { } public void setNull ( PreparedStatement stmnt , int idx , int colType , Column col ) throws SQLException { } public String getClobString ( ResultSet rs , int column ) throws SQLException { } public Timestamp getTimestamp ( ResultSet rs , int column , Calendar cal ) throws SQLException { } public Object getObject ( ResultSet rs , int column , Map map ) throws SQLException { } private static Object convertFromOracleType ( Object obj , String convertMethod ) throws SQLException { } public Column [ ] getColumns ( DatabaseMetaData meta , String catalog , String schemaName , String tableName , String columnName , Connection conn ) throws SQLException { } public PrimaryKey [ ] getPrimaryKeys ( DatabaseMetaData meta , String catalog , String schemaName , String tableName , Connection conn ) throws SQLException { } public Index [ ] getIndexInfo ( DatabaseMetaData meta , String catalog , String schemaName , String tableName , boolean unique , boolean approx , Connection conn ) throws SQLException { } public ForeignKey [ ] getImportedKeys ( DatabaseMetaData meta , String catalog , String schemaName , String tableName , Connection conn ) throws SQLException { } public String [ ] getCreateTableSQL ( Table table ) { } public String [ ] getCreateSequenceSQL ( Sequence seq ) { } protected String getSequencesSQL ( String schemaName , String sequenceName ) { } public boolean isSystemSequence ( String name , String schema , boolean targetSchema ) { } public Object getGeneratedKey ( Column col , Connection conn ) throws SQLException { } protected String getGeneratedKeyTriggerName ( Column col ) { } protected String getOpenJPA3GeneratedKeySequenceName ( Column col ) { } protected String getOpenJPA3GeneratedKeyTriggerName ( Column col ) { } public void putBytes ( Object blob , byte [ ] data ) throws SQLException { } public void putString ( Object clob , String data ) throws SQLException { } public void putChars ( Object clob , char [ ] data ) throws SQLException { } private static void invokePutLobMethod ( Method method , Object target , Object data ) throws SQLException { } private Clob getEmptyClob ( ) throws SQLException { } private Blob getEmptyBlob ( ) throws SQLException { } private static boolean isOraclePreparedStatement ( Statement stmnt ) { } public void appendXmlComparison ( SQLBuffer buf , String op , FilterValue lhs , FilterValue rhs , boolean lhsxml , boolean rhsxml ) { } private void appendXmlComparison1 ( SQLBuffer buf , String op , FilterValue lhs , FilterValue rhs ) { } private void appendXmlComparison2 ( SQLBuffer buf , String op , FilterValue lhs , FilterValue rhs ) { } private void appendXmlExtractValue ( SQLBuffer buf , FilterValue val ) { } public void insertBlobForStreamingLoad ( Row row , Column col , Object ob ) throws SQLException { } public void insertClobForStreamingLoad ( Row row , Column col , Object ob ) throws SQLException { } public int getBatchUpdateCount ( PreparedStatement ps ) throws SQLException { int updateSuccessCnt = 0 ; <START_BUG> if ( ( ( batchLimit ) > 0 ) && ( ps != null ) ) { <END_BUG> updateSuccessCnt = ps . getUpdateCount ( ) ; if ( log . isTraceEnabled ( ) ) log . trace ( OracleDictionary . _loc . get ( "batch-update-success-count" , updateSuccessCnt ) ) ; } return updateSuccessCnt ; } }

Fix:
if ( ( ( batchLimit ) != 0 ) && ( ps != null ) ) {