nus-yam/ex-repair huggingface dataset:
Program: 70398
Project: 70398
Buggy source:
public static synchronized Configuration constructConfiguration(String adaptorName,Object project_properties,Object resources_properties) throws Exception {
  CommAdaptor adaptor=adaptors.get(adaptorName);
  if (adaptor == null) {
    Constructor<?> constrAdaptor=Class.forName(adaptorName).getConstructor();
    adaptor=(CommAdaptor)constrAdaptor.newInstance();
    adaptor.init();
    adaptors.put(adaptorName,adaptor);
  }
  if (debug) {
    logger.debug("String_Node_Str" + adaptorName);
  }
  return adaptor.constructConfiguration(project_properties,resources_properties);
}

Fixed version (ground truth):
/** 
 * Initializes the internal adaptor and constructs a comm configuration
 * @param adaptorName
 * @param project_properties
 * @param resources_properties
 * @return
 * @throws ConstructConfigurationException
 */
public static synchronized Configuration constructConfiguration(String adaptorName,Object project_properties,Object resources_properties) throws ConstructConfigurationException {
  CommAdaptor adaptor=adaptors.get(adaptorName);
  if (adaptor == null) {
    try {
      Constructor<?> constrAdaptor=Class.forName(adaptorName).getConstructor();
      adaptor=(CommAdaptor)constrAdaptor.newInstance();
    }
 catch (    NoSuchMethodException|SecurityException|ClassNotFoundException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
      throw new ConstructConfigurationException(e);
    }
    adaptor.init();
    adaptors.put(adaptorName,adaptor);
  }
  if (debug) {
    logger.debug("String_Node_Str" + adaptorName);
  }
  return adaptor.constructConfiguration(project_properties,resources_properties);
}
Program: 70399
Project: 70399
Buggy source:
public static synchronized LogicalData registerValue(String dataId,Object value){
  logger.debug("String_Node_Str" + value + "String_Node_Str"+ dataId);
  String targetPath=Protocol.OBJECT_URI.getSchema() + dataId;
  DataLocation location=null;
  try {
    SimpleURI uri=new SimpleURI(targetPath);
    location=DataLocation.createLocation(appHost,uri);
  }
 catch (  Exception e) {
    ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + targetPath,e);
  }
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  logicalData.setValue(value);
  if (value instanceof StubItf) {
    String id=((StubItf)value).getID();
    if (id != null) {
      Comm.registerPSCO(dataId,id);
    }
  }
  return logicalData;
}

Fixed version (ground truth):
/** 
 * Registers a new value @value for the data with id @dataId dataId must exist
 * @param dataId
 * @param value
 * @return
 */
public static synchronized LogicalData registerValue(String dataId,Object value){
  logger.debug("String_Node_Str" + value + "String_Node_Str"+ dataId);
  String targetPath=Protocol.OBJECT_URI.getSchema() + dataId;
  DataLocation location=null;
  try {
    SimpleURI uri=new SimpleURI(targetPath);
    location=DataLocation.createLocation(appHost,uri);
  }
 catch (  Exception e) {
    ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + targetPath,e);
  }
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  logicalData.setValue(value);
  if (value instanceof StubItf) {
    String id=((StubItf)value).getID();
    if (id != null) {
      Comm.registerPSCO(dataId,id);
    }
  }
  return logicalData;
}
Program: 70400
Project: 70400
Buggy source:
public static synchronized Object clearValue(String dataId){
  logger.debug("String_Node_Str" + dataId);
  LogicalData logicalData=data.get(dataId);
  return logicalData.removeValue();
}

Fixed version (ground truth):
/** 
 * Clears the value of the data id @dataId
 * @param dataId
 * @return
 */
public static synchronized Object clearValue(String dataId){
  logger.debug("String_Node_Str" + dataId);
  LogicalData logicalData=data.get(dataId);
  return logicalData.removeValue();
}
Program: 70401
Project: 70401
Buggy source:
public static synchronized COMPSsWorker initWorker(String name,Configuration config){
  String adaptorName=config.getAdaptorName();
  CommAdaptor adaptor=adaptors.get(adaptorName);
  return adaptor.initWorker(name,config);
}

Fixed version (ground truth):
/** 
 * Initializes a worker with name @name and configuration @config
 * @param name
 * @param config
 * @return
 */
public static synchronized COMPSsWorker initWorker(String name,Configuration config){
  String adaptorName=config.getAdaptorName();
  CommAdaptor adaptor=adaptors.get(adaptorName);
  return adaptor.initWorker(name,config);
}
Program: 70402
Project: 70402
Buggy source:
public static synchronized LogicalData registerLocation(String dataId,DataLocation location){
  logger.debug("String_Node_Str" + dataId + "String_Node_Str");
  logger.debug("String_Node_Str" + location);
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  return logicalData;
}

Fixed version (ground truth):
/** 
 * Registers a new location @location for the data with id @dataId dataId must exist
 * @param dataId
 * @param location
 * @return
 */
public static synchronized LogicalData registerLocation(String dataId,DataLocation location){
  logger.debug("String_Node_Str" + dataId + "String_Node_Str");
  logger.debug("String_Node_Str" + location);
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  return logicalData;
}
Program: 70403
Project: 70403
Buggy source:
public static synchronized HashSet<LogicalData> getAllData(Resource host){
  return host.getAllDataFromHost();
}

Fixed version (ground truth):
/** 
 * Returns all the data stored in a host @host
 * @param host
 * @return
 */
public static synchronized HashSet<LogicalData> getAllData(Resource host){
  return host.getAllDataFromHost();
}
Program: 70404
Project: 70404
Buggy source:
public static synchronized void stop(){
  appHost.deleteIntermediate();
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stop();
  }
  if (STORAGE_CONF != null && !STORAGE_CONF.equals("String_Node_Str") && !STORAGE_CONF.equals("String_Node_Str")) {
    try {
      logger.debug("String_Node_Str");
      StorageItf.finish();
    }
 catch (    StorageException e) {
      logger.error("String_Node_Str" + e.getMessage());
    }
  }
  if (Tracer.isActivated()) {
    Tracer.emitEvent(Tracer.EVENT_END,Tracer.getRuntimeEventsType());
    Tracer.fini();
  }
}

