nus-yam/ex-repair huggingface dataset:
Program: 80061
Project: 80061
Buggy source:
final boolean getBoolean(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.BOOLEAN:
    return get_BOOLEAN(column);
case java.sql.Types.SMALLINT:
  return agent_.crossConverters_.getBooleanFromShort(get_SMALLINT(column));
case java.sql.Types.INTEGER:
return agent_.crossConverters_.getBooleanFromInt(get_INTEGER(column));
case java.sql.Types.BIGINT:
return agent_.crossConverters_.getBooleanFromLong(get_BIGINT(column));
case java.sql.Types.REAL:
return agent_.crossConverters_.getBooleanFromFloat(get_FLOAT(column));
case java.sql.Types.DOUBLE:
return agent_.crossConverters_.getBooleanFromDouble(get_DOUBLE(column));
case java.sql.Types.DECIMAL:
return agent_.crossConverters_.getBooleanFromLong(getLongFromDECIMAL(column));
case java.sql.Types.CHAR:
return agent_.crossConverters_.getBooleanFromString(getCHAR(column));
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getBooleanFromString(getVARCHAR(column));
default :
throw new ColumnTypeConversionException(agent_.logWriter_,"String_Node_Str" + jdbcTypes_[column - 1],"String_Node_Str");
}
}

Fixed version (ground truth):
final boolean getBoolean(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.BOOLEAN:
    return get_BOOLEAN(column);
case java.sql.Types.SMALLINT:
  return agent_.crossConverters_.getBooleanFromShort(get_SMALLINT(column));
case java.sql.Types.INTEGER:
return agent_.crossConverters_.getBooleanFromInt(get_INTEGER(column));
case java.sql.Types.BIGINT:
return agent_.crossConverters_.getBooleanFromLong(get_BIGINT(column));
case java.sql.Types.REAL:
return agent_.crossConverters_.getBooleanFromFloat(get_FLOAT(column));
case java.sql.Types.DOUBLE:
return agent_.crossConverters_.getBooleanFromDouble(get_DOUBLE(column));
case java.sql.Types.DECIMAL:
return agent_.crossConverters_.getBooleanFromLong(getLongFromDECIMAL(column));
case java.sql.Types.CHAR:
return agent_.crossConverters_.getBooleanFromString(getCHAR(column));
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getBooleanFromString(getVARCHAR(column));
default :
throw coercionError("String_Node_Str",column);
}
}
Program: 80062
Project: 80062
Buggy source:
final java.sql.Date getDate(int column,Calendar cal) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.DATE:
    return getDATE(column,cal);
case java.sql.Types.TIMESTAMP:
  return getDateFromTIMESTAMP(column,cal);
case java.sql.Types.CHAR:
return agent_.crossConverters_.getDateFromString(getCHAR(column),cal);
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getDateFromString(getVARCHAR(column),cal);
default :
throw new ColumnTypeConversionException(agent_.logWriter_,"String_Node_Str" + jdbcTypes_[column - 1],"String_Node_Str");
}
}

Fixed version (ground truth):
final java.sql.Date getDate(int column,Calendar cal) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.DATE:
    return getDATE(column,cal);
case java.sql.Types.TIMESTAMP:
  return getDateFromTIMESTAMP(column,cal);
case java.sql.Types.CHAR:
return agent_.crossConverters_.getDateFromString(getCHAR(column),cal);
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getDateFromString(getVARCHAR(column),cal);
default :
throw coercionError("String_Node_Str",column);
}
}
Program: 80063
Project: 80063
Buggy source:
final short getShort(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.BOOLEAN:
    return agent_.crossConverters_.getShortFromBoolean(get_BOOLEAN(column));
case java.sql.Types.SMALLINT:
  return get_SMALLINT(column);
case java.sql.Types.INTEGER:
return agent_.crossConverters_.getShortFromInt(get_INTEGER(column));
case java.sql.Types.BIGINT:
return agent_.crossConverters_.getShortFromLong(get_BIGINT(column));
case java.sql.Types.REAL:
return agent_.crossConverters_.getShortFromFloat(get_FLOAT(column));
case java.sql.Types.DOUBLE:
return agent_.crossConverters_.getShortFromDouble(get_DOUBLE(column));
case java.sql.Types.DECIMAL:
return agent_.crossConverters_.getShortFromLong(getLongFromDECIMAL(column));
case java.sql.Types.CHAR:
return agent_.crossConverters_.getShortFromString(getCHAR(column));
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getShortFromString(getVARCHAR(column));
default :
throw new ColumnTypeConversionException(agent_.logWriter_,"String_Node_Str" + jdbcTypes_[column - 1],"String_Node_Str");
}
}

Fixed version (ground truth):
final short getShort(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.BOOLEAN:
    return agent_.crossConverters_.getShortFromBoolean(get_BOOLEAN(column));
case java.sql.Types.SMALLINT:
  return get_SMALLINT(column);
case java.sql.Types.INTEGER:
return agent_.crossConverters_.getShortFromInt(get_INTEGER(column));
case java.sql.Types.BIGINT:
return agent_.crossConverters_.getShortFromLong(get_BIGINT(column));
case java.sql.Types.REAL:
return agent_.crossConverters_.getShortFromFloat(get_FLOAT(column));
case java.sql.Types.DOUBLE:
return agent_.crossConverters_.getShortFromDouble(get_DOUBLE(column));
case java.sql.Types.DECIMAL:
return agent_.crossConverters_.getShortFromLong(getLongFromDECIMAL(column));
case java.sql.Types.CHAR:
return agent_.crossConverters_.getShortFromString(getCHAR(column));
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getShortFromString(getVARCHAR(column));
default :
throw coercionError("String_Node_Str",column);
}
}
Program: 80066
Project: 80066
Buggy source:
public final java.sql.Blob getBlob(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case Types.BLOB:
    return getBlobColumn_(column,agent_,true);
default :
  throw new ColumnTypeConversionException(agent_.logWriter_,"String_Node_Str" + jdbcTypes_[column - 1],"String_Node_Str");
}
}

