nus-yam/ex-repair huggingface dataset:
Program: 79976
Project: 79976
Buggy source:
public void clean(boolean forRemove) throws StandardException {
  if (_sequenceGenerator != null) {
    boolean gapClosed=updateCurrentValueOnDisk(null,peekAtCurrentValue());
    if (!gapClosed) {
      String errorMessage=MessageService.getTextMessage(SQLState.LANG_CANT_FLUSH_PREALLOCATOR,_sequenceGenerator.getSchemaName(),_sequenceGenerator.getName());
      Monitor.getStream().println(errorMessage);
    }
  }
  _uuidString=null;
  _sequenceGenerator=null;
}

Fixed version (ground truth):
public void clean(boolean forRemove) throws StandardException {
  boolean gapClosed=false;
  try {
    if (_sequenceGenerator == null) {
      gapClosed=true;
    }
 else {
      gapClosed=updateCurrentValueOnDisk(null,peekAtCurrentValue());
    }
  }
 catch (  StandardException se) {
    if (!SQLState.LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE.equals(se.getMessageId())) {
      throw se;
    }
  }
 finally {
    if (!gapClosed) {
      String errorMessage=MessageService.getTextMessage(SQLState.LANG_CANT_FLUSH_PREALLOCATOR,_sequenceGenerator.getSchemaName(),_sequenceGenerator.getName());
      Monitor.getStream().println(errorMessage);
    }
    _uuidString=null;
    _sequenceGenerator=null;
  }
}
Program: 79977
Project: 79977
Buggy source:
/** 
 * Check table name and then clear it from the result set columns.
 * @exception StandardExcepion if invalid column/table is specified.
 */
private void checkTableNameAndScrubResultColumns(ResultColumnList rcl) throws StandardException {
  for (  ResultColumn column : rcl) {
    boolean foundMatchingTable=false;
    if (column.getTableName() != null) {
      for (      ResultSetNode rsn : ((SelectNode)resultSet).fromList) {
        FromTable fromTable=(FromTable)rsn;
        final String tableName;
        if (fromTable instanceof CurrentOfNode) {
          tableName=((CurrentOfNode)fromTable).getBaseCursorTargetTableName().getTableName();
        }
 else {
          tableName=fromTable.getBaseTableName();
        }
        if (column.getTableName().equals(tableName)) {
          foundMatchingTable=true;
          break;
        }
      }
      if (!foundMatchingTable) {
        throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND,column.getTableName() + "String_Node_Str" + column.getName());
      }
    }
    column.clearTableName();
  }
}

Fixed version (ground truth):
/** 
 * Check table name and then clear it from the result set columns.
 * @exception StandardExcepion if invalid column/table is specified.
 */
private void checkTableNameAndScrubResultColumns(ResultColumnList rcl) throws StandardException {
  for (  ResultColumn column : rcl) {
    boolean foundMatchingTable=false;
    if ((column.getTableName() != null) && (!inMatchingClause())) {
      for (      ResultSetNode rsn : ((SelectNode)resultSet).fromList) {
        FromTable fromTable=(FromTable)rsn;
        final String tableName;
        if (fromTable instanceof CurrentOfNode) {
          tableName=((CurrentOfNode)fromTable).getBaseCursorTargetTableName().getTableName();
        }
 else {
          tableName=fromTable.getBaseTableName();
        }
        if (column.getTableName().equals(tableName)) {
          foundMatchingTable=true;
          break;
        }
      }
      if (!foundMatchingTable) {
        throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND,column.getTableName() + "String_Node_Str" + column.getName());
      }
    }
    column.clearTableName();
  }
}
Program: 79978
Project: 79978
Buggy source:
/** 
 * Construct top level suite in this JUnit test
 */
public static Test suite(){
  String luceneVersion=getSystemProperty(LUCENE_VERSION_PROPERTY);
  if (luceneVersion != null) {
    LUCENE_VERSION=luceneVersion;
  }
  TestSuite suite=(TestSuite)TestConfiguration.embeddedSuite(LuceneSupportPermsTest.class);
  Test localizedTest=new LocaleTestSetup(suite,new Locale(LANGUAGE,COUNTRY));
  Test secureTest=new SecurityManagerSetup(localizedTest,POLICY_FILE);
  Test authenticatedTest=DatabasePropertyTestSetup.builtinAuthentication(secureTest,LEGAL_USERS,"String_Node_Str");
  Test authorizedTest=TestConfiguration.sqlAuthorizationDecorator(authenticatedTest);
  return authorizedTest;
}

Fixed version (ground truth):
/** 
 * Construct top level suite in this JUnit test
 */