Fixed version (ground truth):
/** 
 * Stops the communication layer.  Clean FTM, Job, {GATJob, NIOJob} and WSJob
 */
public static synchronized void stop(){
  appHost.deleteIntermediate();
  for (  CommAdaptor adaptor : adaptors.values()) {
    adaptor.stop();
  }
  if (STORAGE_CONF != null && !STORAGE_CONF.equals("String_Node_Str") && !STORAGE_CONF.equals("String_Node_Str")) {
    try {
      logger.debug("String_Node_Str");
      StorageItf.finish();
    }
 catch (    StorageException e) {
      logger.error("String_Node_Str" + e.getMessage());
    }
  }
  if (Tracer.isActivated()) {
    Tracer.emitEvent(Tracer.EVENT_END,Tracer.getRuntimeEventsType());
    Tracer.fini();
  }
}
Program: 70405
Project: 70405
Buggy source:
public static synchronized boolean existsData(String renaming){
  return (data.get(renaming) != null);
}

Fixed version (ground truth):
/** 
 * Checks if a given dataId @renaming exists
 * @param renaming
 * @return
 */
public static synchronized boolean existsData(String renaming){
  return (data.get(renaming) != null);
}
Program: 70406
Project: 70406
Buggy source:
public static synchronized void removeData(String renaming){
  logger.debug("String_Node_Str" + renaming);
  LogicalData ld=data.remove(renaming);
  ld.isObsolete();
  for (  DataLocation dl : ld.getLocations()) {
    MultiURI uri=dl.getURIInHost(appHost);
    if (uri != null) {
      File f=new File(uri.getPath());
      if (f.exists()) {
        logger.info("String_Node_Str" + f.getAbsolutePath());
        if (!f.delete()) {
          logger.error("String_Node_Str" + f.getAbsolutePath());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes the data with id @renaming
 * @param renaming
 */
public static synchronized void removeData(String renaming){
  logger.debug("String_Node_Str" + renaming);
  LogicalData ld=data.remove(renaming);
  ld.isObsolete();
  for (  DataLocation dl : ld.getLocations()) {
    MultiURI uri=dl.getURIInHost(appHost);
    if (uri != null) {
      File f=new File(uri.getPath());
      if (f.exists()) {
        logger.info("String_Node_Str" + f.getAbsolutePath());
        if (!f.delete()) {
          logger.error("String_Node_Str" + f.getAbsolutePath());
        }
      }
    }
  }
}
Program: 70407
Project: 70407
Buggy source:
public static synchronized LogicalData getData(String dataId){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + data.get(dataId));
  }
  return data.get(dataId);
}

Fixed version (ground truth):
/** 
 * Returns the data with id @dataId
 * @param dataId
 * @return
 */
public static synchronized LogicalData getData(String dataId){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + data.get(dataId));
  }
  return data.get(dataId);
}
Program: 70408
Project: 70408
Buggy source:
/** 
 * Creates a configuration instance for the specific adaptor
 * @param project_properties
 * @param resources_properties
 * @return
 * @throws Exception
 */
public Configuration constructConfiguration(Object project_properties,Object resources_properties) throws Exception ;

Fixed version (ground truth):
/** 
 * Creates a configuration instance for the specific adaptor
 * @param project_properties
 * @param resources_properties
 * @return
 * @throws Exception
 */
public Configuration constructConfiguration(Object project_properties,Object resources_properties) throws ConstructConfigurationException ;
Program: 70409
Project: 70409
Buggy source:
public void setWorkingDir(String workingDir){
  if (workingDir == null) {
    this.workingDir=File.separator + "String_Node_Str" + File.separator;
  }
 else   if (workingDir.isEmpty()) {
    this.workingDir=File.separator + "String_Node_Str" + File.separator;
  }
 else   if (!workingDir.endsWith(File.separator)) {
    this.workingDir=workingDir + File.separator;
  }
 else {
    this.workingDir=workingDir;
  }
}

Fixed version (ground truth):
public void setWorkingDir(String workingDir){
  if (workingDir == null) {
    this.workingDir=File.separator + "String_Node_Str" + File.separator;
  }
 else   if (workingDir.isEmpty()) {
    this.workingDir=File.separator + "String_Node_Str" + File.separator;
  }
 else   if (!workingDir.endsWith(File.separator)) {
    this.workingDir=workingDir + File.separator;
  }
 else {
    this.workingDir=workingDir;
  }
  String host=this.getHost().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  String sandboxWorkingDir=this.getWorkingDir() + DEPLOYMENT_ID + File.separator+ host+ File.separator;
  this.setSandboxWorkingDir(sandboxWorkingDir);
}
Program: 70411
Project: 70411
Buggy source:
public static boolean generatePackage(GATWorkerNode node){
  LinkedList<URI> traceScripts=new LinkedList<URI>();
  LinkedList<String> traceParams=new LinkedList<String>();
  String host=node.getHost();
  String installDir=node.getInstallDir();
  String workingDir=node.getWorkingDir();
  String user=node.getUser();
  if (user == null) {
    user="String_Node_Str";
  }
 else {
    user+="String_Node_Str";
  }
  try {
    traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host+ File.separator+ installDir+ TRACE_SCRIPT_PATH));
  }
 catch (  URISyntaxException e) {
    logger.error("String_Node_Str",e);
    return false;
  }
  String pars="String_Node_Str" + workingDir + "String_Node_Str"+ host;
  traceParams.add(pars);
  return new CleanerExecutor(node).executeScript(traceScripts,traceParams);
}

Fixed version (ground truth):
public static boolean generatePackage(GATWorkerNode node){
  LinkedList<URI> traceScripts=new LinkedList<URI>();
  LinkedList<String> traceParams=new LinkedList<String>();
  String host=node.getHost();
  String installDir=node.getInstallDir();
  String workingDir=node.getWorkingDir();
  String user=node.getUser();
  if (user == null) {
    user="String_Node_Str";
  }
 else {
    user+="String_Node_Str";
  }
  try {
    traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host+ File.separator+ installDir+ TRACE_SCRIPT_PATH));
  }
 catch (  URISyntaxException e) {
    logger.error("String_Node_Str",e);
    return false;
  }
  String pars="String_Node_Str" + workingDir + "String_Node_Str"+ host;
  traceParams.add(pars);
  return new GATScriptExecutor(node).executeScript(traceScripts,traceParams,"String_Node_Str" + host);
}
Program: 70412
Project: 70412
Buggy source:
@Override public void deleteTemporary(){
}

