nus-yam/ex-repair huggingface dataset:
Program: 26006
Project: 26006
Buggy source:
@Test public void testDeleteCascade(){
  deleteAndPopulateTables("String_Node_Str","String_Node_Str");
  final User u=new User();
  u.set("String_Node_Str","String_Node_Str");
  u.set("String_Node_Str","String_Node_Str");
  u.set("String_Node_Str","String_Node_Str");
  u.saveIt();
  Address a=new Address();
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  u.add(a);
  a=new Address();
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  u.add(a);
  a(User.findAll().size()).shouldBeEqual(3);
  a(Address.findAll().size()).shouldBeEqual(9);
  u.deleteCascade();
  a(User.findAll().size()).shouldBeEqual(2);
  a(Address.findAll().size()).shouldBeEqual(7);
}

Fixed version (ground truth):
@Test public void testDeleteCascade(){
  deleteAndPopulateTables("String_Node_Str","String_Node_Str");
  final User u=new User();
  u.set("String_Node_Str","String_Node_Str");
  u.set("String_Node_Str","String_Node_Str");
  u.set("String_Node_Str","String_Node_Str");
  u.saveIt();
  Address a=new Address();
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  u.add(a);
  a=new Address();
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  a.set("String_Node_Str","String_Node_Str");
  u.add(a);
  a(User.findAll().size()).shouldBeEqual(4);
  a(Address.findAll().size()).shouldBeEqual(9);
  u.deleteCascade();
  a(User.findAll().size()).shouldBeEqual(3);
  a(Address.findAll().size()).shouldBeEqual(7);
}
Program: 26007
Project: 26007
Buggy source:
@Test public void shouldFindFOtherDb(){
  List<User> users=User.findAll().orderBy("String_Node_Str");
  List<OtherDbModel> others=OtherDbModel.findAll().orderBy("String_Node_Str");
  the(users.size()).shouldBeEqual(2);
  the(users.get(0).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(users.get(1).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(others.size()).shouldBeEqual(2);
  the(others.get(0).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(others.get(1).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldFindFOtherDb(){
  List<User> users=User.findAll().orderBy("String_Node_Str");
  List<OtherDbModel> others=OtherDbModel.findAll().orderBy("String_Node_Str");
  the(users.size()).shouldBeEqual(3);
  the(users.get(0).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(users.get(1).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(users.get(2).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(others.size()).shouldBeEqual(2);
  the(others.get(0).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
  the(others.get(1).get("String_Node_Str")).shouldBeEqual("String_Node_Str");
}
Program: 26008
Project: 26008
Buggy source:
@Test public void shouldGenerateFromList(){
  deleteAndPopulateTables("String_Node_Str","String_Node_Str");
  LazyList<User> personList=User.findAll().orderBy("String_Node_Str").include(Address.class);
  String xml=personList.toXml(false,true);
  a(XPathHelper.count("String_Node_Str",xml)).shouldEqual(2);
  a(XPathHelper.count("String_Node_Str",xml)).shouldEqual(7);
  a(XPathHelper.count("String_Node_Str",xml)).shouldEqual(7);
}

Fixed version (ground truth):
@Test public void shouldGenerateFromList(){
  deleteAndPopulateTables("String_Node_Str","String_Node_Str");
  LazyList<User> personList=User.findAll().orderBy("String_Node_Str").include(Address.class);
  String xml=personList.toXml(false,true);
  a(XPathHelper.count("String_Node_Str",xml)).shouldEqual(3);
  a(XPathHelper.count("String_Node_Str",xml)).shouldEqual(7);
  a(XPathHelper.count("String_Node_Str",xml)).shouldEqual(7);
}
Program: 26016
Project: 26016
Buggy source:
/** 
 * This will scan directory for class files, non-recursive.
 * @param directory directory to scan.
 * @throws IOException , NotFoundException
 */
private void findFiles(File directory) throws IOException, ClassNotFoundException {
  File files[]=directory.listFiles(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str");
    }
  }
);
  if (files != null) {
    for (    File file : files) {
      int current=currentDirectoryPath.length();
      String fileName=file.getCanonicalPath().substring(++current);
      String className=fileName.replace(File.separatorChar,'.').substring(0,fileName.length() - 6);
      tryClass(className);
    }
  }
}

Fixed version (ground truth):
/** 
 * This will scan directory for class files, non-recursive.
 * @param directory directory to scan.
 * @throws IOException , NotFoundException
 */
private void findFiles(File directory) throws IOException, ClassNotFoundException {
  File[] files=directory.listFiles(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str");
    }
  }
);
  if (files != null) {
    for (    File file : files) {
      int current=currentDirectoryPath.length();
      String fileName=file.getCanonicalPath().substring(++current);
      String className=fileName.replace(File.separatorChar,'.').substring(0,fileName.length() - 6);
      tryClass(className);
    }
  }
}
Program: 26017
Project: 26017
Buggy source:
protected void processRS(RowListener listener) throws SQLException {
  ResultSetMetaData metaData=rs.getMetaData();
  String labels[]=new String[metaData.getColumnCount()];
  int i=0;
  while (i < labels.length) {
    labels[i++]=metaData.getColumnLabel(i);
  }
  while (rs.next()) {
    Map<String,Object> row=new CaseInsensitiveMap<Object>();
    i=0;
    while (i < labels.length) {
      row.put(labels[i++],rs.getObject(i));
    }
    if (!listener.next(row)) {
      break;
    }
  }
}

Fixed version (ground truth):
protected void processRS(RowListener listener) throws SQLException {
  ResultSetMetaData metaData=rs.getMetaData();
  String[] labels=new String[metaData.getColumnCount()];
  int i=0;
  while (i < labels.length) {
    labels[i++]=metaData.getColumnLabel(i);
  }
  while (rs.next()) {
    Map<String,Object> row=new CaseInsensitiveMap<Object>();
    i=0;
    while (i < labels.length) {
      row.put(labels[i++],rs.getObject(i));
    }
    if (!listener.next(row)) {
      break;
    }
  }
}
Program: 26018
Project: 26018
Buggy source:
private static void copyStream(Reader r,Writer w) throws IOException {
  char buffer[]=new char[4096];
  for (int n=0; -1 != (n=r.read(buffer)); ) {
    w.write(buffer,0,n);
  }
}

Fixed version (ground truth):
private static void copyStream(Reader r,Writer w) throws IOException {
  char[] buffer=new char[4096];
  for (int n=0; -1 != (n=r.read(buffer)); ) {
    w.write(buffer,0,n);
  }
}
Program: 26022
Project: 26022
Buggy source:
private void instrument(String instrumentationDirectory) throws MalformedURLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  if (!new File(instrumentationDirectory).exists()) {
    getLog().info("String_Node_Str" + instrumentationDirectory + "String_Node_Str");
    return;
  }
  ClassLoader realmLoader=getClass().getClassLoader();
  URL outDir=new File(instrumentationDirectory).toURL();
  Method addUrlMethod=realmLoader.getClass().getSuperclass().getDeclaredMethod("String_Node_Str",URL.class);
  addUrlMethod.setAccessible(true);
  addUrlMethod.invoke(realmLoader,outDir);
  Instrumentation instrumentation=new Instrumentation();
  instrumentation.setOutputDirectory(instrumentationDirectory);
  instrumentation.setLog(getLog());
  instrumentation.instrument();
}

Fixed version (ground truth):
private void instrument(String instrumentationDirectory) throws MalformedURLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  if (!new File(instrumentationDirectory).exists()) {
    getLog().info("String_Node_Str" + instrumentationDirectory + "String_Node_Str");
    return;
  }
  ClassLoader realmLoader=getClass().getClassLoader();
  URL outDir=new File(instrumentationDirectory).toURL();
  Method addUrlMethod=realmLoader.getClass().getSuperclass().getDeclaredMethod("String_Node_Str",URL.class);
  addUrlMethod.setAccessible(true);
  addUrlMethod.invoke(realmLoader,outDir);
  Instrumentation instrumentation=new Instrumentation();
  instrumentation.setOutputDirectory(instrumentationDirectory);
  instrumentation.instrument();
}
Program: 26023
Project: 26023
Buggy source:
public void instrument(){
  if (outputDirectory == null) {
    throw new RuntimeException("String_Node_Str");
  }
  try {
    log.info("String_Node_Str");
    log.info("String_Node_Str" + outputDirectory);
    InstrumentationModelFinder mf=new InstrumentationModelFinder(log);
    File target=new File(outputDirectory);
    mf.processDirectoryPath(target);
    ModelInstrumentation mi=new ModelInstrumentation(log);
    for (    CtClass clazz : mf.getModels()) {
      mi.instrument(clazz);
    }
    generateModelsFile(mf.getModels(),target);
    log.info("String_Node_Str");
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void instrument(){
  if (outputDirectory == null) {
    throw new RuntimeException("String_Node_Str");
  }
  try {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + outputDirectory);
    InstrumentationModelFinder mf=new InstrumentationModelFinder();
    File target=new File(outputDirectory);
    mf.processDirectoryPath(target);
    ModelInstrumentation mi=new ModelInstrumentation();
    for (    CtClass clazz : mf.getModels()) {
      mi.instrument(clazz);
    }
    generateModelsFile(mf.getModels(),target);
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 26024
Project: 26024
Buggy source:
InstrumentationModelFinder(Log log) throws NotFoundException {
  ClassPool pool=ClassPool.getDefault();
  pool.insertClassPath(new ClassClassPath(ModelFinder.class));
  modelClass=pool.get("String_Node_Str");
  this.log=log;
}

Fixed version (ground truth):
InstrumentationModelFinder() throws NotFoundException {
  ClassPool pool=ClassPool.getDefault();
  pool.insertClassPath(new ClassClassPath(ModelFinder.class));
  modelClass=pool.get("String_Node_Str");
}
Program: 26025
Project: 26025
Buggy source:
@Override protected void classFound(String className) throws IOException, ClassNotFoundException {
  try {
    ClassPool cp=ClassPool.getDefault();
    CtClass clazz=cp.get(className);
    if (clazz.subclassOf(modelClass) && !clazz.equals(modelClass)) {
      models.add(clazz);
      log.info("String_Node_Str" + clazz.getName());
    }
  }
 catch (  Exception e) {
    throw new InstrumentationException(e);
  }
}

Fixed version (ground truth):
@Override protected void classFound(String className) throws IOException, ClassNotFoundException {
  try {
    ClassPool cp=ClassPool.getDefault();
    CtClass clazz=cp.get(className);
    if (clazz.subclassOf(modelClass) && !clazz.equals(modelClass)) {
      models.add(clazz);
      System.out.println("String_Node_Str" + clazz.getName());
    }
  }
 catch (  Exception e) {
    throw new InstrumentationException(e);
  }
}
Program: 26026
Project: 26026
Buggy source:
private void addDelegates(CtClass target) throws NotFoundException, CannotCompileException {
  CtMethod[] modelMethods=modelClass.getDeclaredMethods();
  CtMethod[] targetMethods=target.getDeclaredMethods();
  for (  CtMethod method : modelMethods) {
    if (Modifier.PRIVATE == method.getModifiers()) {
      continue;
    }
    CtMethod newMethod=CtNewMethod.delegator(method,target);
    if (!targetHasMethod(targetMethods,newMethod)) {
      target.addMethod(newMethod);
    }
 else {
      log.info("String_Node_Str" + newMethod.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void addDelegates(CtClass target) throws NotFoundException, CannotCompileException {
  CtMethod[] modelMethods=modelClass.getDeclaredMethods();
  CtMethod[] targetMethods=target.getDeclaredMethods();
  for (  CtMethod method : modelMethods) {
    if (Modifier.PRIVATE == method.getModifiers()) {
      continue;
    }
    CtMethod newMethod=CtNewMethod.delegator(method,target);
    if (!targetHasMethod(targetMethods,newMethod)) {
      target.addMethod(newMethod);
    }
 else {
      System.out.println("String_Node_Str" + newMethod.getName() + "String_Node_Str");
    }
  }
}
Program: 26027
Project: 26027
Buggy source:
public ModelInstrumentation(Log log) throws NotFoundException {
  ClassPool cp=ClassPool.getDefault();
  cp.insertClassPath(new ClassClassPath(this.getClass()));
  modelClass=ClassPool.getDefault().get("String_Node_Str");
  this.log=log;
}

Fixed version (ground truth):
public ModelInstrumentation() throws NotFoundException {
  ClassPool cp=ClassPool.getDefault();
  cp.insertClassPath(new ClassClassPath(this.getClass()));
  modelClass=ClassPool.getDefault().get("String_Node_Str");
}
Program: 26028
Project: 26028
Buggy source:
public void instrument(CtClass modelClass) throws InstrumentationException {
  try {
    addDelegates(modelClass);
    CtMethod m=CtNewMethod.make("String_Node_Str" + modelClass.getName() + "String_Node_Str",modelClass);
    CtMethod getClassNameMethod=modelClass.getDeclaredMethod("String_Node_Str");
    modelClass.removeMethod(getClassNameMethod);
    modelClass.addMethod(m);
    String out=getOutputDirectory(modelClass);
    log.info("String_Node_Str" + modelClass.getName() + "String_Node_Str"+ out);
    modelClass.writeFile(out);
  }
 catch (  Exception e) {
    throw new InstrumentationException(e);
  }
}

Fixed version (ground truth):
public void instrument(CtClass modelClass) throws InstrumentationException {
  try {
    addDelegates(modelClass);
    CtMethod m=CtNewMethod.make("String_Node_Str" + modelClass.getName() + "String_Node_Str",modelClass);
    CtMethod getClassNameMethod=modelClass.getDeclaredMethod("String_Node_Str");
    modelClass.removeMethod(getClassNameMethod);
    modelClass.addMethod(m);
    String out=getOutputDirectory(modelClass);
    System.out.println("String_Node_Str" + modelClass.getName() + "String_Node_Str"+ out);
    modelClass.writeFile(out);
  }
 catch (  Exception e) {
    throw new InstrumentationException(e);
  }
}
Program: 26030
Project: 26030
Buggy source:
public void before() throws Exception {
  super.before();
  deleteAndPopulateTables("String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void before() throws Exception {
  super.before();
  deleteFromTable("String_Node_Str");
  deleteFromTable("String_Node_Str");
  deleteFromTable("String_Node_Str");
  populateTable("String_Node_Str");
  populateTable("String_Node_Str");
  populateTable("String_Node_Str");
}
Program: 26031
Project: 26031
Buggy source:
void init(String dbName){
  if (initedDbs.contains(dbName))   return;
  initedDbs.add(dbName);
  try {
    mf.findModels();
    String dbType=ConnectionsAccess.getConnection(dbName).getMetaData().getDatabaseProductName();
    registerModels(dbName,mf.getModelsForDb(dbName),dbType);
    String[] tables=metaModels.getTableNames(dbName);
    for (    String table : tables) {
      Map<String,ColumnMetadata> metaParams=fetchMetaParams(table,dbName);
      registerColumnMetadata(table,metaParams);
    }
    processOverrides(mf.getModelsForDb(dbName));
    for (    String table : tables) {
      discoverAssociationsFor(table,dbName);
    }
  }
 catch (  Exception e) {
    if (e instanceof InitException)     throw (InitException)e;
    if (e instanceof DBException)     throw (DBException)e;
 else     throw new InitException(e);
  }
}

Fixed version (ground truth):
void init(String dbName){
  if (initedDbs.contains(dbName)) {
    return;
  }
synchronized (this) {
    if (initedDbs.contains(dbName)) {
      return;
    }
 else {
      initedDbs.add(dbName);
    }
    try {
      mf.findModels();
      String dbType=ConnectionsAccess.getConnection(dbName).getMetaData().getDatabaseProductName();
      registerModels(dbName,mf.getModelsForDb(dbName),dbType);
      String[] tables=metaModels.getTableNames(dbName);
      for (      String table : tables) {
        Map<String,ColumnMetadata> metaParams=fetchMetaParams(table,dbName);
        registerColumnMetadata(table,metaParams);
      }
      processOverrides(mf.getModelsForDb(dbName));
      for (      String table : tables) {
        discoverAssociationsFor(table,dbName);
      }
    }
 catch (    Exception e) {
      if (e instanceof InitException) {
        throw (InitException)e;
      }
      if (e instanceof DBException) {
        throw (DBException)e;
      }
 else {
        throw new InitException(e);
      }
    }
  }
}
Program: 26032
Project: 26032
Buggy source:
public Collection<String> values(){
  List<String> messageList=new ArrayList<String>();
  for (  Object v : validators.entrySet()) {
    messageList.add(((Validator)v).formatMessage(locale));
  }
  return messageList;
}

Fixed version (ground truth):
public Collection<String> values(){
  List<String> messageList=new ArrayList<String>();
  for (  java.util.Map.Entry<String,Validator> v : validators.entrySet()) {
    messageList.add(((Validator)v.getValue()).formatMessage(locale));
  }
  return messageList;
}
Program: 26033
Project: 26033
Buggy source:
/** 
 * @param result result of execution (contains also the exit value)
 */
public InvalidExitValueException(String message,ProcessResult result){
  super(message,result);
}

Fixed version (ground truth):
/** 
 * @param message the detail message of the exception
 * @param result result of execution (contains also the exit value)
 */
public InvalidExitValueException(String message,ProcessResult result){
  super(message,result);
}
Program: 26034
Project: 26034
Buggy source:
/** 
 * @param result result of execution (contains also the exit value)
 */
public InvalidOutputException(String message,ProcessResult result){
  super(message,result);
}

Fixed version (ground truth):
/** 
 * @param message the detail message of the exception
 * @param result result of execution (contains also the exit value)
 */
public InvalidOutputException(String message,ProcessResult result){
  super(message,result);
}
Program: 26035
Project: 26035
Buggy source:
/** 
 * @param result result of execution (contains also the exit value)
 */
public InvalidResultException(String message,ProcessResult result){
  super(message);
  this.result=result;
}

Fixed version (ground truth):
/** 
 * @param message the detail message of the exception
 * @param result result of execution (contains also the exit value)
 */
public InvalidResultException(String message,ProcessResult result){
  super(message);
  this.result=result;
}
Program: 26036
Project: 26036
Buggy source:
/** 
 * Sets a stream handler for the process being executed. This will overwrite any stream redirection that was previously set to use the provided handler.
 * @return This process executor.
 */
public ProcessExecutor streams(ExecuteStreamHandler streams){
  validateStreams(streams,readOutput);
  this.streams=streams;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets a stream handler for the process being executed. This will overwrite any stream redirection that was previously set to use the provided handler.
 * @param streams the stream handler
 * @return This process executor.
 */
public ProcessExecutor streams(ExecuteStreamHandler streams){
  validateStreams(streams,readOutput);
  this.streams=streams;
  return this;
}
Program: 26037
Project: 26037
Buggy source:
/** 
 * Sets a timeout for closing standard streams of the process being executed. When this timeout is reached we log a warning but consider that the process has finished. We also flush the streams so that all output read so far is available. <p> This can be used on Windows in case a process exits quickly but closing the streams blocks forever. </p> <p> Closing timeout must fit into the general execution timeout (see   {@link #timeout(long,TimeUnit)}). By default there's no closing timeout.
 * @param timeout timeout for closing streams of a process.
 * @return This process executor.
 */
public ProcessExecutor closeTimeout(long timeout,TimeUnit unit){
  this.closeTimeout=timeout;
  this.closeTimeoutUnit=unit;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets a timeout for closing standard streams of the process being executed. When this timeout is reached we log a warning but consider that the process has finished. We also flush the streams so that all output read so far is available. <p> This can be used on Windows in case a process exits quickly but closing the streams blocks forever. </p> <p> Closing timeout must fit into the general execution timeout (see   {@link #timeout(long,TimeUnit)}). By default there's no closing timeout.
 * @param timeout timeout for closing streams of a process.
 * @param unit the time unit of the timeout
 * @return This process executor.
 */
public ProcessExecutor closeTimeout(long timeout,TimeUnit unit){
  this.closeTimeout=timeout;
  this.closeTimeoutUnit=unit;
  return this;
}
Program: 26038
Project: 26038
Buggy source:
/** 
 * Sets this working directory for the process being executed. The argument may be <code>null</code> -- this means to use the working directory of the current Java process, usually the directory named by the system property <code>user.dir</code>, as the working directory of the child process.</p>
 * @param directory  The new working directory
 * @return  This process executor.
 */
public ProcessExecutor directory(File directory){
  builder.directory(directory);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets this working directory for the process being executed. The argument may be <code>null</code> -- this means to use the working directory of the current Java process, usually the directory named by the system property <code>user.dir</code>, as the working directory of the child process.
 * @param directory  The new working directory
 * @return  This process executor.
 */
public ProcessExecutor directory(File directory){
  builder.directory(directory);
  return this;
}
Program: 26039
Project: 26039
Buggy source:
/** 
 * Sets a timeout for the process being executed. When this timeout is reached a   {@link TimeoutException} is thrown and the process is destroyed.This only applies to <code>execute</code> methods not <code>start</code> methods.
 * @param timeout timeout for running a process.
 * @return This process executor.
 */
public ProcessExecutor timeout(long timeout,TimeUnit unit){
  this.timeout=timeout;
  this.timeoutUnit=unit;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets a timeout for the process being executed. When this timeout is reached a   {@link TimeoutException} is thrown and the process is destroyed.This only applies to <code>execute</code> methods not <code>start</code> methods.
 * @param timeout timeout for running a process.
 * @param unit the time unit of the timeout
 * @return This process executor.
 */
public ProcessExecutor timeout(long timeout,TimeUnit unit){
  this.timeout=timeout;
  this.timeoutUnit=unit;
  return this;
}
Program: 26040
Project: 26040
Buggy source:
/** 
 * Override this to customize how the background task is created.
 */
protected <T>Callable<T> wrapTask(Callable<T> task){
  Map contextMap=MDC.getCopyOfContextMap();
  if (contextMap != null) {
    return new MDCCallableAdapter(task,contextMap);
  }
  return task;
}

Fixed version (ground truth):
/** 
 * Override this to customize how the background task is created.
 * @param < T > the type of the Task
 * @param task the Task to be wrapped
 * @return the wrapped task
 */
protected <T>Callable<T> wrapTask(Callable<T> task){
  Map contextMap=MDC.getCopyOfContextMap();
  if (contextMap != null) {
    return new MDCCallableAdapter(task,contextMap);
  }
  return task;
}
Program: 26041
Project: 26041
Buggy source:
/** 
 * Override this to customize how the waiting task is started in the background.
 */
protected <T>Future<T> invokeSubmit(ExecutorService executor,Callable<T> task){
  return executor.submit(wrapTask(task));
}

Fixed version (ground truth):
/** 
 * Override this to customize how the waiting task is started in the background.
 * @param < T > the type of the task
 * @param executor the executor service to submit the task on
 * @param task the task to be submitted
 * @return the future of the task
 */
protected <T>Future<T> invokeSubmit(ExecutorService executor,Callable<T> task){
  return executor.submit(wrapTask(task));
}
Program: 26042
Project: 26042
Buggy source:
/** 
 * Closes standard streams of a given sub process.
 * @param process sub process (not <code>null</code>).
 */
void close(Process process) throws IOException, InterruptedException ;

Fixed version (ground truth):
/** 
 * Closes standard streams of a given sub process.
 * @param process sub process (not <code>null</code>).
 * @throws IOException if I/O errors occur while closing the underlying stream
 * @throws InterruptedException if underlying throws a InterruptedException
 */
void close(Process process) throws IOException, InterruptedException ;
Program: 26043
Project: 26043
Buggy source:
/** 
 * Install a handler for the input stream of the subprocess.
 * @param os output stream to write to the standard input stream of the subprocess
 */
void setProcessInputStream(OutputStream os) throws IOException ;

Fixed version (ground truth):
/** 
 * Install a handler for the input stream of the subprocess.
 * @param os output stream to write to the standard input stream of the subprocess
 * @throws IOException throws a IO exception in case of IO issues of the underlying stream
 */
void setProcessInputStream(OutputStream os) throws IOException ;
Program: 26044
Project: 26044
Buggy source:
/** 
 * Install a handler for the output stream of the subprocess.
 * @param is input stream to read from the error stream from the subprocess
 */
void setProcessOutputStream(InputStream is) throws IOException ;

Fixed version (ground truth):
/** 
 * Install a handler for the output stream of the subprocess.
 * @param is input stream to read from the error stream from the subprocess
 * @throws IOException throws a IO exception in case of IO issues of the underlying stream
 */
void setProcessOutputStream(InputStream is) throws IOException ;
Program: 26045
Project: 26045
Buggy source:
/** 
 * Start handling of the streams.
 */
void start() throws IOException ;

Fixed version (ground truth):
/** 
 * Start handling of the streams.
 * @throws IOException throws a IO exception in case of IO issues of the underlying stream
 */
void start() throws IOException ;
Program: 26046
Project: 26046
Buggy source:
/** 
 * Install a handler for the error stream of the subprocess.
 * @param is input stream to read from the error stream from the subprocess
 */
void setProcessErrorStream(InputStream is) throws IOException ;

Fixed version (ground truth):
/** 
 * Install a handler for the error stream of the subprocess.
 * @param is input stream to read from the error stream from the subprocess
 * @throws IOException throws a IO exception in case of IO issues of the underlying stream
 */
void setProcessErrorStream(InputStream is) throws IOException ;
Program: 26047
Project: 26047
Buggy source:
/** 
 * Override this to customize how the background task is created.
 */
protected Thread newThread(Runnable task){
  Thread result=new Thread(wrapTask(task));
  result.setDaemon(true);
  return result;
}

Fixed version (ground truth):
/** 
 * Override this to customize how the background task is created.
 * @param task the task to be run in the background
 * @return the thread of the task
 */
protected Thread newThread(Runnable task){
  Thread result=new Thread(wrapTask(task));
  result.setDaemon(true);
  return result;
}
Program: 26048
Project: 26048
Buggy source:
/** 
 * Override this to customize how the background task is created.
 */
protected Runnable wrapTask(Runnable task){
  Map contextMap=MDC.getCopyOfContextMap();
  if (contextMap != null) {
    return new MDCRunnableAdapter(task,contextMap);
  }
  return task;
}

Fixed version (ground truth):
/** 
 * Override this to customize how the background task is created.
 * @param task the task to be run in the background
 * @return the runnable of the wrapped task
 */
protected Runnable wrapTask(Runnable task){
  Map contextMap=MDC.getCopyOfContextMap();
  if (contextMap != null) {
    return new MDCRunnableAdapter(task,contextMap);
  }
  return task;
}
Program: 26049
Project: 26049
Buggy source:
/** 
 * @param exitValue The exit value
 */
public InvalidExitValueException(ProcessResult result,Collection<Integer> allowedExitValues){
  super("String_Node_Str" + result.exitValue() + "String_Node_Str"+ allowedExitValues);
  this.result=result;
}

Fixed version (ground truth):
/** 
 * @param result result of execution (contains also the exit value)
 */
public InvalidExitValueException(ProcessResult result,Collection<Integer> allowedExitValues){
  super("String_Node_Str" + result.exitValue() + "String_Node_Str"+ allowedExitValues);
  this.result=result;
}
Program: 26050
Project: 26050
Buggy source:
/** 
 * @return binary output of the finished process.You have to invoke  {@link ProcessExecutor#readOutput()} to set the process output to be read.
 * @throws IllegalStateException if the output was not read.
 */
public byte[] output(){
  if (output == null)   throw new IllegalStateException("String_Node_Str");
  return output;
}

Fixed version (ground truth):
/** 
 * @return binary output of the finished process.You have to invoke  {@link ProcessExecutor#readOutput(boolean)} to set the process output to be read.
 * @throws IllegalStateException if the output was not read.
 */
public byte[] output(){
  if (output == null)   throw new IllegalStateException("String_Node_Str");
  return output;
}
Program: 26051
Project: 26051
Buggy source:
/** 
 * @return output of the finished process converted to UTF-8 String.You have to invoke  {@link ProcessExecutor#readOutput()} to set the process output to be read.
 * @throws IllegalStateException if the output was not read.
 */
public String outputUTF8(){
  return outputString("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @return output of the finished process converted to UTF-8 String.You have to invoke  {@link ProcessExecutor#readOutput(boolean)} to set the process output to be read.
 * @throws IllegalStateException if the output was not read.
 */
public String outputUTF8(){
  return outputString("String_Node_Str");
}
Program: 26052
Project: 26052
Buggy source:
/** 
 * @return output of the finished process converted to a String.You have to invoke  {@link ProcessExecutor#readOutput()} to set the process output to be read.
 * @param charset The name of a supported char set.
 * @throws IllegalStateException if the output was not read or the char set was not supported.
 */
public String outputString(String charset){
  try {
    return new String(output(),charset);
  }
 catch (  UnsupportedEncodingException e) {
    throw new IllegalStateException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @return output of the finished process converted to a String.You have to invoke  {@link ProcessExecutor#readOutput(boolean)} to set the process output to be read.
 * @param charset The name of a supported char set.
 * @throws IllegalStateException if the output was not read or the char set was not supported.
 */
public String outputString(String charset){
  try {
    return new String(output(),charset);
  }
 catch (  UnsupportedEncodingException e) {
    throw new IllegalStateException(e.getMessage());
  }
}
Program: 26053
Project: 26053
Buggy source:
@Override public void onReceivedHttpAuthRequest(AwHttpAuthHandler handler,String host,String realm){
  TraceEvent.begin();
  if (TRACE)   Log.d(TAG,"String_Node_Str" + host);
  TraceEvent.end();
}

Fixed version (ground truth):
@Override public void onReceivedHttpAuthRequest(AwHttpAuthHandler handler,String host,String realm){
  TraceEvent.begin();
  if (TRACE)   Log.d(TAG,"String_Node_Str" + host);
  mWebViewClient.onReceivedHttpAuthRequest(mWebView,new AwHttpAuthHandlerAdapter(handler),host,realm);
  TraceEvent.end();
}
Program: 26054
Project: 26054
Buggy source:
@Override public boolean getDisplayZoomControls(){
  return mAwSettings.getDisplayZoomControls();
}

Fixed version (ground truth):
@Override public boolean getDisplayZoomControls(){
  return mContentSettings.getDisplayZoomControls();
}
Program: 26055
Project: 26055
Buggy source:
@Override public void setSaveFormData(boolean save){
  mAwSettings.setSaveFormData(save);
}

Fixed version (ground truth):
@Override public void setSaveFormData(boolean save){
}
Program: 26056
Project: 26056
Buggy source:
@Override public boolean getBuiltInZoomControls(){
  return mAwSettings.getBuiltInZoomControls();
}

Fixed version (ground truth):
@Override public boolean getBuiltInZoomControls(){
  return mContentSettings.getBuiltInZoomControls();
}
Program: 26057
Project: 26057
Buggy source:
@Override public void setDisplayZoomControls(boolean enabled){
  mAwSettings.setDisplayZoomControls(enabled);
}

Fixed version (ground truth):
@Override public void setDisplayZoomControls(boolean enabled){
  mContentSettings.setDisplayZoomControls(enabled);
}
Program: 26058
Project: 26058
Buggy source:
@Override public void setSupportZoom(boolean support){
  mAwSettings.setSupportZoom(support);
}

Fixed version (ground truth):
@Override public void setSupportZoom(boolean support){
  mContentSettings.setSupportZoom(support);
}
Program: 26059
Project: 26059
Buggy source:
@Override public boolean supportZoom(){
  return mAwSettings.supportZoom();
}

Fixed version (ground truth):
@Override public boolean supportZoom(){
  return mContentSettings.supportZoom();
}
Program: 26060
Project: 26060
Buggy source:
@Override public boolean getSaveFormData(){
  return mAwSettings.getSaveFormData();
}

Fixed version (ground truth):
@Override public boolean getSaveFormData(){
  return false;
}
Program: 26061
Project: 26061
Buggy source:
@Override public void setBuiltInZoomControls(boolean enabled){
  mAwSettings.setBuiltInZoomControls(enabled);
}

Fixed version (ground truth):
@Override public void setBuiltInZoomControls(boolean enabled){
  mContentSettings.setBuiltInZoomControls(enabled);
}
Program: 26062
Project: 26062
Buggy source:
private void splitBranch(Comparator comparator,Object keyForNextNode,Node nextNode){
  int halfSize=size / 2;
  int comparison=compareWithMidValues(comparator,keyForNextNode,halfSize);
  if (comparison == 0) {
    Branch nextBranch=newInstance(capacity);
    int copyFrom=keyOffset(halfSize);
    int length=arraySize() - copyFrom;
    shallowCopy(this,copyFrom,nextBranch,1,length);
    nextBranch.size=halfSize;
    nextBranch.firstKey(keyForNextNode);
    nextBranch.setChild(0,nextNode);
    clearArrayFrom(keyOffset(halfSize));
    size=halfSize;
    next(nextBranch);
  }
 else   if (comparison < 0) {
    Branch nextBranch=newInstance(capacity);
    int copyFrom=keyOffset(halfSize);
    int length=arraySize() - copyFrom;
    shallowCopy(this,copyFrom,nextBranch,1,length);
    nextBranch.size=halfSize;
    nextBranch.firstKey(storedKey(halfSize - 1));
    nextBranch.setChild(0,getChild(halfSize * 2));
    clearArrayFrom(keyOffset(halfSize - 1));
    size=halfSize - 1;
    insertNode(comparator,keyForNextNode,nextNode);
    next(nextBranch);
  }
 else {
    Branch nextBranch=newInstance(capacity);
    int copyFrom=keyOffset(halfSize + 1);
    int length=arraySize() - copyFrom;
    shallowCopy(this,copyFrom,nextBranch,1,length);
    nextBranch.size=halfSize - 1;
    nextBranch.firstKey(storedKey(halfSize));
    nextBranch.setChild(0,getChild((halfSize + 1) * 2));
    clearArrayFrom(keyOffset(halfSize));
    size=halfSize;
    nextBranch.insertNode(comparator,keyForNextNode,nextNode);
    next(nextBranch);
  }
}

Fixed version (ground truth):
private void splitBranch(Comparator comparator,Object keyForNextNode,Node nextNode){
  int halfSize=size / 2;
  int comparison=compareWithMidValues(comparator,keyForNextNode,halfSize);
  if (comparison == 0) {
    Branch nextBranch=create(capacity);
    int copyFrom=keyOffset(halfSize);
    int length=arraySize() - copyFrom;
    shallowCopy(this,copyFrom,nextBranch,1,length);
    nextBranch.size=halfSize;
    nextBranch.firstKey(keyForNextNode);
    nextBranch.setChild(0,nextNode);
    clearArrayFrom(keyOffset(halfSize));
    size=halfSize;
    next(nextBranch);
  }
 else   if (comparison < 0) {
    Branch nextBranch=create(capacity);
    int copyFrom=keyOffset(halfSize);
    int length=arraySize() - copyFrom;
    shallowCopy(this,copyFrom,nextBranch,1,length);
    nextBranch.size=halfSize;
    nextBranch.firstKey(storedKey(halfSize - 1));
    nextBranch.setChild(0,getChild(halfSize * 2));
    clearArrayFrom(keyOffset(halfSize - 1));
    size=halfSize - 1;
    insertNode(comparator,keyForNextNode,nextNode);
    next(nextBranch);
  }
 else {
    Branch nextBranch=create(capacity);
    int copyFrom=keyOffset(halfSize + 1);
    int length=arraySize() - copyFrom;
    shallowCopy(this,copyFrom,nextBranch,1,length);
    nextBranch.size=halfSize - 1;
    nextBranch.firstKey(storedKey(halfSize));
    nextBranch.setChild(0,getChild((halfSize + 1) * 2));
    clearArrayFrom(keyOffset(halfSize));
    size=halfSize;
    nextBranch.insertNode(comparator,keyForNextNode,nextNode);
    next(nextBranch);
  }
}
Program: 26063
Project: 26063
Buggy source:
private static Branch newInstance(int nodeSize){
  int length=(nodeSize * 2) + 1;
  return ReferenceArray.newSubclassInstance(Branch.class,length);
}

Fixed version (ground truth):
private static Branch newInstance(Node left,Node right,int nodeSize){
  Branch branch=create(nodeSize);
  branch.setChild(0,left);
  branch.setChild(1,right.firstKey());
  branch.setChild(2,right);
  branch.size=1;
  return branch;
}
Program: 26064
Project: 26064
Buggy source:
@Override public CtorAndArgs<SimpleOrderWithBuilder> getForIndices(long[] indices) throws NoSuchMethodException {
  CtorAndArgs<SimpleOrderWithBuilder> args=simpleOrderArgs != null ? simpleOrderArgs : simpleOrderArgs();
  long index=indices[0];
  if (index > bidIndex + askIndex) {
    throw new IllegalArgumentException();
  }
  int i=(int)index;
  if (i < bidIndex) {
    args.setArgs(this,bidPrices[i],bidQuantities[i]);
  }
 else {
    i=i - bidIndex;
    args.setArgs(this,askPrices[i],askQuantities[i]);
  }
  return args;
}

Fixed version (ground truth):
@Override public CtorAndArgs<SimpleOrderWithBuilder> getForIndices(long... indices) throws NoSuchMethodException {
  CtorAndArgs<SimpleOrderWithBuilder> args=simpleOrderArgs != null ? simpleOrderArgs : simpleOrderArgs();
  long index=indices[0];
  if (index > bidIndex + askIndex) {
    throw new IllegalArgumentException();
  }
  int i=(int)index;
  if (i < bidIndex) {
    args.setArgs(this,bidPrices[i],bidQuantities[i]);
  }
 else {
    i=i - bidIndex;
    args.setArgs(this,askPrices[i],askQuantities[i]);
  }
  return args;
}
Program: 26065
Project: 26065
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void recycle(CtorAndArgs ctorAndArgs){
  this.simpleOrderArgs=ctorAndArgs;
}

Fixed version (ground truth):
@Override public void recycle(CtorAndArgs<SimpleOrderWithBuilder> ctorAndArgs){
  this.simpleOrderArgs=ctorAndArgs;
}
Program: 26066
Project: 26066
Buggy source:
public Builder orderType(OrderType orderType){
  this.orderType=orderType;
  return this;
}

Fixed version (ground truth):
public Builder orderType(SimpleOrderWithBuilder.OrderType orderType){
  this.orderType=orderType;
  return this;
}
Program: 26067
Project: 26067
Buggy source:
public OrderType getOrderType(){
  return orderType;
}

Fixed version (ground truth):
public SimpleOrderWithBuilder.OrderType getOrderType(){
  return orderType;
}
Program: 26068
Project: 26068
Buggy source:
private static CtorAndArgs<SimpleOrderWithBuilder> simpleOrderArgs(){
  try {
    final Constructor<SimpleOrderWithBuilder> simpleOrderConstructor=SimpleOrderWithBuilder.class.getConstructor(Builder.class,long.class,long.class);
    return new CtorAndArgs<SimpleOrderWithBuilder>(simpleOrderConstructor,null,0L,0L);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private static CtorAndArgs<SimpleOrderWithBuilder> simpleOrderArgs(){
  try {
    final Constructor<SimpleOrderWithBuilder> simpleOrderConstructor=SimpleOrderWithBuilder.class.getConstructor(Builder.class,SimpleOrderWithBuilder.Side.class,long.class,long.class);
    return new CtorAndArgs<SimpleOrderWithBuilder>(simpleOrderConstructor,null,0L,0L);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 26069
Project: 26069
Buggy source:
private static CtorAndArgs<MassOrderWithBuilder> massOrderCtorAndArgs(){
  try {
    final Class[] massOrderConstructorArgTypes={Builder.class};
    final Constructor<MassOrderWithBuilder> massOrderConstructor;
    massOrderConstructor=MassOrderWithBuilder.class.getConstructor(massOrderConstructorArgTypes);
    return new CtorAndArgs<MassOrderWithBuilder>(massOrderConstructor,(Object[])null);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private static CtorAndArgs<MassOrderWithBuilder> massOrderCtorAndArgs(){
  try {
    final Constructor<MassOrderWithBuilder> massOrderConstructor=MassOrderWithBuilder.class.getDeclaredConstructor(Builder.class);
    massOrderConstructor.setAccessible(true);
    return new CtorAndArgs<MassOrderWithBuilder>(massOrderConstructor,new Object[]{null});
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 26070
Project: 26070
Buggy source:
@Override public CtorAndArgs<SimpleOrderWithBuilder> getForIndices(long... indices) throws NoSuchMethodException {
  CtorAndArgs<SimpleOrderWithBuilder> args=simpleOrderArgs != null ? simpleOrderArgs : simpleOrderArgs();
  long index=indices[0];
  if (index > bidIndex + askIndex) {
    throw new IllegalArgumentException();
  }
  int i=(int)index;
  if (i < bidIndex) {
    args.setArgs(this,bidPrices[i],bidQuantities[i]);
  }
 else {
    i=i - bidIndex;
    args.setArgs(this,askPrices[i],askQuantities[i]);
  }
  return args;
}

Fixed version (ground truth):
@Override public CtorAndArgs<SimpleOrderWithBuilder> getForIndices(long... indices) throws NoSuchMethodException {
  CtorAndArgs<SimpleOrderWithBuilder> args=simpleOrderArgs != null ? simpleOrderArgs : simpleOrderArgs();
  long index=indices[0];
  if (index > bidIndex + askIndex) {
    throw new IllegalArgumentException();
  }
  int i=(int)index;
  if (i < bidIndex) {
    args.setArgs(this,SimpleOrderWithBuilder.Side.BID,bidPrices[i],bidQuantities[i]);
  }
 else {
    i=i - bidIndex;
    args.setArgs(this,SimpleOrderWithBuilder.Side.ASK,askPrices[i],askQuantities[i]);
  }
  return args;
}
Program: 26071
Project: 26071
Buggy source:
MassOrderWithBuilder(final Builder builder){
  this.accountId=builder.accountId;
  this.instructionId=builder.instructionId;
  this.orderType=builder.orderType;
  this.instrumentId=builder.instrumentId;
}

Fixed version (ground truth):
MassOrderWithBuilder(final Builder builder){
  this.accountId=builder.accountId;
  this.instructionId=builder.instructionId;
  this.orderType=builder.orderType;
  this.instrumentId=builder.instrumentId;
  this.askOrderIndex=builder.bidIndex;
}
Program: 26072
Project: 26072
Buggy source:
public MassOrderWithBuilder.OrderType getOrderType(){
  return this.orderType;
}

Fixed version (ground truth):
public SimpleOrderWithBuilder.OrderType getOrderType(){
  return this.orderType;
}
Program: 26073
Project: 26073
Buggy source:
public SimpleOrderWithBuilder(MassOrderWithBuilder.Builder builder,long price,long quantity){
  this.instrumentId=builder.instrumentId;
  this.accountId=builder.accountId;
  this.orderType=builder.orderType;
  this.price=price;
  this.quantity=quantity;
}

Fixed version (ground truth):
public SimpleOrderWithBuilder(MassOrderWithBuilder.Builder builder,Side side,long price,long quantity){
  this.side=side;
  this.instrumentId=builder.instrumentId;
  this.accountId=builder.accountId;
  this.orderType=builder.orderType;
  this.price=price;
  this.quantity=quantity;
}
Program: 26075
Project: 26075
Buggy source:
/** 
 * Copy an array of elements using the element class copy constructor
 * @param source The array to duplicate.
 * @param sourceOffset offset index in source where the region to be copied begins.
 * @param count of elements to copy.
 * @throws NoSuchMethodException if the element class does not have a copy constructor.
 */
public static <T>StructuredArray<T> copyInstance(StructuredArray<T> source,int sourceOffset,int count) throws NoSuchMethodException {
  if (source.getLength() < sourceOffset + count) {
    throw new ArrayIndexOutOfBoundsException("String_Node_Str" + source + "String_Node_Str"+ source.getLength()+ "String_Node_Str"+ sourceOffset+ "String_Node_Str"+ count+ "String_Node_Str");
  }
  @SuppressWarnings("String_Node_Str") final ElementConstructorGenerator<T> copyConstructorGenerator=(ElementConstructorGenerator<T>)new ElementCopyConstructorGenerator<T>(source.getElementClass(),source,sourceOffset);
  return new StructuredArray<T>(source.getLength(),source.getElementClass(),copyConstructorGenerator);
}

Fixed version (ground truth):
/** 
 * Copy an array of elements using the element class copy constructor
 * @param source The array to duplicate.
 * @param sourceOffset offset index in source where the region to be copied begins.
 * @param count of elements to copy.
 * @throws NoSuchMethodException if the element class does not have a copy constructor.
 */
public static <T>StructuredArray<T> copyInstance(StructuredArray<T> source,int sourceOffset,int count) throws NoSuchMethodException {
  if (source.getLength() < sourceOffset + count) {
    throw new ArrayIndexOutOfBoundsException("String_Node_Str" + source + "String_Node_Str"+ source.getLength()+ "String_Node_Str"+ sourceOffset+ "String_Node_Str"+ count+ "String_Node_Str");
  }
  @SuppressWarnings("String_Node_Str") final ElementConstructorGenerator<T> copyConstructorGenerator=(ElementConstructorGenerator<T>)new ElementCopyConstructorGenerator<T>(source.getElementClass(),source,sourceOffset);
  return new StructuredArray<T>(count,source.getElementClass(),copyConstructorGenerator);
}