Fixed version (ground truth):
public final java.sql.Blob getBlob(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case Types.BLOB:
    return getBlobColumn_(column,agent_,true);
default :
  throw coercionError("String_Node_Str",column);
}
}
Program: 80067
Project: 80067
Buggy source:
final long getLong(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.BOOLEAN:
    return agent_.crossConverters_.getLongFromBoolean(get_BOOLEAN(column));
case java.sql.Types.SMALLINT:
  return (long)get_SMALLINT(column);
case java.sql.Types.INTEGER:
return (long)get_INTEGER(column);
case java.sql.Types.BIGINT:
return get_BIGINT(column);
case java.sql.Types.REAL:
return agent_.crossConverters_.getLongFromFloat(get_FLOAT(column));
case java.sql.Types.DOUBLE:
return agent_.crossConverters_.getLongFromDouble(get_DOUBLE(column));
case java.sql.Types.DECIMAL:
return getLongFromDECIMAL(column);
case java.sql.Types.CHAR:
return agent_.crossConverters_.getLongFromString(getCHAR(column));
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getLongFromString(getVARCHAR(column));
default :
throw new ColumnTypeConversionException(agent_.logWriter_,"String_Node_Str" + jdbcTypes_[column - 1],"String_Node_Str");
}
}

Fixed version (ground truth):
final long getLong(int column) throws SqlException {
switch (jdbcTypes_[column - 1]) {
case java.sql.Types.BOOLEAN:
    return agent_.crossConverters_.getLongFromBoolean(get_BOOLEAN(column));
case java.sql.Types.SMALLINT:
  return (long)get_SMALLINT(column);
case java.sql.Types.INTEGER:
return (long)get_INTEGER(column);
case java.sql.Types.BIGINT:
return get_BIGINT(column);
case java.sql.Types.REAL:
return agent_.crossConverters_.getLongFromFloat(get_FLOAT(column));
case java.sql.Types.DOUBLE:
return agent_.crossConverters_.getLongFromDouble(get_DOUBLE(column));
case java.sql.Types.DECIMAL:
return getLongFromDECIMAL(column);
case java.sql.Types.CHAR:
return agent_.crossConverters_.getLongFromString(getCHAR(column));
case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR:
return agent_.crossConverters_.getLongFromString(getVARCHAR(column));
default :
throw coercionError("String_Node_Str",column);
}
}
Program: 80069
Project: 80069
Buggy source:
ColumnTypeConversionException(LogWriter logWriter,String sourceType,String targetType){
  super(logWriter,new ClientMessageId(SQLState.LANG_DATA_TYPE_GET_MISMATCH),sourceType,targetType);
}

Fixed version (ground truth):
ColumnTypeConversionException(LogWriter logWriter,String targetType,String sourceType){
  super(logWriter,new ClientMessageId(SQLState.LANG_DATA_TYPE_GET_MISMATCH),targetType,sourceType);
}
Program: 80070
Project: 80070
Buggy source:
/** 
 * Computes the RowLocation in SYSSEQUENCES for a particular sequence. Also constructs the sequence descriptor.
 * @param tc			Transaction Controller to use.
 * @param sequenceIDstring UUID of the sequence as a string
 * @param rowLocation OUTPUT param for returing the row location
 * @param sequenceDescriptor OUTPUT param for return the sequence descriptor
 * @return The RowLocation of that sequence in SYSSEQUENCES
 * @exception StandardException thrown on failure.
 */
void computeSequenceRowLocation(TransactionController tc,String sequenceIDstring,RowLocation[] rowLocation,SequenceDescriptor[] sequenceDescriptor) throws StandardException {
  TabInfoImpl ti=getNonCoreTI(SYSSEQUENCES_CATALOG_NUM);
  ExecIndexRow keyRow=null;
  ExecRow row;
  keyRow=(ExecIndexRow)exFactory.getIndexableRow(1);
  keyRow.setColumn(1,new SQLChar(sequenceIDstring));
  rowLocation[0]=ti.getRowLocation(tc,keyRow,SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX1_ID);
  sequenceDescriptor[0]=(SequenceDescriptor)getDescriptorViaIndexMinion(SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX1_ID,keyRow,(ScanQualifier[][])null,ti,(TupleDescriptor)null,(List)null,false,TransactionController.ISOLATION_REPEATABLE_READ,tc);
}

Fixed version (ground truth):
/** 
 * Computes the RowLocation in SYSSEQUENCES for a particular sequence. Also constructs the sequence descriptor.
 * @param tc			Transaction Controller to use.
 * @param sequenceIDstring UUID of the sequence as a string
 * @param rowLocation OUTPUT param for returing the row location
 * @param sequenceDescriptor OUTPUT param for return the sequence descriptor
 * @exception StandardException thrown on failure.
 */
void computeSequenceRowLocation(TransactionController tc,String sequenceIDstring,RowLocation[] rowLocation,SequenceDescriptor[] sequenceDescriptor) throws StandardException {
  TabInfoImpl ti=getNonCoreTI(SYSSEQUENCES_CATALOG_NUM);
  ExecIndexRow keyRow=null;
  ExecRow row;
  keyRow=(ExecIndexRow)exFactory.getIndexableRow(1);
  keyRow.setColumn(1,new SQLChar(sequenceIDstring));
  rowLocation[0]=ti.getRowLocation(tc,keyRow,SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX1_ID);
  sequenceDescriptor[0]=(SequenceDescriptor)getDescriptorViaIndexMinion(SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX1_ID,keyRow,(ScanQualifier[][])null,ti,(TupleDescriptor)null,(List)null,false,TransactionController.ISOLATION_REPEATABLE_READ,tc);
}
Program: 80073
Project: 80073
Buggy source:
/** 
 * initialize a PrivilegesNode
 * @param objectType (an Integer)
 * @param objectOfPrivilege (a TableName or RoutineDesignator)
 * @param specificPrivileges null for routines
 */