Fixed version (ground truth):
@Override public void deleteTemporary(){
  LinkedList<URI> traceScripts=new LinkedList<URI>();
  LinkedList<String> traceParams=new LinkedList<String>();
  String host=getHost();
  String installDir=getInstallDir();
  String workingDir=getWorkingDir();
  String user=getUser();
  if (user == null) {
    user="String_Node_Str";
  }
 else {
    user+="String_Node_Str";
  }
  try {
    traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host+ File.separator+ installDir+ GAT_SCRIPT_PATH+ CLEANER_SCRIPT_NAME));
  }
 catch (  URISyntaxException e) {
    logger.error("String_Node_Str" + workingDir + "String_Node_Str"+ getName(),e);
    return;
  }
  String pars=workingDir;
  traceParams.add(pars);
  logger.debug("String_Node_Str" + workingDir + "String_Node_Str"+ getName());
  boolean result=new GATScriptExecutor(this).executeScript(traceScripts,traceParams,"String_Node_Str" + host);
  if (!result) {
    logger.error("String_Node_Str" + workingDir + "String_Node_Str"+ getName());
  }
}
Program: 70413
Project: 70413
Buggy source:
@Override public void updateTaskCount(int processorCoreCount){
  if (GATTracer.isActivated()) {
    System.err.println("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void updateTaskCount(int processorCoreCount){
  if (GATTracer.isActivated()) {
    logger.error("String_Node_Str");
  }
}
Program: 70414
Project: 70414
Buggy source:
@Override public void start() throws Exception {
  if (GATTracer.isActivated()) {
    logger.debug("String_Node_Str" + this.getName());
    tracingJob=GATTracer.startTracing(this);
    waitForTracingReady();
  }
}

Fixed version (ground truth):
@Override public void start() throws Exception {
  initWorkingDir();
  if (GATTracer.isActivated()) {
    logger.debug("String_Node_Str" + this.getName());
    tracingJob=GATTracer.startTracing(this);
    waitForTracingReady();
  }
}
Program: 70415
Project: 70415
Buggy source:
public String getWorkingDir(){
  return this.config.getWorkingDir();
}

Fixed version (ground truth):
public String getWorkingDir(){
  return this.config.getSandboxWorkingDir();
}
Program: 70416
Project: 70416
Buggy source:
@Override public void stop(ShutdownListener sl){
  try {
    File workingDirRoot=new File(this.config.getWorkingDir());
    for (    File c : workingDirRoot.listFiles()) {
      delete(c);
    }
  }
 catch (  FileNotFoundException e) {
    logger.warn("String_Node_Str" + e);
  }
  sl.notifyEnd();
}

Fixed version (ground truth):
@Override public void stop(ShutdownListener sl){
  try {
    String workingDir=this.config.getWorkingDir();
    if (workingDir != null || !workingDir.isEmpty()) {
      File workingDirRoot=new File(workingDir);
      if (workingDirRoot != null) {
        File[] filesInFolder=workingDirRoot.listFiles();
        if (filesInFolder != null) {
          for (          File c : filesInFolder) {
            delete(c);
          }
        }
      }
    }
  }
 catch (  FileNotFoundException e) {
    logger.warn("String_Node_Str" + e);
  }
  sl.notifyEnd();
}
Program: 70418
Project: 70418
Buggy source:
public void generateWorkersDebugInfo(){
}

Fixed version (ground truth):
public boolean generateWorkersDebugInfo(){
  return false;
}
Program: 70419
Project: 70419
Buggy source:
public void generatePackage(){
}

Fixed version (ground truth):
public boolean generatePackage(){
  return false;
}
Program: 70420
Project: 70420
Buggy source:
public abstract void generateWorkersDebugInfo();

Fixed version (ground truth):
public abstract boolean generateWorkersDebugInfo();
Program: 70421
Project: 70421
Buggy source:
public abstract void generatePackage();

Fixed version (ground truth):
public abstract boolean generatePackage();
Program: 70423
Project: 70423
Buggy source:
public void executeScript(List<URI> cleanScripts,List<String> cleanParams){
}

Fixed version (ground truth):
public boolean executeScript(List<URI> cleanScripts,List<String> cleanParams){
}
Program: 70424
Project: 70424
Buggy source:
public static void generatePackage(GATWorkerNode node){
  LinkedList<URI> traceScripts=new LinkedList<URI>();
  LinkedList<String> traceParams=new LinkedList<String>();
  String host=node.getHost();
  String installDir=node.getInstallDir();
  String workingDir=node.getWorkingDir();
  String user=node.getUser();
  if (user == null) {
    user="String_Node_Str";
  }
 else {
    user+="String_Node_Str";
  }
  try {
    traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host+ File.separator+ installDir+ TRACE_SCRIPT_PATH));
  }
 catch (  URISyntaxException e) {
    logger.error("String_Node_Str",e);
  }
  String pars="String_Node_Str" + workingDir + "String_Node_Str"+ host;
  traceParams.add(pars);
  new CleanerExecutor(node).executeScript(traceScripts,traceParams);
}