public static Test suite(){
  String luceneVersion=getSystemProperty(LUCENE_VERSION_PROPERTY);
  if (luceneVersion != null) {
    LUCENE_VERSION=luceneVersion;
  }
  TestSuite suite=(TestSuite)TestConfiguration.embeddedSuite(LuceneSupportPermsTest.class);
  Test secureTest=new SecurityManagerSetup(suite,POLICY_FILE);
  Test authenticatedTest=DatabasePropertyTestSetup.builtinAuthentication(secureTest,LEGAL_USERS,"String_Node_Str");
  Test authorizedTest=TestConfiguration.sqlAuthorizationDecorator(authenticatedTest);
  Test localizedTest=new LocaleTestSetup(authorizedTest,new Locale(LANGUAGE,COUNTRY));
  return localizedTest;
}
Program: 79979
Project: 79979
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(SecurityManagerSetup.noSecurityManager(TestConfiguration.embeddedSuite(LuceneSupportTest.class)));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  Test baseTest=TestConfiguration.embeddedSuite(LuceneSupportTest.class);
  Test localizedTest=new LocaleTestSetup(baseTest,new Locale("String_Node_Str","String_Node_Str"));
  suite.addTest(SecurityManagerSetup.noSecurityManager(localizedTest));
  return suite;
}
Program: 79980
Project: 79980
Buggy source:
public void testCreateAndQueryIndex() throws Exception {
  CallableStatement cSt;
  Statement s=createStatement();
  cSt=prepareCall("String_Node_Str");
  assertUpdateCount(cSt,0);
  String[][] expectedRows=new String[][]{{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str"),expectedRows);
  expectedRows=new String[][]{{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str"),expectedRows);
  JDBC.assertEmpty(s.executeQuery("String_Node_Str"));
  expectedRows=new String[][]{{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}};
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"),expectedRows);
  cSt=prepareCall("String_Node_Str");
  assertUpdateCount(cSt,0);
}

Fixed version (ground truth):
public void testCreateAndQueryIndex() throws Exception {
  CallableStatement cSt;
  Statement s=createStatement();
  getConnection().prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str").executeUpdate();
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str"),new String[][]{{"String_Node_Str"}});
  getConnection().prepareStatement("String_Node_Str").executeUpdate();
  cSt=prepareCall("String_Node_Str");
  assertUpdateCount(cSt,0);
  String[][] expectedRows=new String[][]{{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str"),expectedRows);
  expectedRows=new String[][]{{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str"),expectedRows);
  JDBC.assertEmpty(s.executeQuery("String_Node_Str"));
  expectedRows=new String[][]{{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}};
  JDBC.assertFullResultSet(s.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"),expectedRows);
  cSt=prepareCall("String_Node_Str");
  assertUpdateCount(cSt,0);
}
Program: 79981
Project: 79981
Buggy source:
/** 
 * <p> Test that only the DBO can (un)load the tool and the tool can't be (un)loaded twice. </p>
 */
public void test_003_loading() throws Exception {
  Connection dboConnection=openUserConnection(TEST_DBO);
  Connection ruthConnection=openUserConnection(RUTH);
  goodStatement(dboConnection,"String_Node_Str");
  expectExecutionError(ruthConnection,DBO_ONLY,LOAD_TOOL);
  goodStatement(dboConnection,LOAD_TOOL);
  expectExecutionError(dboConnection,DOUBLE_LOAD_ILLEGAL,LOAD_TOOL);
  expectExecutionError(ruthConnection,NOT_INDEXABLE,"String_Node_Str");
  expectExecutionError(ruthConnection,NOT_INDEXABLE,"String_Node_Str");
  expectExecutionError(ruthConnection,NOT_INDEXABLE,"String_Node_Str");
  expectExecutionError(ruthConnection,NONEXISTENT_OBJECT,"String_Node_Str");
  expectExecutionError(ruthConnection,NONEXISTENT_OBJECT,"String_Node_Str");
  expectExecutionError(ruthConnection,DBO_ONLY,UNLOAD_TOOL);
  goodStatement(dboConnection,"String_Node_Str");
  goodStatement(dboConnection,UNLOAD_TOOL);
  expectExecutionError(dboConnection,DOUBLE_UNLOAD_ILLEGAL,UNLOAD_TOOL);
  goodStatement(dboConnection,LOAD_TOOL);
  goodStatement(dboConnection,UNLOAD_TOOL);
}

Fixed version (ground truth):
/** 
 * <p> Test that only the DBO can (un)load the tool and the tool can't be (un)loaded twice. </p>
 */
public void test_003_loading() throws Exception {
  Connection dboConnection=openUserConnection(TEST_DBO);
  Connection ruthConnection=openUserConnection(RUTH);
  createSchema(ruthConnection,Types.INTEGER);
  goodStatement(dboConnection,"String_Node_Str");
  expectExecutionError(ruthConnection,DBO_ONLY,LOAD_TOOL);
  goodStatement(dboConnection,LOAD_TOOL);
  expectExecutionError(dboConnection,DOUBLE_LOAD_ILLEGAL,LOAD_TOOL);
  expectExecutionError(ruthConnection,NOT_INDEXABLE,"String_Node_Str");
  expectExecutionError(ruthConnection,NOT_INDEXABLE,"String_Node_Str");
  expectExecutionError(ruthConnection,NOT_INDEXABLE,"String_Node_Str");
  expectExecutionError(ruthConnection,NONEXISTENT_OBJECT,"String_Node_Str");
  expectExecutionError(ruthConnection,NONEXISTENT_OBJECT,"String_Node_Str");
  expectExecutionError(ruthConnection,DBO_ONLY,UNLOAD_TOOL);
  goodStatement(dboConnection,"String_Node_Str");
  goodStatement(dboConnection,UNLOAD_TOOL);
  expectExecutionError(dboConnection,DOUBLE_UNLOAD_ILLEGAL,UNLOAD_TOOL);
  goodStatement(dboConnection,LOAD_TOOL);
  goodStatement(dboConnection,UNLOAD_TOOL);
  dropSchema(ruthConnection);
}
Program: 79985
Project: 79985
Buggy source:
/** 
 * Function for making a byte array from an array of ints 
 */
public static Blob makeBlob(Integer... inputs){
  if (inputs == null) {
    return null;
  }
  byte[] retval=new byte[inputs.length];
  for (int i=0; i < inputs.length; i++) {
    retval[i]=(byte)inputs[i].intValue();
  }
  return new HarmonySerialBlob(retval);
}

Fixed version (ground truth):
/** 
 * Function for making a big Blob by repeating the inputs a number of times 
 */
public static Blob makeBlob(int repeatCount,int... inputs){
  if (inputs == null) {
    return null;
  }
  if ((inputs.length == 0) || (repeatCount == 0)) {
    return null;
  }
  byte[] retval=new byte[repeatCount * inputs.length];
  int idx=0;
  for (int i=0; i < repeatCount; i++) {
    for (    int val : inputs) {
      retval[idx++]=(byte)val;
    }
  }
  return new HarmonySerialBlob(retval);
}
Program: 79986
Project: 79986
Buggy source:
/** 
 * Write this object to a stream of stored objects.
 * @param out write bytes here.
 * @exception IOException		thrown on error
 */
public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(FIRST_VERSION);
  out.writeInt(_clauseType);
  out.writeUTF(_matchRefinementName);
  ArrayUtil.writeIntArray(out,_thenColumnOffsets);
  out.writeUTF(_resultSetFieldName);
  out.writeUTF(_actionMethodName);
  out.writeObject(_thenAction);
}

Fixed version (ground truth):
/** 
 * Write this object to a stream of stored objects.
 * @param out write bytes here.
 * @exception IOException		thrown on error
 */
public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(FIRST_VERSION);
  out.writeInt(_clauseType);
  out.writeObject(_matchRefinementName);
  ArrayUtil.writeIntArray(out,_thenColumnOffsets);
  out.writeObject(_resultSetFieldName);
  out.writeObject(_actionMethodName);
  out.writeObject(_thenAction);
}
Program: 79987
Project: 79987
Buggy source:
/** 
 * Read this object from a stream of stored objects.
 * @param in read this.
 * @exception IOException					thrown on error
 * @exception ClassNotFoundException		thrown on error
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  int oldVersion=in.readInt();
  _clauseType=in.readInt();
  _matchRefinementName=in.readUTF();
  _thenColumnOffsets=ArrayUtil.readIntArray(in);
  _resultSetFieldName=in.readUTF();
  _actionMethodName=in.readUTF();
  _thenAction=(ConstantAction)in.readObject();
}

Fixed version (ground truth):
/** 
 * Read this object from a stream of stored objects.
 * @param in read this.
 * @exception IOException					thrown on error
 * @exception ClassNotFoundException		thrown on error
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  int oldVersion=in.readInt();
  _clauseType=in.readInt();
  _matchRefinementName=(String)in.readObject();
  _thenColumnOffsets=ArrayUtil.readIntArray(in);
  _resultSetFieldName=(String)in.readObject();
  _actionMethodName=(String)in.readObject();
  _thenAction=(ConstantAction)in.readObject();
}
Program: 79989
Project: 79989
Buggy source:
public XPLAINStatementDescriptor(UUID stmt_id,String stmt_name,String stmt_type,String stmt_text,String jvm_id,String os_id,String xplain_mode,Timestamp xplain_time,String thread_id,String xa_id,String session_id,String db_name,String drda_id,UUID timing_id){
  this.stmt_id=stmt_id;
  this.stmt_name=stmt_name;
  this.stmt_type=stmt_type;
  this.stmt_text=stmt_text;
  this.jvm_id=jvm_id;
  this.os_id=os_id;
  this.xplain_mode=xplain_mode;
  this.xplain_time=xplain_time;
  this.thread_id=thread_id;
  this.xa_id=xa_id;
  this.session_id=session_id;
  this.db_name=db_name;
  this.drda_id=drda_id;
  this.timing_id=timing_id;
}

Fixed version (ground truth):
public XPLAINStatementDescriptor(UUID stmt_id,String stmt_name,String stmt_type,String stmt_text,String jvm_id,String os_id,String xplain_mode,Timestamp xplain_time,String thread_id,String xa_id,String session_id,String db_name,String drda_id,UUID timing_id){
  this.stmt_id=stmt_id;
  this.stmt_name=stmt_name;
  this.stmt_type=stmt_type;
  this.stmt_text=stmt_text;
  this.jvm_id=jvm_id;
  this.os_id=os_id;
  this.xplain_mode=xplain_mode;
  this.xplain_time=DataTypeUtilities.clone(xplain_time);
  this.thread_id=thread_id;
  this.xa_id=xa_id;
  this.session_id=session_id;
  this.db_name=db_name;
  this.drda_id=drda_id;
  this.timing_id=timing_id;
}
Program: 79990
Project: 79990
Buggy source:
public XPLAINStatementTimingsDescriptor(UUID timing_id,Long parse_time,Long bind_time,Long optimize_time,Long generate_time,Long compile_time,Long execute_time,Timestamp begin_comp_time,Timestamp end_comp_time,Timestamp begin_exe_time,Timestamp end_exe_time){
  this.timing_id=timing_id;
  this.parse_time=parse_time;
  this.bind_time=bind_time;
  this.optimize_time=optimize_time;
  this.generate_time=generate_time;
  this.compile_time=compile_time;
  this.execute_time=execute_time;
  this.begin_comp_time=begin_comp_time;
  this.end_comp_time=end_comp_time;
  this.begin_exe_time=begin_exe_time;
  this.end_exe_time=end_exe_time;
}

Fixed version (ground truth):
public XPLAINStatementTimingsDescriptor(UUID timing_id,Long parse_time,Long bind_time,Long optimize_time,Long generate_time,Long compile_time,Long execute_time,Timestamp begin_comp_time,Timestamp end_comp_time,Timestamp begin_exe_time,Timestamp end_exe_time){
  this.timing_id=timing_id;
  this.parse_time=parse_time;
  this.bind_time=bind_time;
  this.optimize_time=optimize_time;
  this.generate_time=generate_time;
  this.compile_time=compile_time;
  this.execute_time=execute_time;
  this.begin_comp_time=DataTypeUtilities.clone(begin_comp_time);
  this.end_comp_time=DataTypeUtilities.clone(end_comp_time);
  this.begin_exe_time=DataTypeUtilities.clone(begin_exe_time);
  this.end_exe_time=DataTypeUtilities.clone(end_exe_time);
}
Program: 79992
Project: 79992
Buggy source:
/** 
 */
public RealDeleteCascadeResultSetStatistics(int rowCount,boolean deferred,int indexesUpdated,boolean tableLock,long executeTime,ResultSetStatistics sourceResultSetStatistics,ResultSetStatistics[] dependentTrackingArray){
  super(rowCount,deferred,indexesUpdated,tableLock,executeTime,sourceResultSetStatistics);
  this.dependentTrackingArray=dependentTrackingArray;
}

Fixed version (ground truth):
/** 
 */
public RealDeleteCascadeResultSetStatistics(int rowCount,boolean deferred,int indexesUpdated,boolean tableLock,long executeTime,ResultSetStatistics sourceResultSetStatistics,ResultSetStatistics[] dependentTrackingArray){
  super(rowCount,deferred,indexesUpdated,tableLock,executeTime,sourceResultSetStatistics);
  this.dependentTrackingArray=(ResultSetStatistics[])ArrayUtil.copy(dependentTrackingArray);
}
Program: 79993
Project: 79993
Buggy source:
/** 
 */
public RealHashScanStatistics(int numOpens,int rowsSeen,int rowsFiltered,long constructorTime,long openTime,long nextTime,long closeTime,int resultSetNumber,String tableName,String indexName,boolean isConstraint,int hashtableSize,int[] hashKeyColumns,String scanQualifiers,String nextQualifiers,Properties scanProperties,String startPosition,String stopPosition,String isolationLevel,String lockString,double optimizerEstimatedRowCount,double optimizerEstimatedCost){
  super(numOpens,rowsSeen,rowsFiltered,constructorTime,openTime,nextTime,closeTime,resultSetNumber,optimizerEstimatedRowCount,optimizerEstimatedCost);
  this.tableName=tableName;
  this.indexName=indexName;
  this.isConstraint=isConstraint;
  this.hashtableSize=hashtableSize;
  this.hashKeyColumns=hashKeyColumns;
  this.scanQualifiers=scanQualifiers;
  this.nextQualifiers=nextQualifiers;
  this.scanProperties=new FormatableProperties();
  if (scanProperties != null) {
    for (Enumeration e=scanProperties.keys(); e.hasMoreElements(); ) {
      String key=(String)e.nextElement();
      this.scanProperties.put(key,scanProperties.get(key));
    }
  }
  this.startPosition=startPosition;
  this.stopPosition=stopPosition;
  this.isolationLevel=isolationLevel;
  this.lockString=lockString;
}

Fixed version (ground truth):
/** 
 */
public RealHashScanStatistics(int numOpens,int rowsSeen,int rowsFiltered,long constructorTime,long openTime,long nextTime,long closeTime,int resultSetNumber,String tableName,String indexName,boolean isConstraint,int hashtableSize,int[] hashKeyColumns,String scanQualifiers,String nextQualifiers,Properties scanProperties,String startPosition,String stopPosition,String isolationLevel,String lockString,double optimizerEstimatedRowCount,double optimizerEstimatedCost){
  super(numOpens,rowsSeen,rowsFiltered,constructorTime,openTime,nextTime,closeTime,resultSetNumber,optimizerEstimatedRowCount,optimizerEstimatedCost);
  this.tableName=tableName;
  this.indexName=indexName;
  this.isConstraint=isConstraint;
  this.hashtableSize=hashtableSize;
  this.hashKeyColumns=ArrayUtil.copy(hashKeyColumns);
  this.scanQualifiers=scanQualifiers;
  this.nextQualifiers=nextQualifiers;
  this.scanProperties=new FormatableProperties();
  if (scanProperties != null) {
    for (Enumeration e=scanProperties.keys(); e.hasMoreElements(); ) {
      String key=(String)e.nextElement();
      this.scanProperties.put(key,scanProperties.get(key));
    }
  }
  this.startPosition=startPosition;
  this.stopPosition=stopPosition;
  this.isolationLevel=isolationLevel;
  this.lockString=lockString;
}
Program: 79994
Project: 79994
Buggy source:
/** 
 */
public RealHashTableStatistics(int numOpens,int rowsSeen,int rowsFiltered,long constructorTime,long openTime,long nextTime,long closeTime,int resultSetNumber,int hashtableSize,int[] hashKeyColumns,String nextQualifiers,Properties scanProperties,double optimizerEstimatedRowCount,double optimizerEstimatedCost,ResultSetStatistics[] subqueryTrackingArray,ResultSetStatistics childResultSetStatistics){
  super(numOpens,rowsSeen,rowsFiltered,constructorTime,openTime,nextTime,closeTime,resultSetNumber,optimizerEstimatedRowCount,optimizerEstimatedCost);
  this.hashtableSize=hashtableSize;
  this.hashKeyColumns=hashKeyColumns;
  this.nextQualifiers=nextQualifiers;
  this.scanProperties=new FormatableProperties();
  if (scanProperties != null) {
    for (Enumeration e=scanProperties.keys(); e.hasMoreElements(); ) {
      String key=(String)e.nextElement();
      this.scanProperties.put(key,scanProperties.get(key));
    }
  }
  this.subqueryTrackingArray=subqueryTrackingArray;
  this.childResultSetStatistics=childResultSetStatistics;
}

Fixed version (ground truth):
/** 
 */
public RealHashTableStatistics(int numOpens,int rowsSeen,int rowsFiltered,long constructorTime,long openTime,long nextTime,long closeTime,int resultSetNumber,int hashtableSize,int[] hashKeyColumns,String nextQualifiers,Properties scanProperties,double optimizerEstimatedRowCount,double optimizerEstimatedCost,ResultSetStatistics[] subqueryTrackingArray,ResultSetStatistics childResultSetStatistics){
  super(numOpens,rowsSeen,rowsFiltered,constructorTime,openTime,nextTime,closeTime,resultSetNumber,optimizerEstimatedRowCount,optimizerEstimatedCost);
  this.hashtableSize=hashtableSize;
  this.hashKeyColumns=ArrayUtil.copy(hashKeyColumns);
  this.nextQualifiers=nextQualifiers;
  this.scanProperties=new FormatableProperties();
  if (scanProperties != null) {
    for (Enumeration e=scanProperties.keys(); e.hasMoreElements(); ) {
      String key=(String)e.nextElement();
      this.scanProperties.put(key,scanProperties.get(key));
    }
  }
  this.subqueryTrackingArray=(ResultSetStatistics[])ArrayUtil.copy(subqueryTrackingArray);
  this.childResultSetStatistics=childResultSetStatistics;
}
Program: 79995
Project: 79995
Buggy source:
/** 
 */
public RealProjectRestrictStatistics(int numOpens,int rowsSeen,int rowsFiltered,long constructorTime,long openTime,long nextTime,long closeTime,int resultSetNumber,long restrictionTime,long projectionTime,ResultSetStatistics[] subqueryTrackingArray,boolean restriction,boolean doesProjection,double optimizerEstimatedRowCount,double optimizerEstimatedCost,ResultSetStatistics childResultSetStatistics){
  super(numOpens,rowsSeen,rowsFiltered,constructorTime,openTime,nextTime,closeTime,resultSetNumber,optimizerEstimatedRowCount,optimizerEstimatedCost);
  this.restriction=restriction;
  this.doesProjection=doesProjection;
  this.restrictionTime=restrictionTime;
  this.projectionTime=projectionTime;
  this.subqueryTrackingArray=subqueryTrackingArray;
  this.childResultSetStatistics=childResultSetStatistics;
}

Fixed version (ground truth):
/** 
 */
public RealProjectRestrictStatistics(int numOpens,int rowsSeen,int rowsFiltered,long constructorTime,long openTime,long nextTime,long closeTime,int resultSetNumber,long restrictionTime,long projectionTime,ResultSetStatistics[] subqueryTrackingArray,boolean restriction,boolean doesProjection,double optimizerEstimatedRowCount,double optimizerEstimatedCost,ResultSetStatistics childResultSetStatistics){
  super(numOpens,rowsSeen,rowsFiltered,constructorTime,openTime,nextTime,closeTime,resultSetNumber,optimizerEstimatedRowCount,optimizerEstimatedCost);
  this.restriction=restriction;
  this.doesProjection=doesProjection;
  this.restrictionTime=restrictionTime;
  this.projectionTime=projectionTime;
  this.subqueryTrackingArray=(ResultSetStatistics[])ArrayUtil.copy(subqueryTrackingArray);
  this.childResultSetStatistics=childResultSetStatistics;
}
Program: 79996
Project: 79996
Buggy source:
/** 
 * Get the timestamp for the end of query execution. 
 * @return java.sql.Timestamp	The timestamp for the end of query execution.
 */
public Timestamp getEndExecutionTimestamp(){
  return endExecutionTimestamp;
}

Fixed version (ground truth):
/** 
 * Get the timestamp for the end of query execution. 
 * @return java.sql.Timestamp	The timestamp for the end of query execution.
 */
public Timestamp getEndExecutionTimestamp(){
  return endExecutionTimestamp == null ? null : (Timestamp)endExecutionTimestamp.clone();
}
Program: 79997
Project: 79997
Buggy source:
/** 
 * Get the timestamp for the beginning of query compilation. 
 * @return java.sql.Timestamp	The timestamp for the beginning of query compilation.
 */
public Timestamp getBeginCompilationTimestamp(){
  return beginCompilationTimestamp;
}

Fixed version (ground truth):
/** 
 * Get the timestamp for the beginning of query compilation. 
 * @return java.sql.Timestamp	The timestamp for the beginning of query compilation.
 */
public Timestamp getBeginCompilationTimestamp(){
  return beginCompilationTimestamp == null ? null : (Timestamp)beginCompilationTimestamp.clone();
}
Program: 79998
Project: 79998
Buggy source:
/** 
 */
public RunTimeStatisticsImpl(String spsName,String statementName,String statementText,long compileTime,long parseTime,long bindTime,long optimizeTime,long generateTime,long executeTime,Timestamp beginCompilationTimestamp,Timestamp endCompilationTimestamp,Timestamp beginExecutionTimestamp,Timestamp endExecutionTimestamp,ResultSetStatistics[] subqueryTrackingArray,ResultSetStatistics topResultSetStatistics){
  this.spsName=spsName;
  this.statementName=statementName;
  this.statementText=statementText;
  this.compileTime=compileTime;
  this.parseTime=parseTime;
  this.bindTime=bindTime;
  this.optimizeTime=optimizeTime;
  this.generateTime=generateTime;
  this.executeTime=executeTime;
  this.beginCompilationTimestamp=beginCompilationTimestamp;
  this.endCompilationTimestamp=endCompilationTimestamp;
  this.beginExecutionTimestamp=beginExecutionTimestamp;
  this.endExecutionTimestamp=endExecutionTimestamp;
  this.subqueryTrackingArray=subqueryTrackingArray;
  this.topResultSetStatistics=topResultSetStatistics;
}

Fixed version (ground truth):
/** 
 */
public RunTimeStatisticsImpl(String spsName,String statementName,String statementText,long compileTime,long parseTime,long bindTime,long optimizeTime,long generateTime,long executeTime,Timestamp beginCompilationTimestamp,Timestamp endCompilationTimestamp,Timestamp beginExecutionTimestamp,Timestamp endExecutionTimestamp,ResultSetStatistics[] subqueryTrackingArray,ResultSetStatistics topResultSetStatistics){
  this.spsName=spsName;
  this.statementName=statementName;
  this.statementText=statementText;
  this.compileTime=compileTime;
  this.parseTime=parseTime;
  this.bindTime=bindTime;
  this.optimizeTime=optimizeTime;
  this.generateTime=generateTime;
  this.executeTime=executeTime;
  this.beginCompilationTimestamp=beginCompilationTimestamp == null ? null : (Timestamp)beginCompilationTimestamp.clone();
  this.endCompilationTimestamp=endCompilationTimestamp == null ? null : (Timestamp)endCompilationTimestamp.clone();
  this.beginExecutionTimestamp=beginExecutionTimestamp == null ? null : (Timestamp)beginExecutionTimestamp.clone();
  this.endExecutionTimestamp=endExecutionTimestamp == null ? null : (Timestamp)endExecutionTimestamp.clone();
  this.subqueryTrackingArray=(ResultSetStatistics[])ArrayUtil.copy(subqueryTrackingArray);
  this.topResultSetStatistics=topResultSetStatistics;
}
Program: 79999
Project: 79999
Buggy source:
/** 
 * Get the timestamp for the end of query compilation. 
 * @return java.sql.Timestamp	The timestamp for the end of query compilation.
 */
public Timestamp getEndCompilationTimestamp(){
  return endCompilationTimestamp;
}

Fixed version (ground truth):
/** 
 * Get the timestamp for the end of query compilation. 
 * @return java.sql.Timestamp	The timestamp for the end of query compilation.
 */
public Timestamp getEndCompilationTimestamp(){
  return endCompilationTimestamp == null ? null : (Timestamp)endCompilationTimestamp.clone();
}
Program: 80000
Project: 80000
Buggy source:
/** 
 * Get the timestamp for the beginning of query execution. 
 * @return java.sql.Timestamp	The timestamp for the beginning of query execution.
 */
public Timestamp getBeginExecutionTimestamp(){
  return beginExecutionTimestamp;
}

Fixed version (ground truth):
/** 
 * Get the timestamp for the beginning of query execution. 
 * @return java.sql.Timestamp	The timestamp for the beginning of query execution.
 */
public Timestamp getBeginExecutionTimestamp(){
  return beginExecutionTimestamp == null ? null : (Timestamp)beginExecutionTimestamp.clone();
}
Program: 80001
Project: 80001
Buggy source:
/** 
 * Checks whether a data type is supported for <code>setObject(int, Object, int)</code> and <code>setObject(int, Object, int, int)</code>.
 * @param dataType the data type to check
 * @exception SqlException if the type is not supported
 */
public void checkForSupportedDataType(int dataType) throws SqlException {
switch (dataType) {
case java.sql.Types.ARRAY:
case java.sql.Types.DATALINK:
case JDBC40Translation.NCHAR:
case JDBC40Translation.NCLOB:
case JDBC40Translation.NVARCHAR:
case JDBC40Translation.LONGNVARCHAR:
case java.sql.Types.REF:
case JDBC40Translation.REF_CURSOR:
case JDBC40Translation.ROWID:
case JDBC40Translation.SQLXML:
case java.sql.Types.STRUCT:
    throw new SqlException(logWriter_,new ClientMessageId(SQLState.DATA_TYPE_NOT_SUPPORTED),Types.getTypeString(dataType));
}
}

Fixed version (ground truth):
/** 
 * Checks whether a data type is supported for <code>setObject(int, Object, int)</code> and <code>setObject(int, Object, int, int)</code>.
 * @param dataType the data type to check
 * @exception SqlException if the type is not supported
 */
public void checkForSupportedDataType(int dataType) throws SqlException {
switch (dataType) {
case java.sql.Types.ARRAY:
case java.sql.Types.DATALINK:
case java.sql.Types.DISTINCT:
case JDBC40Translation.NCHAR:
case JDBC40Translation.NCLOB:
case JDBC40Translation.NVARCHAR:
case JDBC40Translation.LONGNVARCHAR:
case java.sql.Types.NULL:
case java.sql.Types.OTHER:
case java.sql.Types.REF:
case JDBC40Translation.REF_CURSOR:
case JDBC40Translation.ROWID:
case JDBC40Translation.SQLXML:
case java.sql.Types.STRUCT:
    throw new SqlException(logWriter_,new ClientMessageId(SQLState.DATA_TYPE_NOT_SUPPORTED),Types.getTypeString(dataType));
}
}
Program: 80002
Project: 80002
Buggy source:
public void registerOutParameter(String parameterName,SQLType sqlType,String typeName) throws SQLException {
  try {
synchronized (connection_) {
      if (agent_.loggingEnabled()) {
        agent_.logWriter_.traceEntry(this,"String_Node_Str",parameterName,sqlType,typeName);
      }
      checkForClosedStatement();
      registerOutParameter(parameterName,Utils42.getTypeAsInt(agent_,sqlType),typeName);
    }
  }
 catch (  SqlException se) {
    throw se.getSQLException();
  }
}

Fixed version (ground truth):
public void registerOutParameter(String parameterName,SQLType sqlType,String typeName) throws SQLException {
synchronized (connection_) {
    if (agent_.loggingEnabled()) {
      agent_.logWriter_.traceEntry(this,"String_Node_Str",parameterName,sqlType,typeName);
    }
    checkStatus();
    registerOutParameter(parameterName,Utils42.getTypeAsInt(agent_,sqlType),typeName);
  }
}
Program: 80003
Project: 80003
Buggy source:
public void setObject(String parameterName,Object x,SQLType sqlType,int scaleOrLength) throws SQLException {
  try {
synchronized (connection_) {
      if (agent_.loggingEnabled()) {
        agent_.logWriter_.traceEntry(this,"String_Node_Str",parameterName,x,sqlType,scaleOrLength);
      }
      checkForClosedStatement();
      setObject(parameterName,x,Utils42.getTypeAsInt(agent_,sqlType),scaleOrLength);
    }
  }
 catch (  SqlException se) {
    throw se.getSQLException();
  }
}

Fixed version (ground truth):
public void setObject(String parameterName,Object x,SQLType sqlType,int scaleOrLength) throws SQLException {
synchronized (connection_) {
    if (agent_.loggingEnabled()) {
      agent_.logWriter_.traceEntry(this,"String_Node_Str",parameterName,x,sqlType,scaleOrLength);
    }
    checkStatus();
    setObject(parameterName,x,Utils42.getTypeAsInt(agent_,sqlType),scaleOrLength);
  }
}
Program: 80004
Project: 80004
Buggy source:
public boolean acceptsURL(String url) throws java.sql.SQLException {
  try {
    java.util.StringTokenizer urlTokenizer=new java.util.StringTokenizer(url,"String_Node_Str",true);
    int protocol=tokenizeProtocol(url,urlTokenizer);
    return protocol != 0;
  }
 catch (  SqlException se) {
    throw se.getSQLException();
  }
}

Fixed version (ground truth):
public boolean acceptsURL(String url) throws java.sql.SQLException {
  checkURLNotNull(url);
  try {
    java.util.StringTokenizer urlTokenizer=new java.util.StringTokenizer(url,"String_Node_Str",true);
    int protocol=tokenizeProtocol(url,urlTokenizer);
    return protocol != 0;
  }
 catch (  SqlException se) {
    throw se.getSQLException();
  }
}
Program: 80006
Project: 80006
Buggy source:
/** 
 * Checks whether a data type is supported for <code>setObject(int, Object, int)</code> and <code>setObject(int, Object, int, int)</code>.
 * @param dataType the data type to check
 * @exception SQLException if the type is not supported
 */
public void checkForSupportedDataType(int dataType) throws SQLException {
switch (dataType) {
case Types.ARRAY:
case Types.DATALINK:
case JDBC40Translation.NCHAR:
case JDBC40Translation.NCLOB:
case JDBC40Translation.NVARCHAR:
case JDBC40Translation.LONGNVARCHAR:
case Types.REF:
case JDBC40Translation.REF_CURSOR:
case JDBC40Translation.ROWID:
case JDBC40Translation.SQLXML:
case Types.STRUCT:
    throw newSQLException(SQLState.DATA_TYPE_NOT_SUPPORTED,Util.typeName(dataType));
}
}

Fixed version (ground truth):
/** 
 * Checks whether a data type is supported for <code>setObject(int, Object, int)</code> and <code>setObject(int, Object, int, int)</code>.
 * @param dataType the data type to check
 * @exception SQLException if the type is not supported
 */
public void checkForSupportedDataType(int dataType) throws SQLException {
switch (dataType) {
case Types.ARRAY:
case Types.DATALINK:
case Types.DISTINCT:
case JDBC40Translation.NCHAR:
case JDBC40Translation.NCLOB:
case JDBC40Translation.NVARCHAR:
case JDBC40Translation.LONGNVARCHAR:
case Types.NULL:
case Types.OTHER:
case Types.REF:
case JDBC40Translation.REF_CURSOR:
case JDBC40Translation.ROWID:
case JDBC40Translation.SQLXML:
case Types.STRUCT:
    throw newSQLException(SQLState.DATA_TYPE_NOT_SUPPORTED,Util.typeName(dataType));
}
}
Program: 80007
Project: 80007
Buggy source:
public static boolean embeddedDriverAcceptsURL(String url){
  return !url.startsWith(Attribute.JCC_PROTOCOL) && !url.startsWith(Attribute.DNC_PROTOCOL) && (url.startsWith(Attribute.PROTOCOL) || url.equals(Attribute.SQLJ_NESTED));
}

Fixed version (ground truth):
public static boolean embeddedDriverAcceptsURL(String url) throws SQLException {
  if (url == null) {
    throw Util.generateCsSQLException(SQLState.MALFORMED_URL,"String_Node_Str");
  }
  return !url.startsWith(Attribute.JCC_PROTOCOL) && !url.startsWith(Attribute.DNC_PROTOCOL) && (url.startsWith(Attribute.PROTOCOL) || url.equals(Attribute.SQLJ_NESTED));
}
Program: 80008
Project: 80008
Buggy source:
public boolean acceptsURL(String url){
  return active && embeddedDriverAcceptsURL(url);
}

Fixed version (ground truth):
public boolean acceptsURL(String url) throws SQLException {
  return active && embeddedDriverAcceptsURL(url);
}
Program: 80009
Project: 80009
Buggy source:
public boolean acceptsURL(String url){
  return driver.acceptsURL(url);
}

Fixed version (ground truth):
public boolean acceptsURL(String url) throws SQLException {
  return driver.acceptsURL(url);
}
Program: 80010
Project: 80010
Buggy source:
/** 
 * Does the driver accept the passed in JDBC URL
 * @param url JDBC URL to check.
 * @return True if it supports it, false otherwise.
 * @see java.sql.Driver#acceptsURL(String)
 */
public boolean acceptsURL(String url);

Fixed version (ground truth):
/** 
 * Does the driver accept the passed in JDBC URL
 * @param url JDBC URL to check.
 * @return True if it supports it, false otherwise.
 * @see java.sql.Driver#acceptsURL(String)
 */
public boolean acceptsURL(String url) throws SQLException ;
Program: 80011
Project: 80011
Buggy source:
/** 
 * This method is overriden on JVM 8 
 */
protected java.sql.BatchUpdateException newBatchUpdateException(String message,String sqlState,int errorCode,long[] updateCounts){
  return new java.sql.BatchUpdateException(message,sqlState,errorCode,Utils.squashLongs(updateCounts));
}

Fixed version (ground truth):
/** 
 * This method is overriden on JVM 8 
 */
protected java.sql.BatchUpdateException newBatchUpdateException(String message,String sqlState,int errorCode,long[] updateCounts,SqlException cause){
  java.sql.BatchUpdateException bue=new java.sql.BatchUpdateException(message,sqlState,errorCode,Utils.squashLongs(updateCounts));
  if (cause != null) {
    bue.initCause(cause);
  }
  return bue;
}
Program: 80012
Project: 80012
Buggy source:
/** 
 * This method is overriden on JVM 8 to take advantage of long update counts 
 */
protected java.sql.BatchUpdateException newBatchUpdateException(String message,String sqlState,int errorCode,long[] updateCounts){
  return new java.sql.BatchUpdateException(message,sqlState,errorCode,updateCounts,null);
}

Fixed version (ground truth):
/** 
 * This method is overriden on JVM 8 to take advantage of long update counts 
 */
protected java.sql.BatchUpdateException newBatchUpdateException(String message,String sqlState,int errorCode,long[] updateCounts,SqlException cause){
  return new java.sql.BatchUpdateException(message,sqlState,errorCode,updateCounts,cause);
}
Program: 80013
Project: 80013
Buggy source:
/** 
 * JDBC 4.2 Submit a batch of commands to the database for execution. This method is optional. For use with statements which may touch more than Integer.MAX_VALUE rows.
 */
public long[] executeLargeBatch() throws SQLException {
  checkExecStatus();
synchronized (getConnectionSynchronization()) {
    setupContextStack();
    int i=0;
    clearResultSets();
    Vector stmts=batchStatements;
    batchStatements=null;
    int size;
    if (stmts == null)     size=0;
 else     size=stmts.size();
    long[] returnUpdateCountForBatch=new long[size];
    SQLException sqle;
    try {
      for (; i < size; i++) {
        InterruptStatus.throwIf(lcc);
        if (executeBatchElement(stmts.get(i)))         throw newSQLException(SQLState.RESULTSET_RETURN_NOT_ALLOWED);
        returnUpdateCountForBatch[i]=getLargeUpdateCount();
      }
      InterruptStatus.restoreIntrFlagIfSeen(lcc);
      return returnUpdateCountForBatch;
    }
 catch (    StandardException se) {
      sqle=handleException(se);
    }
catch (    SQLException sqle2) {
      sqle=sqle2;
    }
 finally {
      restoreContextStack();
    }
    long[] successfulUpdateCount=new long[i];
    System.arraycopy(returnUpdateCountForBatch,0,successfulUpdateCount,0,i);
    SQLException batch=Util.newBatchUpdateException(sqle.getMessage(),sqle.getSQLState(),sqle.getErrorCode(),successfulUpdateCount);
    batch.setNextException(sqle);
    batch.initCause(sqle);
    throw batch;
  }
}

Fixed version (ground truth):
/** 
 * JDBC 4.2 Submit a batch of commands to the database for execution. This method is optional. For use with statements which may touch more than Integer.MAX_VALUE rows.
 */
public long[] executeLargeBatch() throws SQLException {
  checkExecStatus();
synchronized (getConnectionSynchronization()) {
    setupContextStack();
    int i=0;
    clearResultSets();
    Vector stmts=batchStatements;
    batchStatements=null;
    int size;
    if (stmts == null)     size=0;
 else     size=stmts.size();
    long[] returnUpdateCountForBatch=new long[size];
    SQLException sqle;
    try {
      for (; i < size; i++) {
        InterruptStatus.throwIf(lcc);
        if (executeBatchElement(stmts.get(i)))         throw newSQLException(SQLState.RESULTSET_RETURN_NOT_ALLOWED);
        returnUpdateCountForBatch[i]=getLargeUpdateCount();
      }
      InterruptStatus.restoreIntrFlagIfSeen(lcc);
      return returnUpdateCountForBatch;
    }
 catch (    StandardException se) {
      sqle=handleException(se);
    }
catch (    SQLException sqle2) {
      sqle=sqle2;
    }
 finally {
      restoreContextStack();
    }
    long[] successfulUpdateCount=new long[i];
    System.arraycopy(returnUpdateCountForBatch,0,successfulUpdateCount,0,i);
    SQLException batch=Util.newBatchUpdateException(sqle.getMessage(),sqle.getSQLState(),sqle.getErrorCode(),successfulUpdateCount,sqle);
    throw batch;
  }
}
Program: 80014
Project: 80014
Buggy source:
/** 
 * Create the correct BatchUpdateException depending on whether this is Java 8 or lower 
 */
static SQLException newBatchUpdateException(String message,String sqlState,int errorCode,long[] updateCounts){
  if (JVMInfo.JDK_ID >= JVMInfo.J2SE_18) {
    try {
      Constructor constructor=BatchUpdateException.class.getConstructor(new Class[]{String.class,String.class,Integer.TYPE,updateCounts.getClass(),Throwable.class});
      return (BatchUpdateException)constructor.newInstance(new Object[]{message,sqlState,new Integer(errorCode),updateCounts,(Throwable)null});
    }
 catch (    Exception e) {
      logError("String_Node_Str" + e.getMessage() + "String_Node_Str",e);
    }
  }
  return new BatchUpdateException(message,sqlState,errorCode,squashLongs(updateCounts));
}

Fixed version (ground truth):
/** 
 * Create the correct BatchUpdateException depending on whether this is Java 8 or lower 
 */
static SQLException newBatchUpdateException(String message,String sqlState,int errorCode,long[] updateCounts,Throwable cause){
  if (JVMInfo.JDK_ID >= JVMInfo.J2SE_18) {
    try {
      Constructor constructor=BatchUpdateException.class.getConstructor(new Class[]{String.class,String.class,Integer.TYPE,updateCounts.getClass(),Throwable.class});
      return (BatchUpdateException)constructor.newInstance(new Object[]{message,sqlState,new Integer(errorCode),updateCounts,cause});
    }
 catch (    Exception e) {
      logError("String_Node_Str" + e.getMessage() + "String_Node_Str",e);
    }
  }
  BatchUpdateException batch=new BatchUpdateException(message,sqlState,errorCode,squashLongs(updateCounts));
  if (cause instanceof SQLException) {
    batch.setNextException((SQLException)cause);
  }
  batch.initCause(cause);
  return batch;
}
Program: 80015
Project: 80015
Buggy source:
/** 
 * Add result columns for a Derby-style Table Function
 */
private void createResultColumnsForTableFunction(TypeDescriptor td) throws StandardException {
  String[] columnNames=td.getRowColumnNames();
  TypeDescriptor[] types=td.getRowTypes();
  for (int i=0; i < columnNames.length; i++) {
    resultColumns.addColumn(exposedName,columnNames[i],DataTypeDescriptor.getType(types[i]));
  }
}

Fixed version (ground truth):
/** 
 * Add result columns for a Derby-style Table Function
 */
private void createResultColumnsForTableFunction(TypeDescriptor td) throws StandardException {
  String[] columnNames=td.getRowColumnNames();
  TypeDescriptor[] types=td.getRowTypes();
  for (int i=0; i < columnNames.length; i++) {
    String columnName=columnNames[i];
    DataTypeDescriptor dtd=DataTypeDescriptor.getType(types[i]);
    ResultColumn rc=resultColumns.addColumn(exposedName,columnName,dtd);
    ColumnDescriptor coldesc=new ColumnDescriptor(columnName,i + 1,dtd,(DataValueDescriptor)null,(DefaultInfo)null,(UUID)null,(UUID)null,0L,0L,0L);
    rc.setColumnDescriptor(null,coldesc);
  }
}
Program: 80016
Project: 80016
Buggy source:
/** 
 * Add a column to the list given a tablename, columnname, and datatype.
 */
public void addColumn(TableName tableName,String columnName,DataTypeDescriptor dts) throws StandardException {
  ValueNode bcn=(ValueNode)getNodeFactory().getNode(C_NodeTypes.BASE_COLUMN_NODE,columnName,tableName,dts,getContextManager());
  ResultColumn rc=(ResultColumn)getNodeFactory().getNode(C_NodeTypes.RESULT_COLUMN,columnName,bcn,getContextManager());
  rc.setType(dts);
  addResultColumn(rc);
}

Fixed version (ground truth):
/** 
 * Add a column to the list given a tablename, columnname, and datatype. Return the just-added column.
 */
public ResultColumn addColumn(TableName tableName,String columnName,DataTypeDescriptor dts) throws StandardException {
  ValueNode bcn=(ValueNode)getNodeFactory().getNode(C_NodeTypes.BASE_COLUMN_NODE,columnName,tableName,dts,getContextManager());
  ResultColumn rc=(ResultColumn)getNodeFactory().getNode(C_NodeTypes.RESULT_COLUMN,columnName,bcn,getContextManager());
  rc.setType(dts);
  addResultColumn(rc);
  return rc;
}
Program: 80017
Project: 80017
Buggy source:
/** 
 * <p> Miscellaneous bugs. </p>
 */
private void miscBugs() throws Exception {
  derby_4092();
  derby_5779();
}

Fixed version (ground truth):
/** 
 * <p> Miscellaneous bugs. </p>
 */
private void miscBugs() throws Exception {
  derby_4092();
  derby_5779();
  derby_6040();
}
Program: 80018
Project: 80018
Buggy source:
/** 
 * <p> Generate the trailing routine arguments into a varargs array and push that array onto the stack. </p>
 */
private void generateVarargs(ExpressionClassBuilder acb,MethodBuilder mb) throws StandardException {
  Class[] parameterTypes=((Method)method).getParameterTypes();
  int firstVarargIdx=parameterTypes.length - 1;
  Class varargType=parameterTypes[firstVarargIdx].getComponentType();
  int varargCount=methodParms.length - firstVarargIdx;
  if (varargCount < 0) {
    varargCount=0;
  }
  LocalField arrayField=acb.newFieldDeclaration(Modifier.PRIVATE,varargType.getName() + "String_Node_Str");
  MethodBuilder cb=acb.getConstructor();
  cb.pushNewArray(varargType.getName(),varargCount);
  cb.setField(arrayField);
  for (int i=0; i < varargCount; i++) {
    mb.getField(arrayField);
    generateAndCastOneParameter(acb,mb,i + firstVarargIdx,methodParameterTypes[firstVarargIdx]);
    mb.setArrayElement(i);
  }
  mb.getField(arrayField);
}

Fixed version (ground truth):
/** 
 * <p> Generate the trailing routine arguments into a varargs array and push that array onto the stack. </p>
 */
private void generateVarargs(ExpressionClassBuilder acb,MethodBuilder mb) throws StandardException {
  int firstVarargIdx=getFirstVarargIdx();
  String arrayType=methodParameterTypes[firstVarargIdx];
  String cellType=stripOneArrayLevel(arrayType);
  String varargType=cellType;
  if (routineInfo != null) {
    if (routineInfo.getParameterModes()[firstVarargIdx] != JDBC30Translation.PARAMETER_MODE_IN) {
      varargType=stripOneArrayLevel(varargType);
    }
  }
  int varargCount=methodParms.length - firstVarargIdx;
  if (varargCount < 0) {
    varargCount=0;
  }
  LocalField arrayField=acb.newFieldDeclaration(Modifier.PRIVATE,arrayType);
  MethodBuilder cb=acb.getConstructor();
  cb.pushNewArray(cellType,varargCount);
  cb.setField(arrayField);
  for (int i=0; i < varargCount; i++) {
    mb.getField(arrayField);
    generateAndCastOneParameter(acb,mb,i + firstVarargIdx,cellType);
    mb.setArrayElement(i);
  }
  mb.getField(arrayField);
}