nus-yam/ex-repair huggingface dataset:
Program: 70057
Project: 70057
Buggy source:
/** 
 * @see org.olat.core.util.vfs.VFSItem#resolveFile(java.lang.String)
 */
public static VFSItem resolveFile(VFSContainer rootContainer,String path){
  path=VFSManager.sanitizePath(path);
  if (path.equals("String_Node_Str")) {
    return rootContainer;
  }
  if (rootContainer instanceof LocalFolderImpl) {
    LocalFolderImpl l=(LocalFolderImpl)rootContainer;
    String fsPath=l.getBasefile().getAbsolutePath() + path;
    File t=new File(fsPath);
    if (t.exists()) {
      String bcroot=FolderConfig.getCanonicalRoot();
      if (t.isDirectory()) {
        if (fsPath.startsWith(bcroot)) {
          fsPath=fsPath.replace(bcroot,"String_Node_Str");
          return new OlatRootFolderImpl(fsPath,rootContainer);
        }
 else {
          return new LocalFolderImpl(t,rootContainer);
        }
      }
 else {
        if (fsPath.startsWith(bcroot)) {
          fsPath=fsPath.replace(bcroot,"String_Node_Str");
          return new OlatRootFileImpl(fsPath,rootContainer);
        }
 else {
          return new LocalFileImpl(t,rootContainer);
        }
      }
    }
 else {
      return null;
    }
  }
  String childName=VFSManager.extractChild(path);
  List<VFSItem> children=rootContainer.getItems();
  for (  VFSItem child : children) {
    String curName=child.getName();
    if (childName.equals(curName)) {
      return child.resolve(path.substring(childName.length() + 1));
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @see org.olat.core.util.vfs.VFSItem#resolveFile(java.lang.String)
 */
public static VFSItem resolveFile(VFSContainer rootContainer,String path){
  path=VFSManager.sanitizePath(path);
  if (path.equals("String_Node_Str")) {
    return rootContainer;
  }
  if (rootContainer instanceof LocalFolderImpl) {
    String childName=extractChild(path);
    LocalFolderImpl l=(LocalFolderImpl)rootContainer;
    File t=new File(l.getBasefile().getAbsolutePath(),childName);
    if (t.exists()) {
      String bcroot=FolderConfig.getCanonicalRoot();
      String fsPath=t.getAbsolutePath();
      if (t.isDirectory()) {
        VFSContainer subContainer;
        if (fsPath.startsWith(bcroot)) {
          fsPath=fsPath.replace(bcroot,"String_Node_Str");
          subContainer=new OlatRootFolderImpl(fsPath,rootContainer);
        }
 else {
          subContainer=new LocalFolderImpl(t,rootContainer);
        }
        String subPath=path.substring(childName.length() + 1);
        return resolveFile(subContainer,subPath);
      }
 else {
        if (fsPath.startsWith(bcroot)) {
          fsPath=fsPath.replace(bcroot,"String_Node_Str");
          return new OlatRootFileImpl(fsPath,rootContainer);
        }
 else {
          return new LocalFileImpl(t,rootContainer);
        }
      }
    }
 else {
      return null;
    }
  }
  String childName=extractChild(path);
  List<VFSItem> children=rootContainer.getItems();
  for (  VFSItem child : children) {
    String curName=child.getName();
    if (childName.equals(curName)) {
      return child.resolve(path.substring(childName.length() + 1));
    }
  }
  return null;
}
Program: 70058
Project: 70058
Buggy source:
/** 
 * Get the container which security callback affects this item. This searches up the path of parents to see wether it can find any container with a callback. If no callback can be found, null is returned.
 * @param vfsItem
 * @return
 */
public static VFSContainer findInheritingSecurityCallbackContainer(VFSItem vfsItem){
  if (vfsItem instanceof NamedContainerImpl)   return findInheritingSecurityCallbackContainer(((NamedContainerImpl)vfsItem).delegate);
  if (vfsItem instanceof MergeSource) {
    MergeSource mergeSource=(MergeSource)vfsItem;
    VFSContainer rootWriteContainer=mergeSource.getRootWriteContainer();
    if (rootWriteContainer != null && rootWriteContainer.getLocalSecurityCallback() != null) {
      return rootWriteContainer;
    }
 else     if (mergeSource.getLocalSecurityCallback() != null) {
      return mergeSource;
    }
 else     if (mergeSource.getParentContainer() != null) {
      return findInheritingSecurityCallbackContainer(mergeSource.getParentContainer());
    }
  }
 else {
    if ((vfsItem instanceof VFSContainer) && (vfsItem.getLocalSecurityCallback() != null))     return (VFSContainer)vfsItem;
    if (vfsItem.getParentContainer() != null)     return findInheritingSecurityCallbackContainer(vfsItem.getParentContainer());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the container which security callback affects this item. This searches up the path of parents to see wether it can find any container with a callback. If no callback can be found, null is returned.
 * @param vfsItem
 * @return
 */
public static VFSContainer findInheritingSecurityCallbackContainer(VFSItem vfsItem){
  if (vfsItem == null)   return null;
  if (vfsItem instanceof NamedContainerImpl)   return findInheritingSecurityCallbackContainer(((NamedContainerImpl)vfsItem).delegate);
  if (vfsItem instanceof MergeSource) {
    MergeSource mergeSource=(MergeSource)vfsItem;
    VFSContainer rootWriteContainer=mergeSource.getRootWriteContainer();
    if (rootWriteContainer != null && rootWriteContainer.getLocalSecurityCallback() != null) {
      return rootWriteContainer;
    }
 else     if (mergeSource.getLocalSecurityCallback() != null) {
      return mergeSource;
    }
 else     if (mergeSource.getParentContainer() != null) {
      return findInheritingSecurityCallbackContainer(mergeSource.getParentContainer());
    }
  }
 else {
    if ((vfsItem instanceof VFSContainer) && (vfsItem.getLocalSecurityCallback() != null))     return (VFSContainer)vfsItem;
    if (vfsItem.getParentContainer() != null)     return findInheritingSecurityCallbackContainer(vfsItem.getParentContainer());
  }
  return null;
}
Program: 70059
Project: 70059
Buggy source:
public static VCProvider createDefaultProvider(){
  if (_registeredProviders == null || _registeredProviders.isEmpty()) {
    return null;
  }
  String providerId=_registeredProviders.keySet().iterator().next();
  return createProvider(providerId);
}

Fixed version (ground truth):
public static VCProvider createDefaultProvider(){
  if (_registeredProviders == null || _registeredProviders.isEmpty()) {
    return null;
  }
  List<VCProvider> providers=getProviders();
  if (!providers.isEmpty()) {
    return createProvider(providers.get(0).getProviderId());
  }
  return null;
}
Program: 70060
Project: 70060
Buggy source:
/** 
 * Updates the catalog entry under the path specified in the URL.
 * @response.representation.200.qname {http://www.example.com}catalogEntryVO
 * @response.representation.200.mediaType application/xml, application/json
 * @response.representation.200.doc The catalog entry200.example  {@link org.olat.catalog.restapi.Examples#SAMPLE_CATALOGENTRYVO}
 * @response.representation.401.doc Not authorized
 * @response.representation.404.doc The path could not be resolved to a valid catalog entry
 * @param path The path
 * @param name The name
 * @param description The description
 * @param httpRquest The HTTP request
 * @param uriInfo The URI informations
 * @return The response
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public Response updatePostCatalogEntry(@PathParam("String_Node_Str") List<PathSegment> path,@FormParam("String_Node_Str") String name,@FormParam("String_Node_Str") String description,@Context HttpServletRequest httpRequest,@Context UriInfo uriInfo){
  CatalogEntryVO entryVo=new CatalogEntryVO();
  entryVo.setName(name);
  entryVo.setDescription(description);
  return updateCatalogEntry(path,entryVo,httpRequest,uriInfo);
}

Fixed version (ground truth):
/** 
 * Updates the catalog entry under the path specified in the URL.
 * @response.representation.200.qname {http://www.example.com}catalogEntryVO
 * @response.representation.200.mediaType application/xml, application/json
 * @response.representation.200.doc The catalog entry200.example  {@link org.olat.catalog.restapi.Examples#SAMPLE_CATALOGENTRYVO}
 * @response.representation.401.doc Not authorized
 * @response.representation.404.doc The path could not be resolved to a valid catalog entry
 * @param path The path
 * @param name The name
 * @param description The description
 * @param newParentKey The parent key to move the entry (optional)
 * @param httpRquest The HTTP request
 * @param uriInfo The URI informations
 * @return The response
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public Response updatePostCatalogEntry(@PathParam("String_Node_Str") List<PathSegment> path,@FormParam("String_Node_Str") String name,@FormParam("String_Node_Str") String description,@FormParam("String_Node_Str") Long newParentKey,@Context HttpServletRequest httpRequest,@Context UriInfo uriInfo){
  CatalogEntryVO entryVo=new CatalogEntryVO();
  entryVo.setName(name);
  entryVo.setDescription(description);
  return updateCatalogEntry(path,entryVo,newParentKey,httpRequest,uriInfo);
}
Program: 70063
Project: 70063
Buggy source:
/** 
 * Update the repository entry with the latest set properties in the feed resource. <p> Properties are: <ul> <li>Title <li>Author <li>Descripion (wiki style in repository) <li>Image </ul>
 * @param feed
 */
void enrichRepositoryEntryByFeedInformation(Feed feed){
  RepositoryEntry entry=getRepositoryEntry(feed);
  if (entry != null && feed != null) {
    Date whenTheFeedWasLastModified=feed.getLastModified();
    if (whenTheFeedWasLastModified != null && entry.getLastModified().before(whenTheFeedWasLastModified)) {
      entry.setDisplayname(feed.getTitle());
      entry.setDescription(feed.getDescription());
      VFSContainer repoHome=new LocalFolderImpl(new File(FolderConfig.getCanonicalRoot() + FolderConfig.getRepositoryHome()));
      String imageFilename=RepositoryEntryImageController.getImageFilename(entry);
      VFSItem oldEntryImage=repoHome.resolve(imageFilename);
      if (oldEntryImage != null) {
        oldEntryImage.delete();
      }
      String feedImage=feed.getImageName();
      if (feedImage != null) {
        VFSItem newImage=getFeedMediaContainer(feed).resolve(feedImage);
        if (newImage == null) {
          deleteImage(feed);
        }
 else {
          repoHome.copyFrom(newImage);
          VFSItem newEntryImage=repoHome.resolve(feed.getImageName());
          newEntryImage.rename(imageFilename);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Update the repository entry with the latest set properties in the feed resource. <p> Properties are: <ul> <li>Title <li>Author <li>Descripion (wiki style in repository) <li>Image </ul>
 * @param feed
 */
void enrichRepositoryEntryByFeedInformation(Feed feed){
  RepositoryEntry entry=getRepositoryEntry(feed);
  if (entry != null && feed != null) {
    Date whenTheFeedWasLastModified=feed.getLastModified();
    if (whenTheFeedWasLastModified != null && entry.getLastModified().before(whenTheFeedWasLastModified)) {
      String saveTitle=PersistenceHelper.truncateStringDbSave(feed.getTitle(),100,true);
      entry.setDisplayname(saveTitle);
      String saveDesc=PersistenceHelper.truncateStringDbSave(feed.getDescription(),16777210,true);
      entry.setDescription(saveDesc);
      VFSContainer repoHome=new LocalFolderImpl(new File(FolderConfig.getCanonicalRoot() + FolderConfig.getRepositoryHome()));
      String imageFilename=RepositoryEntryImageController.getImageFilename(entry);
      VFSItem oldEntryImage=repoHome.resolve(imageFilename);
      if (oldEntryImage != null) {
        oldEntryImage.delete();
      }
      String feedImage=feed.getImageName();
      if (feedImage != null) {
        VFSItem newImage=getFeedMediaContainer(feed).resolve(feedImage);
        if (newImage == null) {
          deleteImage(feed);
        }
 else {
          repoHome.copyFrom(newImage);
          VFSItem newEntryImage=repoHome.resolve(feed.getImageName());
          newEntryImage.rename(imageFilename);
        }
      }
    }
  }
}
Program: 70066
Project: 70066
Buggy source:
/** 
 * Adds a new task summary request
 * @param logger
 */
public void getTaskSummary(Logger logger){
  Semaphore sem=new Semaphore(0);
  TaskSummaryRequest request=new TaskSummaryRequest(LOGGER,sem);
  addRequest(request);
  try {
    sem.acquire();
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
  }
}

Fixed version (ground truth):
/** 
 * Adds a new task summary request
 * @param logger
 */
public void getTaskSummary(Logger logger){
  Semaphore sem=new Semaphore(0);
  TaskSummaryRequest request=new TaskSummaryRequest(logger,sem);
  addRequest(request);
  try {
    sem.acquire();
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
  }
}
Program: 70067
Project: 70067
Buggy source:
@Override public void process(TaskScheduler ts) throws ShutdownException {
  ts.getTaskSummary(logger);
  sem.release();
}

Fixed version (ground truth):
@Override public void process(TaskScheduler ts) throws ShutdownException {
  ts.getTaskSummary(this.logger);
  this.sem.release();
}
Program: 70070
Project: 70070
Buggy source:
private void sendFile(Connection c,String path,Data d){
  if (path.startsWith(File.separator)) {
    File f=new File(path);
    if (f.exists()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + c.hashCode()+ "String_Node_Str"+ path+ "String_Node_Str"+ d.getName());
      }
      c.sendDataFile(path);
    }
 else {
      ErrorManager.warn("String_Node_Str" + path + "String_Node_Str"+ c.hashCode()+ "String_Node_Str");
      handleDataToSendNotAvailable(c,d);
    }
  }
 else {
    sendObject(c,path,d);
  }
}

Fixed version (ground truth):
private void sendFile(Connection c,String path,Data d){
  if (path.startsWith(File.separator)) {
    File f=new File(path);
    if (f.exists()) {
      if (DEBUG) {
        LOGGER.debug(DBG_PREFIX + "String_Node_Str" + c.hashCode()+ "String_Node_Str"+ path+ "String_Node_Str"+ d.getName());
      }
      c.sendDataFile(path);
    }
 else {
      if (!f.getName().equals(d.getName())) {
        File renamed;
        if (isMaster()) {
          renamed=new File(Comm.getAppHost().getCompleteRemotePath(DataType.FILE_T,d.getName()).getPath());
        }
 else {
          renamed=new File(f.getParentFile().getAbsolutePath() + File.separator + d.getName());
        }
        if (renamed.exists()) {
          if (DEBUG) {
            LOGGER.debug(DBG_PREFIX + "String_Node_Str" + c.hashCode()+ "String_Node_Str"+ renamed.getAbsolutePath()+ "String_Node_Str"+ d.getName());
          }
          c.sendDataFile(renamed.getAbsolutePath());
        }
 else {
          ErrorManager.warn("String_Node_Str" + path + "String_Node_Str"+ renamed.getAbsolutePath()+ "String_Node_Str"+ c.hashCode()+ "String_Node_Str");
          handleDataToSendNotAvailable(c,d);
        }
      }
 else {
        ErrorManager.warn("String_Node_Str" + path + "String_Node_Str"+ c.hashCode()+ "String_Node_Str");
        handleDataToSendNotAvailable(c,d);
      }
    }
  }
 else {
    if (DEBUG) {
      LOGGER.debug(DBG_PREFIX + "String_Node_Str" + c.hashCode()+ "String_Node_Str"+ d.getName());
    }
    sendObject(c,path,d);
  }
}
Program: 70071
Project: 70071
Buggy source:
/** 
 * Marks a location for deletion
 * @param loc
 */
public void markForDeletion(DataLocation loc){
  if (!requestQueue.offer(new DeleteFileRequest(loc))) {
    ErrorManager.error(ERROR_QUEUE_OFFER + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Marks a location for deletion
 * @param loc
 */
public void markForDeletion(DataLocation loc){
  LOGGER.debug("String_Node_Str" + loc + "String_Node_Str");
  Semaphore sem=new Semaphore(0);
  if (!requestQueue.offer(new DeleteFileRequest(loc,sem))) {
    ErrorManager.error(ERROR_QUEUE_OFFER + "String_Node_Str");
  }
  sem.acquireUninterruptibly();
  LOGGER.debug("String_Node_Str" + loc + "String_Node_Str");
}
Program: 70072
Project: 70072
Buggy source:
public FileInputStream newFileInputStream(FileDescriptor fd){
  StreamList list=obtainList(fd);
  FileInputStream fis=new FileInputStream(fd);
  if (list != null)   list.addStream(fis);
  return fis;
}

Fixed version (ground truth):
public FileInputStream newFileInputStream(FileDescriptor fd){
  StreamList list=obtainList(fd);
  FileInputStream fis=new FileInputStream(fd);
  if (list != null) {
    list.addStream(fis);
  }
  return fis;
}
Program: 70073
Project: 70073
Buggy source:
public boolean isTaskFile(String fileName){
  File f=new File(fileName);
  if (taskFiles.contains(f.getAbsolutePath())) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean isTaskFile(String fileName){
  if (fileName == null) {
    File f=new File(fileName);
    if (taskFiles.contains(f.getAbsolutePath())) {
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 70074
Project: 70074
Buggy source:
/** 
 * Executes a given command @cmd with the stream redirections @streamValues
 * @param cmd
 * @param streamValues
 * @return
 * @throws InvokeExecutionException
 */
public static Object executeCMD(String[] cmd,StreamSTD streamValues,File taskSandboxWorkingDir) throws InvokeExecutionException {
  ProcessBuilder builder=new ProcessBuilder(cmd);
  builder.directory(taskSandboxWorkingDir);
  builder.environment().remove(Tracer.LD_PRELOAD);
  String fileInPath=streamValues.getStdIn();
  if (fileInPath != null) {
    builder.redirectInput(new File(fileInPath));
  }
  String fileOutPath=streamValues.getStdOut();
  if (fileOutPath != null) {
    builder.redirectOutput(Redirect.appendTo(new File(fileOutPath)));
  }
  String fileErrPath=streamValues.getStdErr();
  if (fileErrPath != null) {
    builder.redirectError(Redirect.appendTo(new File(fileErrPath)));
  }
  Process process=null;
  int exitValue=-1;
  try {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    process=builder.start();
    process.getOutputStream().close();
    logBinaryExecution(process,exitValue,fileOutPath,fileErrPath);
    exitValue=process.waitFor();
  }
 catch (  Exception e) {
    throw new InvokeExecutionException(ERROR_PROC_EXEC,e);
  }
  return exitValue;
}

Fixed version (ground truth):
/** 
 * Executes a given command @cmd with the stream redirections @streamValues
 * @param cmd
 * @param streamValues
 * @return
 * @throws InvokeExecutionException
 */
public static Object executeCMD(String[] cmd,StreamSTD streamValues,File taskSandboxWorkingDir,PrintStream defaultOutStream,PrintStream defaultErrStream) throws InvokeExecutionException {
  ProcessBuilder builder=new ProcessBuilder(cmd);
  builder.directory(taskSandboxWorkingDir);
  builder.environment().remove(Tracer.LD_PRELOAD);
  String fileInPath=streamValues.getStdIn();
  if (fileInPath != null) {
    builder.redirectInput(new File(fileInPath));
  }
  String fileOutPath=streamValues.getStdOut();
  if (fileOutPath != null) {
    builder.redirectOutput(Redirect.appendTo(new File(fileOutPath)));
  }
  String fileErrPath=streamValues.getStdErr();
  if (fileErrPath != null) {
    builder.redirectError(Redirect.appendTo(new File(fileErrPath)));
  }
  Process process=null;
  int exitValue=-1;
  try {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    process=builder.start();
    process.getOutputStream().close();
    logBinaryExecution(process,fileOutPath,fileErrPath,defaultOutStream,defaultErrStream);
    exitValue=process.waitFor();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + exitValue);
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    System.err.println(ERROR_PROC_EXEC);
    e.printStackTrace();
    throw new InvokeExecutionException(ERROR_PROC_EXEC,e);
  }
  return exitValue;
}
Program: 70075
Project: 70075
Buggy source:
private static void logBinaryExecution(Process process,int exitValue,String fileOutPath,String fileErrPath) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + exitValue);
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  if (process != null) {
    StreamGobbler outputGobbler=new StreamGobbler(process.getInputStream(),System.out,LogManager.getLogger(Loggers.WORKER));
    outputGobbler.start();
  }
  System.out.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  if (process != null) {
    StreamGobbler errorGobbler=new StreamGobbler(process.getErrorStream(),System.err,LogManager.getLogger(Loggers.WORKER));
    errorGobbler.start();
  }
  System.err.println("String_Node_Str");
}

Fixed version (ground truth):
private static void logBinaryExecution(Process process,String fileOutPath,String fileErrPath,PrintStream defaultOutStream,PrintStream defaultErrStream) throws InvokeExecutionException {
  StreamGobbler errorGobbler=null;
  StreamGobbler outputGobbler=null;
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  if (process != null) {
    if (fileOutPath == null) {
      outputGobbler=new StreamGobbler(process.getInputStream(),defaultOutStream,LogManager.getLogger(Loggers.WORKER));
      outputGobbler.start();
    }
 else {
      try (FileInputStream outputStream=new FileInputStream(fileOutPath)){
        outputGobbler=new StreamGobbler(outputStream,defaultOutStream,LogManager.getLogger(Loggers.WORKER));
        outputGobbler.start();
      }
 catch (      IOException ioe) {
        System.err.println(ERROR_OUTPUTREADER);
        ioe.printStackTrace();
        throw new InvokeExecutionException(ERROR_OUTPUTREADER,ioe);
      }
    }
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  if (process != null) {
    if (fileErrPath == null) {
      errorGobbler=new StreamGobbler(process.getErrorStream(),defaultErrStream,LogManager.getLogger(Loggers.WORKER));
      errorGobbler.start();
    }
 else {
      try (FileInputStream errStream=new FileInputStream(fileErrPath)){
        errorGobbler=new StreamGobbler(errStream,defaultErrStream,LogManager.getLogger(Loggers.WORKER));
        errorGobbler.start();
      }
 catch (      IOException ioe) {
        throw new InvokeExecutionException(ERROR_OUTPUTREADER,ioe);
      }
    }
  }
  if (outputGobbler != null) {
    try {
      outputGobbler.join();
    }
 catch (    InterruptedException e) {
      System.err.println("String_Node_Str");
      e.printStackTrace();
    }
  }
  System.out.println("String_Node_Str");
  if (errorGobbler != null) {
    try {
      errorGobbler.join();
    }
 catch (    InterruptedException e) {
      System.err.println("String_Node_Str");
      e.printStackTrace();
    }
  }
  System.err.println("String_Node_Str");
}
Program: 70079
Project: 70079
Buggy source:
/** 
 * Invokes a binary method
 * @param binary
 * @param values
 * @param streams
 * @param prefixes
 * @param taskSandboxWorkingDir
 * @return
 * @throws InvokeExecutionException
 */
public static Object invokeBinaryMethod(String binary,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + binary);
  System.out.println("String_Node_Str" + taskSandboxWorkingDir.getAbsolutePath());
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_BINARY_ARGS + binaryParams.size()];
  cmd[0]=binary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_BINARY_ARGS + i]=binaryParams.get(i);
  }
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,streamValues,taskSandboxWorkingDir);
}

Fixed version (ground truth):
/** 
 * Invokes a binary method
 * @param binary
 * @param values
 * @param streams
 * @param prefixes
 * @param taskSandboxWorkingDir
 * @return
 * @throws InvokeExecutionException
 */
public static Object invokeBinaryMethod(String binary,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir,PrintStream defaultOutStream,PrintStream defaultErrStream) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + binary);
  System.out.println("String_Node_Str" + taskSandboxWorkingDir.getAbsolutePath());
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_BINARY_ARGS + binaryParams.size()];
  cmd[0]=binary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_BINARY_ARGS + i]=binaryParams.get(i);
  }
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,streamValues,taskSandboxWorkingDir,defaultOutStream,defaultErrStream);
}
Program: 70080
Project: 70080
Buggy source:
public static Object invokeMPIMethod(String mpiRunner,String mpiBinary,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeMPIMethod(mpiRunner,mpiBinary,values,streams,prefixes,taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}

Fixed version (ground truth):
public static Object invokeMPIMethod(String mpiRunner,String mpiBinary,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeMPIMethod(mpiRunner,mpiBinary,values,streams,prefixes,taskSandboxWorkingDir,System.out,System.err);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}
Program: 70081
Project: 70081
Buggy source:
public static Object invokeDecafMethod(String dfRunner,String dfScript,String dfExecutor,String dfLib,String mpiRunner,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeDecafMethod(dfRunner,dfScript,dfExecutor,dfLib,mpiRunner,values,streams,prefixes,taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}

Fixed version (ground truth):
public static Object invokeDecafMethod(String dfRunner,String dfScript,String dfExecutor,String dfLib,String mpiRunner,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeDecafMethod(dfRunner,dfScript,dfExecutor,dfLib,mpiRunner,values,streams,prefixes,taskSandboxWorkingDir,System.out,System.err);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}
Program: 70082
Project: 70082
Buggy source:
public static Object invokeOmpSsMethod(String ompssBinary,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeOmpSsMethod(ompssBinary,values,streams,prefixes,taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}

Fixed version (ground truth):
public static Object invokeOmpSsMethod(String ompssBinary,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeOmpSsMethod(ompssBinary,values,streams,prefixes,taskSandboxWorkingDir,System.out,System.err);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}
Program: 70083
Project: 70083
Buggy source:
public static Object invokeBinaryMethod(String binary,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeBinaryMethod(binary,values,streams,prefixes,taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}

Fixed version (ground truth):
public static Object invokeBinaryMethod(String binary,Object target,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir){
  Object retValue=null;
  try {
    retValue=GenericInvoker.invokeBinaryMethod(binary,values,streams,prefixes,taskSandboxWorkingDir,System.out,System.err);
  }
 catch (  InvokeExecutionException iee) {
    ErrorManager.error(ERROR_INVOKE,iee);
  }
  return retValue;
}
Program: 70084
Project: 70084
Buggy source:
@Override public Object invokeMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + this.binary + "String_Node_Str"+ this.nw.getHostName());
  try {
    return GenericInvoker.invokeBinaryMethod(this.binary,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}

Fixed version (ground truth):
@Override public Object invokeMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + this.binary + "String_Node_Str"+ this.nw.getHostName());
  try {
    return GenericInvoker.invokeBinaryMethod(this.binary,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir,nw.getThreadOutStream(),nw.getThreadErrStream());
  }
 catch (  InvokeExecutionException iee) {
    LOGGER.error("String_Node_Str",iee);
    throw new JobExecutionException(iee);
  }
}
Program: 70085
Project: 70085
Buggy source:
private Object invokeDecafMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + this.dfScript + "String_Node_Str"+ this.nw.getHostName());
  try {
    return GenericInvoker.invokeDecafMethod(nw.getInstallDir() + DecafImplementation.SCRIPT_PATH,this.dfScript,this.dfExecutor,this.dfLib,this.mpiRunner,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}

Fixed version (ground truth):
private Object invokeDecafMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + this.dfScript + "String_Node_Str"+ this.nw.getHostName());
  try {
    return GenericInvoker.invokeDecafMethod(nw.getInstallDir() + DecafImplementation.SCRIPT_PATH,this.dfScript,this.dfExecutor,this.dfLib,this.mpiRunner,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir,nw.getThreadOutStream(),nw.getThreadErrStream());
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}
Program: 70086
Project: 70086
Buggy source:
private Object invokeMPIMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + this.mpiBinary + "String_Node_Str"+ this.nw.getHostName());
  try {
    return GenericInvoker.invokeMPIMethod(this.mpiRunner,this.mpiBinary,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}

Fixed version (ground truth):
private Object invokeMPIMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + this.mpiBinary + "String_Node_Str"+ this.nw.getHostName());
  try {
    return GenericInvoker.invokeMPIMethod(this.mpiRunner,this.mpiBinary,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir,nw.getThreadOutStream(),nw.getThreadErrStream());
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}
Program: 70087
Project: 70087
Buggy source:
@Override public Object invokeMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + ompssBinary + "String_Node_Str"+ nw.getHostName());
  try {
    return GenericInvoker.invokeOmpSsMethod(this.ompssBinary,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir);
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}

Fixed version (ground truth):
@Override public Object invokeMethod() throws JobExecutionException {
  LOGGER.info("String_Node_Str" + ompssBinary + "String_Node_Str"+ nw.getHostName());
  try {
    return GenericInvoker.invokeOmpSsMethod(this.ompssBinary,this.values,this.streams,this.prefixes,this.taskSandboxWorkingDir,nw.getThreadOutStream(),nw.getThreadErrStream());
  }
 catch (  InvokeExecutionException iee) {
    throw new JobExecutionException(iee);
  }
}
Program: 70088
Project: 70088
Buggy source:
public void unregisterThread(){
  try {
    close();
    threadToStream.remove(Thread.currentThread().getId());
  }
 catch (  Exception e) {
    e.printStackTrace(System.err);
  }
}

Fixed version (ground truth):
public void unregisterThread(){
  try {
    flush();
    close();
    threadToStream.remove(Thread.currentThread().getId());
  }
 catch (  Exception e) {
    e.printStackTrace(System.err);
  }
}
Program: 70089
Project: 70089
Buggy source:
@Override public void run(){
  try {
    final byte[] buffer=new byte[BUFFER_SIZE];
    int nRead;
    while ((nRead=in.read(buffer,0,buffer.length)) != -1) {
      byte[] readData=new byte[nRead];
      System.arraycopy(buffer,0,readData,0,nRead);
      out.print(new String(readData));
    }
  }
 catch (  IOException ioe) {
    logger.error("String_Node_Str",ioe);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException ioe) {
        logger.warn("String_Node_Str",ioe);
      }
    }
    if (out != null) {
      out.flush();
      out.close();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  logger.debug("String_Node_Str");
  try {
    final byte[] buffer=new byte[BUFFER_SIZE];
    int nRead;
    while ((nRead=in.read(buffer,0,buffer.length)) != -1) {
      byte[] readData=new byte[nRead];
      System.arraycopy(buffer,0,readData,0,nRead);
      out.print(new String(readData));
      out.flush();
    }
  }
 catch (  IOException ioe) {
    logger.error("String_Node_Str",ioe);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException ioe) {
        logger.warn("String_Node_Str",ioe);
      }
    }
    if (out != null) {
      out.flush();
    }
  }
}
Program: 70090
Project: 70090
Buggy source:
/** 
 * Tries to schedule the current action
 * @throws InvalidSchedulingException
 */