Fixed version (ground truth):
public static boolean generatePackage(GATWorkerNode node){
  LinkedList<URI> traceScripts=new LinkedList<URI>();
  LinkedList<String> traceParams=new LinkedList<String>();
  String host=node.getHost();
  String installDir=node.getInstallDir();
  String workingDir=node.getWorkingDir();
  String user=node.getUser();
  if (user == null) {
    user="String_Node_Str";
  }
 else {
    user+="String_Node_Str";
  }
  try {
    traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host+ File.separator+ installDir+ TRACE_SCRIPT_PATH));
  }
 catch (  URISyntaxException e) {
    logger.error("String_Node_Str",e);
    return false;
  }
  String pars="String_Node_Str" + workingDir + "String_Node_Str"+ host;
  traceParams.add(pars);
  return new CleanerExecutor(node).executeScript(traceScripts,traceParams);
}
Program: 70425
Project: 70425
Buggy source:
@Override public void generateWorkersDebugInfo(){
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean generateWorkersDebugInfo(){
  logger.info("String_Node_Str");
  return false;
}
Program: 70426
Project: 70426
Buggy source:
@Override public void generatePackage(){
  logger.debug("String_Node_Str");
  GATTracer.generatePackage(this);
}

Fixed version (ground truth):
@Override public boolean generatePackage(){
  logger.debug("String_Node_Str");
  GATTracer.generatePackage(this);
  return true;
}
Program: 70427
Project: 70427
Buggy source:
@Override public void stop(){
  logger.debug("String_Node_Str");
  HashSet<NIOWorkerNode> workers=new HashSet<NIOWorkerNode>();
  workers.addAll(nodes);
  Semaphore sem=new Semaphore(0);
  ShutdownListener sl=new ShutdownListener(sem);
  for (  NIOWorkerNode worker : workers) {
    logger.debug("String_Node_Str" + worker.getName());
    worker.stop(sl);
  }
  logger.debug("String_Node_Str");
  sl.enable();
  try {
    sem.acquire();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str");
  tm.shutdown(null);
  logger.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void stop(){
  logger.debug("String_Node_Str");
  HashSet<NIOWorkerNode> workers=new HashSet<NIOWorkerNode>();
  workers.addAll(nodes);
  Semaphore sem=new Semaphore(0);
  ShutdownListener sl=new ShutdownListener(sem);
  for (  NIOWorkerNode worker : workers) {
    logger.debug("String_Node_Str" + worker.getName());
    sl.addOperation();
    worker.stop(sl);
  }
  logger.debug("String_Node_Str");
  sl.enable();
  try {
    sem.acquire();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str");
  tm.shutdown(null);
  logger.debug("String_Node_Str");
}
Program: 70428
Project: 70428
Buggy source:
@Override public void generateWorkersDebugInfo(){
  logger.debug("String_Node_Str" + this.getHost());
  if (node == null) {
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  CommandGenerateWorkerDebugFiles cmd=new CommandGenerateWorkerDebugFiles();
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
  commManager.waitUntilWorkersDebugInfoGenerated();
  logger.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean generateWorkersDebugInfo(){
  if (started) {
    logger.debug("String_Node_Str" + this.getHost());
    if (node == null) {
      logger.error("String_Node_Str");
    }
    Connection c=NIOAgent.tm.startConnection(node);
    CommandGenerateWorkerDebugFiles cmd=new CommandGenerateWorkerDebugFiles();
    c.sendCommand(cmd);
    c.receive();
    c.finishConnection();
    commManager.waitUntilWorkersDebugInfoGenerated();
    logger.debug("String_Node_Str");
    return true;
  }
 else {
    logger.debug("String_Node_Str");
    return false;
  }
}
Program: 70429
Project: 70429
Buggy source:
@Override public void generatePackage(){
  logger.debug("String_Node_Str" + this.getHost());
  if (node == null) {
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  CommandGeneratePackage cmd=new CommandGeneratePackage();
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
  commManager.waitUntilTracingPackageGenerated();
  logger.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean generatePackage(){
  if (started) {
    logger.debug("String_Node_Str" + this.getHost());
    if (node == null) {
      logger.error("String_Node_Str" + this.getHost() + "String_Node_Str");
      return false;
    }
 else {
      Connection c=NIOAgent.tm.startConnection(node);
      CommandGeneratePackage cmd=new CommandGeneratePackage();
      c.sendCommand(cmd);
      c.receive();
      c.finishConnection();
      commManager.waitUntilTracingPackageGenerated();
      logger.debug("String_Node_Str");
      return true;
    }
  }
 else {
    logger.debug("String_Node_Str" + this.getHost() + "String_Node_Str");
    return false;
  }
}
Program: 70430
Project: 70430
Buggy source:
@Override public void start() throws Exception {
  NIONode n=null;
  try {
    n=new WorkerStarter(this).startWorker();
  }
 catch (  Exception e) {
    ErrorManager.warn("String_Node_Str" + getName() + "String_Node_Str",e);
    throw e;
  }
  this.node=n;
  if (NIOTracer.isActivated()) {
    logger.debug("String_Node_Str" + this.getName());
    NIOTracer.startTracing(this.getName(),this.getUser(),this.getHost(),this.getLimitOfTasks());
  }
}

Fixed version (ground truth):
@Override public void start() throws Exception {
  NIONode n=null;
  try {
    workerStarter=new WorkerStarter(this);
    n=workerStarter.startWorker();
  }
 catch (  Exception e) {
    ErrorManager.warn("String_Node_Str" + getName() + "String_Node_Str",e);
    throw e;
  }
  this.node=n;
  if (NIOTracer.isActivated()) {
    logger.debug("String_Node_Str" + this.getName());
    NIOTracer.startTracing(this.getName(),this.getUser(),this.getHost(),this.getLimitOfTasks());
  }
}
Program: 70431
Project: 70431
Buggy source:
@Override public void stop(ShutdownListener sl){
  logger.debug("String_Node_Str" + this.getName());
  if (node == null) {
    sl.notifyFailure(new UnstartedNodeException());
    logger.error("String_Node_Str");
  }
  Connection c=NIOAgent.tm.startConnection(node);
  commManager.shuttingDown(this,c,sl);
  CommandShutdown cmd=new CommandShutdown(null,null);
  c.sendCommand(cmd);
  c.receive();
  c.finishConnection();
}

Fixed version (ground truth):
@Override public void stop(ShutdownListener sl){
  if (started) {
    logger.debug("String_Node_Str" + this.getName());
    if (node == null) {
      sl.notifyFailure(new UnstartedNodeException());
      logger.error("String_Node_Str");
    }
    Connection c=NIOAgent.tm.startConnection(node);
    commManager.shuttingDown(this,c,sl);
    CommandShutdown cmd=new CommandShutdown(null,null);
    c.sendCommand(cmd);
    c.receive();
    c.finishConnection();
  }
 else {
    logger.debug("String_Node_Str" + this.getName() + "String_Node_Str");
    workerStarter.setToStop();
    sl.notifyEnd();
  }
}
Program: 70433
Project: 70433
Buggy source:
@Override public void generateWorkersDebugInfo(){
}

Fixed version (ground truth):
@Override public boolean generateWorkersDebugInfo(){
  return false;
}
Program: 70434
Project: 70434
Buggy source:
@Override public void generatePackage(){
}

Fixed version (ground truth):
@Override public boolean generatePackage(){
  return false;
}
Program: 70435
Project: 70435
Buggy source:
public LogicalData transferObjectValue(TransferObjectRequest toRequest){
  Semaphore sem=toRequest.getSemaphore();
  DataAccessId daId=toRequest.getDaId();
  RWAccessId rwaId=(RWAccessId)daId;
  String sourceName=rwaId.getReadDataInstance().getRenaming();
  LogicalData ld=Comm.getData(sourceName);
  if (ld == null) {
    ErrorManager.error("String_Node_Str" + sourceName);
  }
  if (ld.isInMemory()) {
    if (!ld.isOnStorage()) {
      try {
        ld.writeToStorage();
        ld.removeValue();
      }
 catch (      Exception e) {
        ErrorManager.error("String_Node_Str",e);
      }
    }
 else {
      Comm.clearValue(sourceName);
    }
    toRequest.setResponse(ld.getValue());
    toRequest.getSemaphore().release();
  }
 else {
    DataLocation targetLocation=null;
    String path=DataLocation.Protocol.FILE_URI.getSchema() + Comm.appHost.getTempDirPath() + sourceName;
    try {
      SimpleURI uri=new SimpleURI(path);
      targetLocation=DataLocation.createLocation(Comm.appHost,uri);
    }
 catch (    Exception e) {
      ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + path,e);
    }
    Comm.appHost.getData(sourceName,targetLocation,new ObjectTransferable(),new OneOpWithSemListener(sem));
  }
  return ld;
}

Fixed version (ground truth):
public LogicalData transferObjectValue(TransferObjectRequest toRequest){
  Semaphore sem=toRequest.getSemaphore();
  DataAccessId daId=toRequest.getDaId();
  RWAccessId rwaId=(RWAccessId)daId;
  String sourceName=rwaId.getReadDataInstance().getRenaming();
  LogicalData ld=Comm.getData(sourceName);
  if (ld == null) {
    ErrorManager.error("String_Node_Str" + sourceName);
  }
  if (ld.isInMemory()) {
    if (!ld.isOnStorage()) {
      try {
        ld.writeToStorage();
        ld.removeValue();
      }
 catch (      Exception e) {
        ErrorManager.error("String_Node_Str",e);
      }
    }
 else {
      Comm.clearValue(sourceName);
    }
    toRequest.setResponse(ld.getValue());
    toRequest.setTargetData(ld);
    toRequest.getSemaphore().release();
  }
 else {
    DataLocation targetLocation=null;
    String path=DataLocation.Protocol.FILE_URI.getSchema() + Comm.appHost.getTempDirPath() + sourceName;
    try {
      SimpleURI uri=new SimpleURI(path);
      targetLocation=DataLocation.createLocation(Comm.appHost,uri);
    }
 catch (    Exception e) {
      ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + path,e);
    }
    Comm.appHost.getData(sourceName,targetLocation,new ObjectTransferable(),new OneOpWithSemListener(sem));
  }
  return ld;
}
Program: 70436
Project: 70436
Buggy source:
@Override public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,Job.JobListener listener){
  return null;
}

Fixed version (ground truth):
@Override public Job<?> newJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,Job.JobListener listener){
  return null;
}
Program: 70437
Project: 70437
Buggy source:
public abstract Job<?> newJob(int taskId,TaskParams taskparams,Implementation<?> impl,Resource res,JobListener listener);

Fixed version (ground truth):
public abstract Job<?> newJob(int taskId,TaskDescription taskparams,Implementation<?> impl,Resource res,JobListener listener);
Program: 70438
Project: 70438
Buggy source:
public TaskParams getTaskParams(){
  return taskParams;
}

Fixed version (ground truth):
public TaskDescription getTaskParams(){
  return taskParams;
}
Program: 70439
Project: 70439
Buggy source:
public Job(int taskId,TaskParams task,Implementation<?> impl,Resource res,JobListener listener){
  jobId=nextJobId++;
  this.taskId=taskId;
  this.history=JobHistory.NEW;
  this.taskParams=task;
  this.impl=impl;
  this.worker=res;
  this.listener=listener;
  classpathFromFile=getResourceNode().getClasspath();
  if (!classpathFromFile.equals("String_Node_Str")) {
    if (!classpathFromEnvironment.equals("String_Node_Str")) {
      workerClasspath=classpathFromEnvironment + "String_Node_Str" + classpathFromFile;
    }
 else {
      workerClasspath=classpathFromFile;
    }
  }
 else {
    workerClasspath=classpathFromEnvironment;
  }
  pythonpathFromFile=getResourceNode().getPythonpath();
  if (!pythonpathFromFile.equals("String_Node_Str")) {
    if (!pythonpathFromEnvironment.equals("String_Node_Str")) {
      workerPythonpath=pythonpathFromEnvironment + "String_Node_Str" + pythonpathFromFile;
    }
 else {
      workerPythonpath=pythonpathFromFile;
    }
  }
 else {
    workerPythonpath=pythonpathFromEnvironment;
  }
}

Fixed version (ground truth):
public Job(int taskId,TaskDescription task,Implementation<?> impl,Resource res,JobListener listener){
  jobId=nextJobId++;
  this.taskId=taskId;
  this.history=JobHistory.NEW;
  this.taskParams=task;
  this.impl=impl;
  this.worker=res;
  this.listener=listener;
  classpathFromFile=getResourceNode().getClasspath();
  if (!classpathFromFile.equals("String_Node_Str")) {
    if (!classpathFromEnvironment.equals("String_Node_Str")) {
      workerClasspath=classpathFromEnvironment + "String_Node_Str" + classpathFromFile;
    }
 else {
      workerClasspath=classpathFromFile;
    }
  }
 else {
    workerClasspath=classpathFromEnvironment;
  }
  pythonpathFromFile=getResourceNode().getPythonpath();
  if (!pythonpathFromFile.equals("String_Node_Str")) {
    if (!pythonpathFromEnvironment.equals("String_Node_Str")) {
      workerPythonpath=pythonpathFromEnvironment + "String_Node_Str" + pythonpathFromFile;
    }
 else {
      workerPythonpath=pythonpathFromFile;
    }
  }
 else {
    workerPythonpath=pythonpathFromEnvironment;
  }
}
Program: 70440
Project: 70440
Buggy source:
public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,JobListener listener){
  return node.newJob(taskId,taskParams,impl,this,listener);
}

Fixed version (ground truth):
public Job<?> newJob(int taskId,TaskDescription taskParams,Implementation<?> impl,JobListener listener){
  return node.newJob(taskId,taskParams,impl,this,listener);
}
Program: 70441
Project: 70441
Buggy source:
public GATJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener,GATContext context,boolean userNeeded,boolean usingGlobus){
  super(taskId,taskParams,impl,res,listener);
  this.context=context;
  this.userNeeded=userNeeded;
  this.usingGlobus=usingGlobus;
}

Fixed version (ground truth):
public GATJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,JobListener listener,GATContext context,boolean userNeeded,boolean usingGlobus){
  super(taskId,taskParams,impl,res,listener);
  this.context=context;
  this.userNeeded=userNeeded;
  this.usingGlobus=usingGlobus;
}
Program: 70443
Project: 70443
Buggy source:
@Override public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new GATJob(taskId,taskParams,impl,res,listener,config.getContext(),config.isUserNeeded(),config.isUsingGlobus());
}