public void init(Object objectType,Object objectOfPrivilege,Object specificPrivileges){
  this.objectType=((Integer)objectType).intValue();
  if (SanityManager.DEBUG) {
    SanityManager.ASSERT(objectOfPrivilege != null,"String_Node_Str");
switch (this.objectType) {
case TABLE_PRIVILEGES:
      SanityManager.ASSERT(specificPrivileges != null,"String_Node_Str");
    objectName=(TableName)objectOfPrivilege;
  this.specificPrivileges=(TablePrivilegesNode)specificPrivileges;
break;
case ROUTINE_PRIVILEGES:
SanityManager.ASSERT(specificPrivileges == null,"String_Node_Str");
routineDesignator=(RoutineDesignator)objectOfPrivilege;
objectName=routineDesignator.name;
break;
default :
SanityManager.THROWASSERT("String_Node_Str" + this.objectType);
}
}
}

Fixed version (ground truth):
/** 
 * initialize a PrivilegesNode
 * @param objectType (an Integer)
 * @param objectOfPrivilege (a TableName or RoutineDesignator)
 * @param specificPrivileges null for routines
 */
public void init(Object objectType,Object objectOfPrivilege,Object specificPrivileges){
  this.objectType=((Integer)objectType).intValue();
  if (SanityManager.DEBUG) {
    SanityManager.ASSERT(objectOfPrivilege != null,"String_Node_Str");
  }
switch (this.objectType) {
case TABLE_PRIVILEGES:
    if (SanityManager.DEBUG) {
      SanityManager.ASSERT(specificPrivileges != null,"String_Node_Str");
    }
  objectName=(TableName)objectOfPrivilege;
this.specificPrivileges=(TablePrivilegesNode)specificPrivileges;
break;
case ROUTINE_PRIVILEGES:
if (SanityManager.DEBUG) {
SanityManager.ASSERT(specificPrivileges == null,"String_Node_Str");
}
routineDesignator=(RoutineDesignator)objectOfPrivilege;
objectName=routineDesignator.name;
break;
default :
if (SanityManager.DEBUG) {
SanityManager.THROWASSERT("String_Node_Str" + this.objectType);
}
}
}
Program: 80074
Project: 80074
Buggy source:
/** 
 * Reports an unexpected error and the access count for the specified worker thread.
 * @param id worker thread id, must be in the range [0, threadCount>
 * @param accessCount number of successful accesses made to the db
 * @param SQL
 */
public synchronized void reportError(int id,int accessCount,Throwable error){
  reportAccessCount(id,accessCount);
  exceptions[id]=error;
  hasExceptions=true;
  dumpToFile(id,error);
}

Fixed version (ground truth):
/** 
 * Reports an unexpected error and the access count for the specified worker thread.
 * @param id worker thread id, must be in the range [0, threadCount>
 * @param accessCount number of successful accesses made to the db
 * @param error error to report
 */
public synchronized void reportError(int id,int accessCount,Throwable error){
  reportAccessCount(id,accessCount);
  exceptions[id]=error;
  hasExceptions=true;
  dumpToFile(id,error);
}
Program: 80075
Project: 80075
Buggy source:
/** 
 * Obtains a reader for the specified file.
 * @param file the file to obtain a reader for
 * @return An unbuffered reader for the specified file.
 * @throws FileNotFoundException if the specified file does not exist
 * @throws SecurityException if the required privileges to read the fileare missing
 */
public static FileReader getFileReader(final File file) throws FileNotFoundException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return (FileReader)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws FileNotFoundException {
        return new FileReader(file);
      }
    }
);
  }
 catch (  PrivilegedActionException pae) {
    throw (FileNotFoundException)pae.getCause();
  }
}

Fixed version (ground truth):
/** 
 * Obtains a reader for the specified file.
 * @param file the file to obtain a reader for
 * @return An unbuffered reader for the specified file.
 * @throws FileNotFoundException if the specified file does not exist
 * @throws SecurityException if the required permissions to read the file,or the path it is in, are missing
 */
public static FileReader getFileReader(final File file) throws FileNotFoundException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return (FileReader)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws FileNotFoundException {
        return new FileReader(file);
      }
    }
);
  }
 catch (  PrivilegedActionException pae) {
    throw (FileNotFoundException)pae.getCause();
  }
}
Program: 80076
Project: 80076
Buggy source:
public static FileInputStream getFileInputStream(final File file) throws SecurityException, FileNotFoundException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return ((FileInputStream)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws SecurityException, FileNotFoundException {
        return new FileInputStream(file);
      }
    }
));
  }
 catch (  PrivilegedActionException pae) {
    throw (SecurityException)pae.getException();
  }
}

Fixed version (ground truth):
/** 
 * Returns a input stream for the specified file.
 * @param file the file to open a stream for
 * @return A input stream reading from the specified file.
 * @throws SecurityException if the required permissions to read the file,or the path it is in, are missing
 * @throws FileNotFoundException if the specified file does not exist
 */
public static FileInputStream getFileInputStream(final File file) throws FileNotFoundException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return ((FileInputStream)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws FileNotFoundException {
        return new FileInputStream(file);
      }
    }
));
  }
 catch (  PrivilegedActionException pae) {
    throw (FileNotFoundException)pae.getException();
  }
}
Program: 80077
Project: 80077
Buggy source:
/** 
 * Get the file length.
 * @return byte length of the file.
 * @throws SecurityException if the required permissions to read the file,or the path it is in, are missing
 * @see File#length
 */
public static long length(final File file) throws SecurityException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return ((Long)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws SecurityException {
        return new Long(file.length());
      }
    }
)).longValue();
  }
 catch (  PrivilegedActionException pae) {
    throw (SecurityException)pae.getException();
  }
}

Fixed version (ground truth):
/** 
 * Get the file length.
 * @return Byte length of the file.
 * @throws SecurityException if the required permissions to read the file,or the path it is in, are missing
 * @see File#length
 */