public final void tryToLaunch() throws InvalidSchedulingException {
  lock.lock();
  if (selectedResource != null && state == State.RUNNABLE && !hasDataPredecessors() && schedulingInfo.isExecutable()) {
    if (selectedResource.isRemoved() || (isSchedulingConstrained() && unrequiredResource() || isTargetResourceEnforced() && selectedResource != schedulingInfo.getEnforcedTargetResource())) {
      lock.unlock();
      throw new InvalidSchedulingException();
    }
    execute();
  }
 else {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Tries to schedule the current action
 * @throws InvalidSchedulingException
 */
public final void tryToLaunch() throws InvalidSchedulingException {
  lock.lock();
  if (selectedResource != null && state == State.RUNNABLE && !hasDataPredecessors() && schedulingInfo.isExecutable()) {
    if ((selectedResource.isRemoved() && !isToStopResource()) || (isSchedulingConstrained() && unrequiredResource() || isTargetResourceEnforced() && selectedResource != schedulingInfo.getEnforcedTargetResource())) {
      lock.unlock();
      throw new InvalidSchedulingException();
    }
    execute();
  }
 else {
    lock.unlock();
  }
}
Program: 70091
Project: 70091
Buggy source:
public boolean isTaskFile(String fileName){
  if (fileName == null) {
    File f=new File(fileName);
    if (taskFiles.contains(f.getAbsolutePath())) {
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean isTaskFile(String fileName){
  if (fileName != null) {
    File f=new File(fileName);
    if (taskFiles.contains(f.getAbsolutePath())) {
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 70092
Project: 70092
Buggy source:
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
  for (  Resource r : loc.getHosts()) {
switch (loc.getType()) {
case PRIVATE:
      r.addLogicalData(this);
    break;
case SHARED:
  SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
}

Fixed version (ground truth):
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
switch (loc.getType()) {
case PRIVATE:
    for (    Resource r : loc.getHosts()) {
      r.addLogicalData(this);
    }
  break;
case SHARED:
SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
Program: 70093
Project: 70093
Buggy source:
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null)   return;
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  for (  DataLocation loc : ld.getLocations()) {
    if (loc.getProtocol().equals(Protocol.PERSISTENT_URI)) {
      orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
      return;
    }
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName());
  }
  orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
}

Fixed version (ground truth):
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null) {
    return;
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  if (ld.getId() != null) {
    orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
  }
 else {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str" + ld.getName());
    }
    orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
  }
}
Program: 70094
Project: 70094
Buggy source:
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,Comm.getAppHost().getName());
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}

Fixed version (ground truth):
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,targetHostname);
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}
Program: 70095
Project: 70095
Buggy source:
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
  for (  Resource r : loc.getHosts()) {
switch (loc.getType()) {
case PRIVATE:
      r.addLogicalData(this);
    break;
case SHARED:
  SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
}

Fixed version (ground truth):
/** 
 * Adds a new location
 * @param loc
 */
public synchronized void addLocation(DataLocation loc){
  this.isBeingSaved=false;
  this.locations.add(loc);
switch (loc.getType()) {
case PRIVATE:
    for (    Resource r : loc.getHosts()) {
      r.addLogicalData(this);
    }
  break;
case SHARED:
SharedDiskManager.addLogicalData(loc.getSharedDisk(),this);
break;
case PERSISTENT:
this.id=((PersistentLocation)loc).getId();
break;
}
}
Program: 70096
Project: 70096
Buggy source:
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null)   return;
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  for (  DataLocation loc : ld.getLocations()) {
    if (loc.getProtocol().equals(Protocol.PERSISTENT_URI)) {
      orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
      return;
    }
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName());
  }
  orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
}