Fixed version (ground truth):
@Override public Job<?> newJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new GATJob(taskId,taskParams,impl,res,listener,config.getContext(),config.isUserNeeded(),config.isUsingGlobus());
}
Program: 70444
Project: 70444
Buggy source:
@Override public void handle(Connection c){
  if (agent.isMyUuid(this.uuid)) {
    if (agent.getMaster() == null) {
      agent.setMaster((NIONode)c.getNode());
    }
  }
  CommandCheckWorkerACK cmd=new CommandCheckWorkerACK(uuid,nodeName);
  c.sendCommand(cmd);
  c.finishConnection();
}

Fixed version (ground truth):
@Override public void handle(Connection c){
  if (agent.isMyUuid(this.uuid)) {
    if (agent.getMaster() == null) {
      agent.setMaster((NIONode)c.getNode());
    }
    CommandCheckWorkerACK cmd=new CommandCheckWorkerACK(uuid,nodeName);
    c.sendCommand(cmd);
  }
  c.finishConnection();
}
Program: 70445
Project: 70445
Buggy source:
public NIOJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  super(taskId,taskParams,impl,res,listener);
}

Fixed version (ground truth):
public NIOJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,JobListener listener){
  super(taskId,taskParams,impl,res,listener);
}
Program: 70446
Project: 70446
Buggy source:
@Override public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new NIOJob(taskId,taskParams,impl,res,listener);
}