public static long length(final File file) throws SecurityException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return ((Long)AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      return new Long(file.length());
    }
  }
)).longValue();
}
Program: 80078
Project: 80078
Buggy source:
/** 
 * Check if the file exists.
 * @return <code>true</code> if file exists, <code>false</code> otherwise
 * @throws SecurityException if the required permissions to read the file,or the path it is in, are missing
 * @see File#exists
 */
public static boolean exists(final File file) throws SecurityException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    return ((Boolean)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      public Object run() throws SecurityException {
        return new Boolean(file.exists());
      }
    }
)).booleanValue();
  }
 catch (  PrivilegedActionException pae) {
    throw (SecurityException)pae.getException();
  }
}

Fixed version (ground truth):
/** 
 * Check if the file exists.
 * @return {@code true} if file exists, {@code false} otherwise
 * @throws SecurityException if the required permissions to read the file,or the path it is in, are missing
 * @see File#exists
 */
public static boolean exists(final File file) throws SecurityException {
  if (file == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return ((Boolean)AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      return new Boolean(file.exists());
    }
  }
)).booleanValue();
}
Program: 80079
Project: 80079
Buggy source:
/** 
 * Tests that the data updated in a Clob is always reflected in the Reader got. Here the updates are done using both a Writer obtained from this Clob and using Clob.setString.
 * @throws Exception
 */
public void testGetCharacterStreamClobUpdates() throws Exception {
  String str1="String_Node_Str";
  String str2="String_Node_Str";
  Clob clob=getConnection().createClob();
  Reader r_BeforeWrite=clob.getCharacterStream();
  Writer w=clob.setCharacterStream(1);
  char[] chars_str1=new char[str1.length()];
  str2.getChars(0,str1.length(),chars_str1,0);
  w.write(chars_str1);
  clob.setString((str1.getBytes().length) + 1,str2);
  Reader r_AfterWrite=clob.getCharacterStream();
  assertEquals(r_BeforeWrite,r_AfterWrite);
}

Fixed version (ground truth):
/** 
 * Tests that the data updated in a Clob is always reflected in the Reader got. Here the updates are done using both a Writer obtained from this Clob and using Clob.setString.
 * @throws Exception
 */
public void testGetCharacterStreamClobUpdates() throws Exception {
  String str1="String_Node_Str";
  String str2="String_Node_Str";
  Clob clob=getConnection().createClob();
  Reader r_BeforeWrite=clob.getCharacterStream();
  Writer w=clob.setCharacterStream(1);
  char[] chars_str1=new char[str1.length()];
  str2.getChars(0,str1.length(),chars_str1,0);
  w.write(chars_str1);
  clob.setString((str1.length()) + 1,str2);
  Reader r_AfterWrite=clob.getCharacterStream();
  assertEquals(r_BeforeWrite,r_AfterWrite);
}
Program: 80080
Project: 80080
Buggy source:
/** 
 * Test fix for derby-1382. Test that the getBlob() returns the correct value for the blob before and after updating the blob when using result sets of type TYPE_SCROLL_INSENSITIVE.
 * @throws Exception
 */
public void testGetBlobBeforeAndAfterUpdate() throws Exception {
  String blobData="String_Node_Str";
  PreparedStatement ps=prepareStatement("String_Node_Str");
  for (int i=0; i < 10; i++) {
    ps.setInt(1,i);
    ps.setBytes(2,(blobData + i).getBytes());
    ps.execute();
  }
  ps.close();
  Statement scrollStmt=createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
  ResultSet rs=scrollStmt.executeQuery("String_Node_Str");
  rs.first();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.next();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.relative(3);
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.absolute(7);
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.previous();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.last();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.previous();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.close();
  scrollStmt.close();
}

Fixed version (ground truth):
/** 
 * Test fix for derby-1382. Test that the getBlob() returns the correct value for the blob before and after updating the blob when using result sets of type TYPE_SCROLL_INSENSITIVE.
 * @throws Exception
 */
public void testGetBlobBeforeAndAfterUpdate() throws Exception {
  String blobData="String_Node_Str";
  PreparedStatement ps=prepareStatement("String_Node_Str");
  for (int i=0; i < 10; i++) {
    ps.setInt(1,i);
    ps.setBytes(2,(blobData + i).getBytes("String_Node_Str"));
    ps.execute();
  }
  ps.close();
  Statement scrollStmt=createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
  ResultSet rs=scrollStmt.executeQuery("String_Node_Str");
  rs.first();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.next();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.relative(3);
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.absolute(7);
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.previous();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.last();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.previous();
  checkContentsBeforeAndAfterUpdatingBlob(rs);
  rs.close();
  scrollStmt.close();
}
Program: 80081
Project: 80081
Buggy source:
private void checkContentsBeforeAndAfterUpdatingBlob(ResultSet rs) throws SQLException {
  Blob b;
  byte[] value, expectedValue;
  String blobData="String_Node_Str";
  String updatedBlobData="String_Node_Str";
  b=rs.getBlob(2);
  value=b.getBytes(1,blobData.length() + 1);
  expectedValue=(blobData + rs.getInt(1)).getBytes();
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
  value=(updatedBlobData + rs.getInt(1)).getBytes();
  b.setBytes(1,value);
  rs.updateBlob(2,b);
  rs.updateRow();
  rs.next();
  rs.previous();
  b=rs.getBlob(2);
  value=b.getBytes(1,updatedBlobData.length() + 1);
  expectedValue=(updatedBlobData + rs.getInt(1)).getBytes();
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
}