Fixed version (ground truth):
@Override public void obtainData(LogicalData ld,DataLocation source,DataLocation target,LogicalData tgtData,Transferable reason,EventListener listener){
  if (ld == null) {
    return;
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + ld.getName() + "String_Node_Str"+ target);
  }
  if (ld.getId() != null) {
    orderStorageCopy(new StorageCopy(ld,source,target,tgtData,reason,listener));
  }
 else {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str" + ld.getName());
    }
    orderCopy(new DeferredCopy(ld,source,target,tgtData,reason,listener));
  }
}
Program: 70097
Project: 70097
Buggy source:
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,Comm.getAppHost().getName());
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}

Fixed version (ground truth):
private void newVersion(StorageCopy sc){
  String targetHostname=this.getName();
  LogicalData srcLD=sc.getSourceData();
  LogicalData targetLD=sc.getTargetData();
  boolean preserveSource=sc.mustPreserveSourceData();
  if (DEBUG) {
    LOGGER.debug("String_Node_Str" + srcLD.getName() + "String_Node_Str"+ srcLD.getId()+ "String_Node_Str"+ targetHostname+ "String_Node_Str"+ preserveSource);
  }
  String pscoId=srcLD.getId();
  LOGGER.debug("String_Node_Str" + pscoId);
  if (NIOTracer.isActivated()) {
    NIOTracer.emitEvent(NIOTracer.Event.STORAGE_NEWVERSION.getId(),NIOTracer.Event.STORAGE_NEWVERSION.getType());
  }
  try {
    String newId=StorageItf.newVersion(pscoId,preserveSource,targetHostname);
    LOGGER.debug("String_Node_Str" + pscoId + "String_Node_Str"+ newId);
    sc.setFinalTarget(newId);
    if (targetLD != null) {
      targetLD.setId(newId);
    }
  }
 catch (  Exception e) {
    sc.end(OpEndState.OP_FAILED,e);
    return;
  }
 finally {
    if (NIOTracer.isActivated()) {
      NIOTracer.emitEvent(NIOTracer.EVENT_END,NIOTracer.Event.STORAGE_NEWVERSION.getType());
    }
  }
  sc.end(OpEndState.OP_OK);
}
Program: 70098
Project: 70098
Buggy source:
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(this.taskId);
  out.writeObject(this.paramTypes);
  out.writeObject(this.paramValues);
}