Fixed version (ground truth):
@Override public Job<?> newJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new NIOJob(taskId,taskParams,impl,res,listener);
}
Program: 70447
Project: 70447
Buggy source:
@Override public Job<?> newJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new WSJob<COMPSsWorker>(taskId,taskParams,impl,res,listener);
}

Fixed version (ground truth):
@Override public Job<?> newJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,JobListener listener){
  return new WSJob<COMPSsWorker>(taskId,taskParams,impl,res,listener);
}
Program: 70448
Project: 70448
Buggy source:
public WSJob(int taskId,TaskParams taskParams,Implementation<?> impl,Resource res,JobListener listener){
  super(taskId,taskParams,impl,res,listener);
  this.returnValue=null;
}

Fixed version (ground truth):
public WSJob(int taskId,TaskDescription taskParams,Implementation<?> impl,Resource res,JobListener listener){
  super(taskId,taskParams,impl,res,listener);
  this.returnValue=null;
}
Program: 70449
Project: 70449
Buggy source:
@Override public void processRequests(){
  while (true) {
    WSJob<?> job=null;
    job=queue.dequeue();
    if (job == null) {
      break;
    }
    try {
      ArrayList<Object> input=new ArrayList<Object>();
      TaskParams taskParams=job.taskParams;
      ServiceImplementation service=(ServiceImplementation)job.impl;
      Parameter[] parameters=taskParams.getParameters();
      for (int i=0; i < taskParams.getParameters().length; i++) {
        if (parameters[i].getDirection() == DataDirection.IN) {
switch (parameters[i].getType()) {
case OBJECT_T:
case PSCO_T:
            DependencyParameter dp=(DependencyParameter)parameters[i];
          Object o=getObjectValue(dp);
        input.add(o);
      break;
case FILE_T:
    break;
default :
  BasicTypeParameter btParB=(BasicTypeParameter)parameters[i];
input.add(btParB.getValue());
}
}
}
ServiceInstance si=(ServiceInstance)job.getResourceNode();
String portName=service.getRequirements().getPort();
String operationName=service.getOperation();
if (operationName.compareTo("String_Node_Str") == 0) {
operationName=taskParams.getName();
}
Client client=getClient(si,portName);
ClientCallback cb=new ClientCallback();
client.invoke(cb,operationName,input.toArray());
Object[] result=cb.get();
if (result.length > 0) {
job.returnValue=result[0];
}
job.listener.jobCompleted(job);
}
 catch (Exception e) {
job.listener.jobFailed(job,JobEndStatus.EXECUTION_FAILED);
logger.error(SUBMIT_ERROR,e);
return;
}
}
}