Fixed version (ground truth):
private void checkContentsBeforeAndAfterUpdatingBlob(ResultSet rs) throws SQLException, UnsupportedEncodingException {
  Blob b;
  byte[] value, expectedValue;
  String blobData="String_Node_Str";
  String updatedBlobData="String_Node_Str";
  b=rs.getBlob(2);
  value=b.getBytes(1,blobData.length() + 1);
  expectedValue=(blobData + rs.getInt(1)).getBytes("String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
  value=(updatedBlobData + rs.getInt(1)).getBytes("String_Node_Str");
  b.setBytes(1,value);
  rs.updateBlob(2,b);
  rs.updateRow();
  rs.next();
  rs.previous();
  b=rs.getBlob(2);
  value=b.getBytes(1,updatedBlobData.length() + 1);
  expectedValue=(updatedBlobData + rs.getInt(1)).getBytes("String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
}
Program: 80082
Project: 80082
Buggy source:
/** 
 * Test fix for derby-1421. Test that the getBlob() returns the correct value for the blob before and after updating the blob using the method updateBinaryStream().
 * @throws Exception
 */
public void testGetBlobBeforeAndAfterUpdateStream() throws Exception {
  String blobData="String_Node_Str";
  PreparedStatement ps=prepareStatement("String_Node_Str");
  for (int i=0; i < 10; i++) {
    ps.setInt(1,i);
    ps.setBytes(2,(blobData + i).getBytes());
    ps.execute();
  }
  ps.close();
  Statement scrollStmt=createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
  ResultSet rs=scrollStmt.executeQuery("String_Node_Str");
  rs.first();
  updateBlobWithUpdateBinaryStream(rs);
  rs.next();
  updateBlobWithUpdateBinaryStream(rs);
  rs.relative(3);
  updateBlobWithUpdateBinaryStream(rs);
  rs.absolute(7);
  updateBlobWithUpdateBinaryStream(rs);
  rs.previous();
  updateBlobWithUpdateBinaryStream(rs);
  rs.last();
  updateBlobWithUpdateBinaryStream(rs);
  rs.previous();
  updateBlobWithUpdateBinaryStream(rs);
  rs.close();
  scrollStmt.close();
}

Fixed version (ground truth):
/** 
 * Test fix for derby-1421. Test that the getBlob() returns the correct value for the blob before and after updating the blob using the method updateBinaryStream().
 * @throws Exception
 */
public void testGetBlobBeforeAndAfterUpdateStream() throws Exception {
  String blobData="String_Node_Str";
  PreparedStatement ps=prepareStatement("String_Node_Str");
  for (int i=0; i < 10; i++) {
    ps.setInt(1,i);
    ps.setBytes(2,(blobData + i).getBytes("String_Node_Str"));
    ps.execute();
  }
  ps.close();
  Statement scrollStmt=createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
  ResultSet rs=scrollStmt.executeQuery("String_Node_Str");
  rs.first();
  updateBlobWithUpdateBinaryStream(rs);
  rs.next();
  updateBlobWithUpdateBinaryStream(rs);
  rs.relative(3);
  updateBlobWithUpdateBinaryStream(rs);
  rs.absolute(7);
  updateBlobWithUpdateBinaryStream(rs);
  rs.previous();
  updateBlobWithUpdateBinaryStream(rs);
  rs.last();
  updateBlobWithUpdateBinaryStream(rs);
  rs.previous();
  updateBlobWithUpdateBinaryStream(rs);
  rs.close();
  scrollStmt.close();
}
Program: 80083
Project: 80083
Buggy source:
private void updateBlobWithUpdateBinaryStream(ResultSet rs) throws SQLException {
  Blob b;
  byte[] value, expectedValue;
  String blobData="String_Node_Str";
  String updatedBlobData="String_Node_Str";
  b=rs.getBlob(2);
  value=b.getBytes(1,blobData.length() + 1);
  expectedValue=(blobData + rs.getInt(1)).getBytes();
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
  value=(updatedBlobData + rs.getInt(1)).getBytes();
  InputStream updateValue=new ByteArrayInputStream(value);
  rs.updateBinaryStream(2,updateValue,value.length);
  rs.updateRow();
  rs.next();
  rs.previous();
  b=rs.getBlob(2);
  value=b.getBytes(1,updatedBlobData.length() + 1);
  expectedValue=(updatedBlobData + rs.getInt(1)).getBytes();
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
}

Fixed version (ground truth):
private void updateBlobWithUpdateBinaryStream(ResultSet rs) throws SQLException, UnsupportedEncodingException {
  Blob b;
  byte[] value, expectedValue;
  String blobData="String_Node_Str";
  String updatedBlobData="String_Node_Str";
  b=rs.getBlob(2);
  value=b.getBytes(1,blobData.length() + 1);
  expectedValue=(blobData + rs.getInt(1)).getBytes("String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
  value=(updatedBlobData + rs.getInt(1)).getBytes("String_Node_Str");
  InputStream updateValue=new ByteArrayInputStream(value);
  rs.updateBinaryStream(2,updateValue,value.length);
  rs.updateRow();
  rs.next();
  rs.previous();
  b=rs.getBlob(2);
  value=b.getBytes(1,updatedBlobData.length() + 1);
  expectedValue=(updatedBlobData + rs.getInt(1)).getBytes("String_Node_Str");
  assertTrue("String_Node_Str",Arrays.equals(value,expectedValue));
}
Program: 80086
Project: 80086
Buggy source:
public static Test baseSuite(String name){
  TestSuite suite=new TestSuite(name);
  suite.addTestSuite(LargeDataLocksTest.class);
  return new CleanDatabaseTestSetup(suite){
    /** 
 * Create and populate table
 * @see org.apache.derbyTesting.junit.CleanDatabaseTestSetup#decorateSQL(java.sql.Statement)
 */
    protected void decorateSQL(    Statement s) throws SQLException {
      Connection conn=getConnection();
      conn.setAutoCommit(false);
      PreparedStatement ps=null;
      String sql;
      sql="String_Node_Str";
      s.executeUpdate(sql);
      sql="String_Node_Str";
      ps=conn.prepareStatement(sql);
      ps.setCharacterStream(1,new java.io.StringReader(Utilities.repeatChar("String_Node_Str",38000)),38000);
      ps.setBytes(2,Utilities.repeatChar("String_Node_Str",38000).getBytes());
      ps.setInt(3,38000);
      ps.executeUpdate();
      ps.close();
      conn.commit();
    }
  }
;
}

Fixed version (ground truth):
public static Test baseSuite(String name){
  TestSuite suite=new TestSuite(name);
  suite.addTestSuite(LargeDataLocksTest.class);
  return new CleanDatabaseTestSetup(suite){
    /** 
 * Create and populate table
 * @see org.apache.derbyTesting.junit.CleanDatabaseTestSetup#decorateSQL(java.sql.Statement)
 */
    protected void decorateSQL(    Statement s) throws SQLException {
      Connection conn=getConnection();
      conn.setAutoCommit(false);
      PreparedStatement ps=null;
      String sql;
      sql="String_Node_Str";
      s.executeUpdate(sql);
      sql="String_Node_Str";
      ps=conn.prepareStatement(sql);
      ps.setCharacterStream(1,new java.io.StringReader(Utilities.repeatChar("String_Node_Str",38000)),38000);
      try {
        ps.setBytes(2,Utilities.repeatChar("String_Node_Str",38000).getBytes("String_Node_Str"));
      }
 catch (      UnsupportedEncodingException ue) {
        BaseTestCase.fail(ue.getMessage(),ue);
      }
      ps.setInt(3,38000);
      ps.executeUpdate();
      ps.close();
      conn.commit();
    }
  }
;
}
Program: 80087
Project: 80087
Buggy source:
/** 
 * Create and populate table
 * @see org.apache.derbyTesting.junit.CleanDatabaseTestSetup#decorateSQL(java.sql.Statement)
 */
protected void decorateSQL(Statement s) throws SQLException {
  Connection conn=getConnection();
  conn.setAutoCommit(false);
  PreparedStatement ps=null;
  String sql;
  sql="String_Node_Str";
  s.executeUpdate(sql);
  sql="String_Node_Str";
  ps=conn.prepareStatement(sql);
  ps.setCharacterStream(1,new java.io.StringReader(Utilities.repeatChar("String_Node_Str",38000)),38000);
  ps.setBytes(2,Utilities.repeatChar("String_Node_Str",38000).getBytes());
  ps.setInt(3,38000);
  ps.executeUpdate();
  ps.close();
  conn.commit();
}

Fixed version (ground truth):
/** 
 * Create and populate table
 * @see org.apache.derbyTesting.junit.CleanDatabaseTestSetup#decorateSQL(java.sql.Statement)
 */
protected void decorateSQL(Statement s) throws SQLException {
  Connection conn=getConnection();
  conn.setAutoCommit(false);
  PreparedStatement ps=null;
  String sql;
  sql="String_Node_Str";
  s.executeUpdate(sql);
  sql="String_Node_Str";
  ps=conn.prepareStatement(sql);
  ps.setCharacterStream(1,new java.io.StringReader(Utilities.repeatChar("String_Node_Str",38000)),38000);
  try {
    ps.setBytes(2,Utilities.repeatChar("String_Node_Str",38000).getBytes("String_Node_Str"));
  }
 catch (  UnsupportedEncodingException ue) {
    BaseTestCase.fail(ue.getMessage(),ue);
  }
  ps.setInt(3,38000);
  ps.executeUpdate();
  ps.close();
  conn.commit();
}
Program: 80088
Project: 80088
Buggy source:
public void testEarlyEndOfFile() throws Exception {
  Connection c=getConnection();
  try {
    doImportFromFile(c,"String_Node_Str","String_Node_Str",null,null,null,0);
  }
 catch (  SQLException e) {
    assertSQLState("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void testEarlyEndOfFile() throws Exception {
  Connection c=getConnection();
  try {
    doImportFromFile(c,"String_Node_Str","String_Node_Str",null,null,"String_Node_Str",0);
  }
 catch (  SQLException e) {
    assertSQLState("String_Node_Str",e);
  }
}
Program: 80089
Project: 80089
Buggy source:
/** 
 * Test killing master during replication.
 * @throws Exception
 */
public void testKillMaster() throws Exception {
  System.out.println("String_Node_Str" + getTestConfiguration().getJDBCClient().getJDBCDriverName());
  Connection conn=getConnection();
  Statement s=conn.createStatement();
  s.executeUpdate("String_Node_Str");
  PreparedStatement pSt=prepareStatement("String_Node_Str");
  int i=0;
  try {
    for (; i < 1000; i++) {
      pSt.setInt(1,i);
      pSt.setString(2,"String_Node_Str" + i);
      pSt.execute();
      System.out.println("String_Node_Str" + i);
      if (i == 500) {
        repRun.killMaster(masterServerHost,masterServerPort);
      }
    }
  }
 catch (  SQLException se) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ se.getMessage()+ "String_Node_Str");
    if (i <= 500) {
      fail("String_Node_Str" + i + "String_Node_Str"+ se.getMessage()+ "String_Node_Str");
    }
  }
  conn.close();
  Thread.sleep(5000L);
  repRun.startServer(masterJvmVersion,derbyMasterVersion,masterServerHost,ReplicationRun.ALL_INTERFACES,masterServerPort,ReplicationRun.masterDatabasePath + File.separator + ReplicationRun.masterDbSubPath);
  conn=getConnection();
  s=conn.createStatement();
  ResultSet rs=s.executeQuery("String_Node_Str");
  rs.next();
  int count=rs.getInt(1);
  System.out.println("String_Node_Str" + count);
}

Fixed version (ground truth):
/** 
 * Test killing master during replication.
 * @throws Exception
 */
public void testKillMaster() throws Exception {
  System.out.println("String_Node_Str" + getTestConfiguration().getJDBCClient().getJDBCDriverName());
  Connection conn=getConnection();
  Statement s=conn.createStatement();
  s.executeUpdate("String_Node_Str");
  PreparedStatement pSt=prepareStatement("String_Node_Str");
  int i=0;
  try {
    for (; i < 1000; i++) {
      pSt.setInt(1,i);
      pSt.setString(2,"String_Node_Str" + i);
      pSt.execute();
      System.out.println("String_Node_Str" + i);
      if (i == 500) {
        repRun.killMaster(masterServerHost,masterServerPort);
      }
    }
  }
 catch (  SQLException se) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ se.getMessage()+ "String_Node_Str");
    if (i <= 500) {
      fail("String_Node_Str" + i + "String_Node_Str"+ se.getMessage()+ "String_Node_Str");
    }
  }
  conn.close();
  Thread.sleep(5000L);
  repRun.startServer(masterJvmVersion,derbyMasterVersion,masterServerHost,ReplicationRun.ALL_INTERFACES,masterServerPort,ReplicationRun.masterDbSubPath);
  conn=getConnection();
  s=conn.createStatement();
  ResultSet rs=s.executeQuery("String_Node_Str");
  rs.next();
  int count=rs.getInt(1);
  System.out.println("String_Node_Str" + count);
}
Program: 80090
Project: 80090
Buggy source:
public void run(){
  Process proc=null;
  try {
    util.DEBUG(debugId + "String_Node_Str");
    proc=Runtime.getRuntime().exec(localCommand,envElements,workingDir);
    util.DEBUG(debugId + "String_Node_Str");
    processDEBUGOutput(debugId + "String_Node_Str",proc);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  Process proc=null;
  try {
    util.DEBUG(debugId + "String_Node_Str");
    proc=Runtime.getRuntime().exec(localCommand,fEnvElements,workingDir);
    util.DEBUG(debugId + "String_Node_Str");
    processDEBUGOutput(debugId + "String_Node_Str",proc);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 80093
Project: 80093
Buggy source:
private NetworkServerControl startServer_direct(String serverHost,String interfacesToListenOn,int serverPort,String fullDbDirPath,String securityOption) throws Exception {
  util.DEBUG("String_Node_Str" + serverHost + "String_Node_Str"+ interfacesToListenOn+ "String_Node_Str"+ serverPort+ "String_Node_Str"+ fullDbDirPath);
  assertTrue("String_Node_Str" + serverHost,serverHost.equalsIgnoreCase("String_Node_Str"));
  System.setProperty("String_Node_Str",fullDbDirPath);
  System.setProperty("String_Node_Str",fullDbDirPath);
  NetworkServerControl server=new NetworkServerControl(InetAddress.getByName(interfacesToListenOn),serverPort);
  server.start(null);
  pingServer(serverHost,serverPort,5);
  Properties sp=server.getCurrentProperties();
  sp.setProperty("String_Node_Str",securityOption.equalsIgnoreCase("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
  return server;
}

Fixed version (ground truth):
private NetworkServerControl startServer_direct(String serverHost,String interfacesToListenOn,int serverPort,String fullDbDirPath,String securityOption) throws Exception {
  util.DEBUG("String_Node_Str" + serverHost + "String_Node_Str"+ interfacesToListenOn+ "String_Node_Str"+ serverPort+ "String_Node_Str"+ fullDbDirPath);
  assertTrue("String_Node_Str" + serverHost,serverHost.equalsIgnoreCase("String_Node_Str"));
  System.setProperty("String_Node_Str",fullDbDirPath);
  System.setProperty("String_Node_Str",fullDbDirPath);
  NetworkServerControl server=new NetworkServerControl(InetAddress.getByName(interfacesToListenOn),serverPort);
  server.start(null);
  pingServer(serverHost,serverPort,15);
  Properties sp=server.getCurrentProperties();
  sp.setProperty("String_Node_Str",securityOption.equalsIgnoreCase("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
  return server;
}
Program: 80094
Project: 80094
Buggy source:
private void runUserCommandLocally(String command,String userDir,String ID){
  util.DEBUG("String_Node_Str");
  final String debugId="String_Node_Str" + ID + "String_Node_Str";
  util.DEBUG("String_Node_Str" + command + "String_Node_Str"+ userDir);
  String workingDirName=userDir;
  util.DEBUG(debugId + "String_Node_Str" + workingDirName);
  String tmp="String_Node_Str";
  util.DEBUG(debugId + command);
  final String fullCmd=command;
  String[] envElements={"String_Node_Str"};
  tmp="String_Node_Str";
  for (int i=0; i < envElements.length; i++) {
    tmp=tmp + envElements[i] + "String_Node_Str";
  }
  util.DEBUG(debugId + "String_Node_Str" + tmp);
  final File workingDir=new File(workingDirName);
  String shellCmd=fullCmd;
{
    final String localCommand=shellCmd;
    util.DEBUG(debugId + "String_Node_Str" + localCommand);
    try {
      Process proc=Runtime.getRuntime().exec(localCommand,envElements,workingDir);
      processDEBUGOutput(debugId + "String_Node_Str",proc);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  util.DEBUG(debugId + "String_Node_Str");
  util.DEBUG("String_Node_Str");
}

Fixed version (ground truth):
private void runUserCommandLocally(String command,String userDir,String ID){
  util.DEBUG("String_Node_Str");
  final String debugId="String_Node_Str" + ID + "String_Node_Str";
  util.DEBUG("String_Node_Str" + command + "String_Node_Str"+ userDir);
  String workingDirName=userDir;
  util.DEBUG(debugId + "String_Node_Str" + workingDirName);
  String tmp="String_Node_Str";
  util.DEBUG(debugId + command);
  final String fullCmd=command;
  String[] envElements=null;
  final File workingDir=new File(workingDirName);
  String shellCmd=fullCmd;
{
    final String localCommand=shellCmd;
    util.DEBUG(debugId + "String_Node_Str" + localCommand);
    try {
      Process proc=Runtime.getRuntime().exec(localCommand,envElements,workingDir);
      processDEBUGOutput(debugId + "String_Node_Str",proc);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  util.DEBUG(debugId + "String_Node_Str");
  util.DEBUG("String_Node_Str");
}
Program: 80095
Project: 80095
Buggy source:
void restartServer(String serverVM,String serverVersion,String serverHost,String interfacesToListenOn,int serverPort,String fullDbDirPath) throws Exception {
  stopServer(serverVM,serverVersion,serverHost,serverPort);
  startServer(serverVM,serverVersion,serverHost,interfacesToListenOn,serverPort,fullDbDirPath);
}

Fixed version (ground truth):
void restartServer(String serverVM,String serverVersion,String serverHost,String interfacesToListenOn,int serverPort,String dbSubDirPath) throws Exception {
  stopServer(serverVM,serverVersion,serverHost,serverPort);
  startServer(serverVM,serverVersion,serverHost,interfacesToListenOn,serverPort,dbSubDirPath);
}
Program: 80096
Project: 80096
Buggy source:
public void testReplication() throws Exception {
  cleanAllTestHosts();
  initEnvironment();
  initMaster(masterServerHost,replicatedDb);
  masterServer=startServer(masterJvmVersion,derbyMasterVersion,masterServerHost,ALL_INTERFACES,masterServerPort,masterDatabasePath + FS + masterDbSubPath);
  slaveServer=startServer(slaveJvmVersion,derbySlaveVersion,slaveServerHost,ALL_INTERFACES,slaveServerPort,slaveDatabasePath + FS + slaveDbSubPath);
  startServerMonitor(slaveServerHost);
  bootMasterDatabase(jvmVersion,masterDatabasePath + FS + masterDbSubPath,replicatedDb,masterServerHost,masterServerPort,null);
  initSlave(slaveServerHost,jvmVersion,replicatedDb);
  startSlave(jvmVersion,replicatedDb,slaveServerHost,slaveServerPort,slaveServerHost,slaveReplPort,testClientHost);
  startMaster(jvmVersion,replicatedDb,masterServerHost,masterServerPort,masterServerHost,slaveServerPort,slaveServerHost,slaveReplPort);
  runTest(replicationTest,jvmVersion,testClientHost,masterServerHost,masterServerPort,replicatedDb);
  failOver(jvmVersion,masterDatabasePath,masterDbSubPath,replicatedDb,masterServerHost,masterServerPort,testClientHost);
  connectPing(slaveDatabasePath + FS + slaveDbSubPath+ FS+ replicatedDb,slaveServerHost,slaveServerPort,testClientHost);
  verifySlave();
  verifyMaster();
  stopServer(jvmVersion,derbyVersion,slaveServerHost,slaveServerPort);
  stopServer(jvmVersion,derbyVersion,masterServerHost,masterServerPort);
}

Fixed version (ground truth):
public void testReplication() throws Exception {
  cleanAllTestHosts();
  initEnvironment();
  initMaster(masterServerHost,replicatedDb);
  masterServer=startServer(masterJvmVersion,derbyMasterVersion,masterServerHost,ALL_INTERFACES,masterServerPort,masterDbSubPath);
  slaveServer=startServer(slaveJvmVersion,derbySlaveVersion,slaveServerHost,ALL_INTERFACES,slaveServerPort,slaveDbSubPath);
  startServerMonitor(slaveServerHost);
  bootMasterDatabase(jvmVersion,masterDatabasePath + FS + masterDbSubPath,replicatedDb,masterServerHost,masterServerPort,null);
  initSlave(slaveServerHost,jvmVersion,replicatedDb);
  startSlave(jvmVersion,replicatedDb,slaveServerHost,slaveServerPort,slaveServerHost,slaveReplPort,testClientHost);
  startMaster(jvmVersion,replicatedDb,masterServerHost,masterServerPort,masterServerHost,slaveServerPort,slaveServerHost,slaveReplPort);
  runTest(replicationTest,jvmVersion,testClientHost,masterServerHost,masterServerPort,replicatedDb);
  failOver(jvmVersion,masterDatabasePath,masterDbSubPath,replicatedDb,masterServerHost,masterServerPort,testClientHost);
  connectPing(slaveDatabasePath + FS + slaveDbSubPath+ FS+ replicatedDb,slaveServerHost,slaveServerPort,testClientHost);
  verifySlave();
  verifyMaster();
  stopServer(jvmVersion,derbyVersion,slaveServerHost,slaveServerPort);
  stopServer(jvmVersion,derbyVersion,masterServerHost,masterServerPort);
}
Program: 80099
Project: 80099
Buggy source:
private void _testPreStartedSlaveServer(){
  Connection conn=null;
  String db=slaveDatabasePath + "String_Node_Str" + ReplicationRun.slaveDbSubPath+ "String_Node_Str"+ replicatedDb;
  String connectionURL="String_Node_Str" + "String_Node_Str" + slaveServerHost + "String_Node_Str"+ slaveServerPort+ "String_Node_Str"+ db+ "String_Node_Str"+ "String_Node_Str"+ slaveServerHost+ "String_Node_Str"+ slaveServerPort;
  util.DEBUG("String_Node_Str" + connectionURL);
  try {
    conn=DriverManager.getConnection(connectionURL);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG("String_Node_Str" + msg);
    assertTrue("String_Node_Str" + msg,"String_Node_Str".equals(ss));
    util.DEBUG("String_Node_Str");
    return;
  }
  assertTrue("String_Node_Str" + db + "String_Node_Str",false);
}

Fixed version (ground truth):
private void _testPreStartedSlaveServer(){
  Connection conn=null;
  String db=slaveDatabasePath + FS + ReplicationRun.slaveDbSubPath+ FS+ replicatedDb;
  String connectionURL="String_Node_Str" + "String_Node_Str" + slaveServerHost + "String_Node_Str"+ slaveServerPort+ "String_Node_Str"+ db+ "String_Node_Str"+ "String_Node_Str"+ slaveServerHost+ "String_Node_Str"+ slaveServerPort;
  util.DEBUG("String_Node_Str" + connectionURL);
  try {
    conn=DriverManager.getConnection(connectionURL);
  }
 catch (  SQLException se) {
    int ec=se.getErrorCode();
    String ss=se.getSQLState();
    String msg=ec + "String_Node_Str" + ss+ "String_Node_Str"+ se.getMessage();
    util.DEBUG("String_Node_Str" + msg);
    assertTrue("String_Node_Str" + msg,"String_Node_Str".equals(ss));
    util.DEBUG("String_Node_Str");
    return;
  }
  assertTrue("String_Node_Str" + db + "String_Node_Str",false);
}