Fixed version (ground truth):
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(this.jobId);
  out.writeObject(this.paramTypes);
  out.writeObject(this.paramValues);
}
Program: 70099
Project: 70099
Buggy source:
/** 
 * New task result from a given set of   {@code params}
 * @param taskId
 * @param params
 */
public NIOTaskResult(int taskId,LinkedList<NIOParam> params){
  this.taskId=taskId;
  for (  NIOParam np : params) {
    this.paramTypes.add(np.getType());
switch (np.getType()) {
case PSCO_T:
case EXTERNAL_OBJECT_T:
      this.paramValues.add(np.getValue());
    break;
default :
  this.paramValues.add(null);
break;
}
}
}

Fixed version (ground truth):
/** 
 * New task result from a given set of   {@code params}
 * @param jobId
 * @param params
 */
public NIOTaskResult(int jobId,LinkedList<NIOParam> params){
  this.jobId=jobId;
  for (  NIOParam np : params) {
    this.paramTypes.add(np.getType());
switch (np.getType()) {
case PSCO_T:
case EXTERNAL_OBJECT_T:
      this.paramValues.add(np.getValue());
    break;
default :
  this.paramValues.add(null);
break;
}
}
}
Program: 70100
Project: 70100
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this.taskId=in.readInt();
  this.paramTypes=(LinkedList<DataType>)in.readObject();
  this.paramValues=(LinkedList<Object>)in.readObject();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this.jobId=in.readInt();
  this.paramTypes=(LinkedList<DataType>)in.readObject();
  this.paramValues=(LinkedList<Object>)in.readObject();
}