Fixed version (ground truth):
@Override public void processRequests(){
  while (true) {
    WSJob<?> job=null;
    job=queue.dequeue();
    if (job == null) {
      break;
    }
    try {
      ArrayList<Object> input=new ArrayList<Object>();
      TaskDescription taskParams=job.taskParams;
      ServiceImplementation service=(ServiceImplementation)job.impl;
      Parameter[] parameters=taskParams.getParameters();
      for (int i=0; i < taskParams.getParameters().length; i++) {
        if (parameters[i].getDirection() == DataDirection.IN) {
switch (parameters[i].getType()) {
case OBJECT_T:
case PSCO_T:
            DependencyParameter dp=(DependencyParameter)parameters[i];
          Object o=getObjectValue(dp);
        input.add(o);
      break;
case FILE_T:
    break;
default :
  BasicTypeParameter btParB=(BasicTypeParameter)parameters[i];
input.add(btParB.getValue());
}
}
}
ServiceInstance si=(ServiceInstance)job.getResourceNode();
String portName=service.getRequirements().getPort();
String operationName=service.getOperation();
if (operationName.compareTo("String_Node_Str") == 0) {
operationName=taskParams.getName();
}
Client client=getClient(si,portName);
ClientCallback cb=new ClientCallback();
client.invoke(cb,operationName,input.toArray());
Object[] result=cb.get();
if (result.length > 0) {
job.returnValue=result[0];
}
job.listener.jobCompleted(job);
}
 catch (Exception e) {
job.listener.jobFailed(job,JobEndStatus.EXECUTION_FAILED);
logger.error(SUBMIT_ERROR,e);
return;
}
}
}
Program: 70450
Project: 70450
Buggy source:
private Object obtainObject(DataAccessId oaId){
  Semaphore sem=new Semaphore(0);
  TransferObjectRequest tor=new TransferObjectRequest(oaId,sem);
  requestQueue.offer(tor);
  try {
    sem.acquire();
  }
 catch (  InterruptedException e) {
  }
  Object oUpdated=tor.getResponse();
  if (oUpdated == null) {
    LogicalData ld=tor.getLogicalDataTarget();
    try {
      ld.loadFromStorage();
      oUpdated=ld.getValue();
    }
 catch (    Exception e) {
      logger.fatal(ERROR_OBJECT_LOAD_FROM_STORAGE + "String_Node_Str" + ld.getName(),e);
      ErrorManager.fatal(ERROR_OBJECT_LOAD_FROM_STORAGE + "String_Node_Str" + ld.getName(),e);
    }
  }
  return oUpdated;
}

Fixed version (ground truth):
private Object obtainObject(DataAccessId oaId){
  Semaphore sem=new Semaphore(0);
  TransferObjectRequest tor=new TransferObjectRequest(oaId,sem);
  requestQueue.offer(tor);
  try {
    sem.acquire();
  }
 catch (  InterruptedException e) {
  }
  Object oUpdated=tor.getResponse();
  if (oUpdated == null) {
    LogicalData ld=tor.getLogicalDataTarget();
    try {
      ld.loadFromStorage();
      oUpdated=ld.getValue();
    }
 catch (    Exception e) {
      logger.fatal(ERROR_OBJECT_LOAD_FROM_STORAGE + "String_Node_Str" + ((ld == null) ? "String_Node_Str" : ld.getName()),e);
      ErrorManager.fatal(ERROR_OBJECT_LOAD_FROM_STORAGE + "String_Node_Str" + ((ld == null) ? "String_Node_Str" : ld.getName()),e);
    }
  }
  return oUpdated;
}
Program: 70451
Project: 70451
Buggy source:
public static synchronized LogicalData registerValue(String dataId,Object value){
  logger.debug("String_Node_Str" + value + "String_Node_Str"+ dataId);
  String targetPath=Protocol.OBJECT_URI.getSchema() + dataId;
  DataLocation location=null;
  try {
    SimpleURI uri=new SimpleURI(targetPath);
    location=DataLocation.createLocation(appHost,uri);
  }
 catch (  Exception e) {
    ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + targetPath,e);
  }
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  logicalData.setValue(value);
  return logicalData;
}

Fixed version (ground truth):
public static synchronized LogicalData registerValue(String dataId,Object value){
  logger.debug("String_Node_Str" + value + "String_Node_Str"+ dataId);
  String targetPath=Protocol.OBJECT_URI.getSchema() + dataId;
  DataLocation location=null;
  try {
    SimpleURI uri=new SimpleURI(targetPath);
    location=DataLocation.createLocation(appHost,uri);
  }
 catch (  Exception e) {
    ErrorManager.error(DataLocation.ERROR_INVALID_LOCATION + "String_Node_Str" + targetPath,e);
  }
  LogicalData logicalData=data.get(dataId);
  logicalData.addLocation(location);
  logicalData.setValue(value);
  if (value instanceof StubItf) {
    String id=((StubItf)value).getID();
    if (id != null) {
      Comm.registerPSCO(dataId,id);
    }
  }
  return logicalData;
}
Program: 70453
Project: 70453
Buggy source:
/** 
 * Stops the COMPSsRuntime
 */
@Override public void stopIT(boolean terminate){
synchronized (this) {
    if (Tracer.isActivated()) {
      Tracer.emitEvent(Tracer.Event.STOP.getId(),Tracer.Event.STOP.getType());
    }
    td.getTaskSummary(logger);
    logger.info("String_Node_Str");
    if (GraphGenerator.isEnabled()) {
      logger.debug("String_Node_Str");
    }
    if (RuntimeMonitor.isEnabled()) {
      logger.debug("String_Node_Str");
      runtimeMonitor.shutdown();
    }
    logger.debug("String_Node_Str");
    if (ap != null) {
      ap.shutdown();
    }
 else {
      logger.debug("String_Node_Str");
    }
    logger.debug("String_Node_Str");
    if (td != null) {
      td.shutdown();
    }
 else {
      logger.debug("String_Node_Str");
    }
    logger.debug("String_Node_Str");
    Comm.stop();
    logger.debug("String_Node_Str");
  }
  logger.warn("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Stops the COMPSsRuntime
 */
@Override public void stopIT(boolean terminate){
synchronized (this) {
    if (Tracer.isActivated()) {
      Tracer.emitEvent(Tracer.Event.STOP.getId(),Tracer.Event.STOP.getType());
    }
    boolean taskSummaryEnabled=System.getProperty(ITConstants.IT_TASK_SUMMARY) != null && !System.getProperty(ITConstants.IT_TASK_SUMMARY).isEmpty() && Boolean.valueOf(System.getProperty(ITConstants.IT_TASK_SUMMARY));
    if (taskSummaryEnabled) {
      td.getTaskSummary(logger);
    }
    logger.info("String_Node_Str");
    if (GraphGenerator.isEnabled()) {
      logger.debug("String_Node_Str");
    }
    if (RuntimeMonitor.isEnabled()) {
      logger.debug("String_Node_Str");
      runtimeMonitor.shutdown();
    }
    logger.debug("String_Node_Str");
    if (ap != null) {
      ap.shutdown();
    }
 else {
      logger.debug("String_Node_Str");
    }
    logger.debug("String_Node_Str");
    if (td != null) {
      td.shutdown();
    }
 else {
      logger.debug("String_Node_Str");
    }
    logger.debug("String_Node_Str");
    Comm.stop();
    logger.debug("String_Node_Str");
  }
  logger.warn("String_Node_Str");
}
Program: 70454
Project: 70454
Buggy source:
public DataAccessId registerObjectAccess(AccessMode mode,Object value,int code,int readerId){
  DataInfo oInfo;
  Integer aoId=codeToId.get(code);
  if (aoId == null) {
    if (debug) {
      logger.debug("String_Node_Str" + code);
    }
    oInfo=new ObjectInfo(code);
    aoId=oInfo.getDataId();
    codeToId.put(code,aoId);
    idToData.put(aoId,oInfo);
    DataInstanceId lastDID=oInfo.getCurrentDataInstanceId();
    String renaming=lastDID.getRenaming();
    if (mode != AccessMode.W) {
      Comm.registerValue(renaming,value);
      if (value instanceof StubItf) {
        String id=((StubItf)value).getID();
        if (id != null) {
          Comm.registerPSCO(renaming,id);
        }
      }
    }
  }
 else {
    if (debug) {
      logger.debug("String_Node_Str" + code);
    }
    oInfo=idToData.get(aoId);
  }
  return willAccess(mode,oInfo);
}

Fixed version (ground truth):
public DataAccessId registerObjectAccess(AccessMode mode,Object value,int code,int readerId){
  DataInfo oInfo;
  Integer aoId=codeToId.get(code);
  if (aoId == null) {
    if (debug) {
      logger.debug("String_Node_Str" + code);
    }
    oInfo=new ObjectInfo(code);
    aoId=oInfo.getDataId();
    codeToId.put(code,aoId);
    idToData.put(aoId,oInfo);
    DataInstanceId lastDID=oInfo.getCurrentDataInstanceId();
    String renaming=lastDID.getRenaming();
    if (mode != AccessMode.W) {
      Comm.registerValue(renaming,value);
    }
  }
 else {
    if (debug) {
      logger.debug("String_Node_Str" + code);
    }
    oInfo=idToData.get(aoId);
  }
  return willAccess(mode,oInfo);
}
Program: 70455
Project: 70455
Buggy source:
/** 
 * Sets the PSCO Id value (null if it is not PSCO)
 * @param id
 */
public synchronized void setId(String id){
  this.id=id;
}

Fixed version (ground truth):
/** 
 * Sets the LD id
 * @param id
 */
public synchronized void setId(String id){
  this.id=id;
}
Program: 70456
Project: 70456
Buggy source:
/** 
 * Loads the value of the LogicalData from a file
 * @throws Exception
 */
public synchronized void loadFromStorage() throws Exception {
  if (value != null) {
    return;
  }
  for (  DataLocation loc : this.locations) {
switch (loc.getType()) {
case PRIVATE:
case SHARED:
      MultiURI u=loc.getURIInHost(Comm.appHost);
    if (u == null) {
      continue;
    }
  String path=u.getPath();
if (path.startsWith(File.separator)) {
  this.value=Serializer.deserialize(path);
  String targetPath=Protocol.OBJECT_URI.getSchema() + this.name;
  SimpleURI uri=new SimpleURI(targetPath);
  DataLocation tgtLoc=DataLocation.createLocation(Comm.appHost,uri);
  addLocation(tgtLoc);
}
return;
case PERSISTENT:
PersistentLocation pLoc=(PersistentLocation)loc;
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.Event.STORAGE_GETBYID.getId(),Tracer.Event.STORAGE_GETBYID.getType());
}
try {
this.value=StorageItf.getByID(pLoc.getId());
}
 catch (StorageException se) {
throw new Exception("String_Node_Str" + pLoc.getId(),se);
}
 finally {
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END,Tracer.Event.STORAGE_GETBYID.getType());
}
}
String targetPath=Protocol.OBJECT_URI.getSchema() + this.name;
SimpleURI uri=new SimpleURI(targetPath);
DataLocation tgtLoc=DataLocation.createLocation(Comm.appHost,uri);
addLocation(tgtLoc);
return;
}
}
throw new Exception("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Loads the value of the LogicalData from a file
 * @throws Exception
 */
public synchronized void loadFromStorage() throws Exception {
  if (value != null) {
    return;
  }
  for (  DataLocation loc : this.locations) {
switch (loc.getType()) {
case PRIVATE:
case SHARED:
      MultiURI u=loc.getURIInHost(Comm.appHost);
    if (u == null) {
      continue;
    }
  String path=u.getPath();
if (path.startsWith(File.separator)) {
  this.value=Serializer.deserialize(path);
  String targetPath=Protocol.OBJECT_URI.getSchema() + this.name;
  SimpleURI uri=new SimpleURI(targetPath);
  DataLocation tgtLoc=DataLocation.createLocation(Comm.appHost,uri);
  addLocation(tgtLoc);
}
return;
case PERSISTENT:
PersistentLocation pLoc=(PersistentLocation)loc;
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.Event.STORAGE_GETBYID.getId(),Tracer.Event.STORAGE_GETBYID.getType());
}
try {
this.value=StorageItf.getByID(pLoc.getId());
this.id=pLoc.getId();
}
 catch (StorageException se) {
throw new Exception("String_Node_Str" + pLoc.getId(),se);
}
 finally {
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END,Tracer.Event.STORAGE_GETBYID.getType());
}
}
String targetPath=Protocol.OBJECT_URI.getSchema() + this.name;
SimpleURI uri=new SimpleURI(targetPath);
DataLocation tgtLoc=DataLocation.createLocation(Comm.appHost,uri);
addLocation(tgtLoc);
return;
}
}
throw new Exception("String_Node_Str");
}