nus-yam/ex-repair huggingface dataset:
Program: 79463
Project: 79463
Buggy source:
@SuppressWarnings("String_Node_Str") protected void registerPollTask(){
  final Runnable job=new Runnable(){
    @Override public void run(){
      try {
        publishAndCheck(false);
      }
 catch (      Exception e) {
        if (running) {
          LOG.error("String_Node_Str" + e,e);
        }
 else {
          if (LOG.isDebugEnabled())           LOG.debug("String_Node_Str" + e,e);
        }
      }
catch (      Throwable t) {
        LOG.error("String_Node_Str" + t,t);
        throw Exceptions.propagate(t);
      }
    }
  }
;
  Callable<Task<?>> taskFactory=new Callable<Task<?>>(){
    @Override public Task<?> call(){
      return new BasicTask<Void>(job);
    }
  }
;
  if (pollPeriod == null || pollPeriod.equals(Duration.PRACTICALLY_FOREVER)) {
  }
 else {
    ScheduledTask task=new ScheduledTask(MutableMap.of("String_Node_Str",pollPeriod),taskFactory);
    pollingTask=managementContext.getExecutionManager().submit(task);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void registerPollTask(){
  final Runnable job=new Runnable(){
    @Override public void run(){
      try {
        publishAndCheck(false);
      }
 catch (      Exception e) {
        if (running) {
          LOG.error("String_Node_Str" + e,e);
        }
 else {
          if (LOG.isDebugEnabled())           LOG.debug("String_Node_Str" + e,e);
        }
      }
catch (      Throwable t) {
        LOG.error("String_Node_Str" + t,t);
        throw Exceptions.propagate(t);
      }
    }
  }
;
  Callable<Task<?>> taskFactory=new Callable<Task<?>>(){
    @Override public Task<?> call(){
      return new BasicTask<Void>(job);
    }
  }
;
  LOG.debug("String_Node_Str" + this + "String_Node_Str"+ pollPeriod);
  if (pollPeriod == null || pollPeriod.equals(Duration.PRACTICALLY_FOREVER)) {
  }
 else {
    ScheduledTask task=new ScheduledTask(MutableMap.of("String_Node_Str",pollPeriod),taskFactory);
    pollingTask=managementContext.getExecutionManager().submit(task);
  }
}
Program: 79464
Project: 79464
Buggy source:
@Override public void stop(){
  boolean wasRunning=running;
  running=false;
  nodeState=ManagementNodeState.TERMINATED;
  if (pollingTask != null)   pollingTask.cancel(true);
  if (wasRunning) {
    try {
      publishHealth();
    }
 catch (    Exception e) {
      Exceptions.propagateIfFatal(e);
      LOG.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void stop(){
  LOG.debug("String_Node_Str" + this);
  boolean wasRunning=running;
  running=false;
  nodeState=ManagementNodeState.TERMINATED;
  if (pollingTask != null)   pollingTask.cancel(true);
  if (wasRunning) {
    try {
      publishHealth();
    }
 catch (    Exception e) {
      Exceptions.propagateIfFatal(e);
      LOG.error("String_Node_Str",e);
    }
  }
}
Program: 79465
Project: 79465
Buggy source:
public HighAvailabilityManagerImpl setPollPeriod(Duration val){
  this.pollPeriod=checkNotNull(val,"String_Node_Str");
  if (running && pollingTask != null) {
    pollingTask.cancel(true);
    registerPollTask();
  }
  return this;
}

Fixed version (ground truth):
public HighAvailabilityManagerImpl setPollPeriod(Duration val){
  this.pollPeriod=checkNotNull(val,"String_Node_Str");
  if (running) {
    if (pollingTask != null) {
      pollingTask.cancel(true);
    }
    registerPollTask();
  }
  return this;
}
Program: 79466
Project: 79466
Buggy source:
protected boolean isHeartbeatOk(ManagementNodeSyncRecord masterNode,ManagementNodeSyncRecord meNode){
  if (masterNode == null || meNode == null)   return false;
  Long timestampMaster=masterNode.getRemoteTimestamp();
  Long timestampMe=meNode.getRemoteTimestamp();
  if (timestampMaster == null || timestampMe == null)   return false;
  return (timestampMe - timestampMaster) <= heartbeatTimeout.toMilliseconds();
}

Fixed version (ground truth):
protected boolean isHeartbeatOk(ManagementNodeSyncRecord masterNode,ManagementNodeSyncRecord meNode){
  if (masterNode == null)   return false;
  if (meNode == null) {
    return true;
  }
  Long timestampMaster=masterNode.getRemoteTimestamp();
  Long timestampMe=meNode.getRemoteTimestamp();
  if (timestampMaster == null || timestampMe == null)   return false;
  return (timestampMe - timestampMaster) <= heartbeatTimeout.toMilliseconds();
}
Program: 79467
Project: 79467
Buggy source:
protected ManagementNodeSyncRecord hasHealthyMaster(){
  ManagementPlaneSyncRecord memento=loadManagementPlaneSyncRecord(false);
  String nodeId=memento.getMasterNodeId();
  ManagementNodeSyncRecord masterMemento=(nodeId == null) ? null : memento.getManagementNodes().get(nodeId);
  boolean result=masterMemento != null && masterMemento.getStatus() == ManagementNodeState.MASTER && isHeartbeatOk(masterMemento,memento.getManagementNodes().get(ownNodeId));
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str",new Object[]{result,nodeId,(masterMemento == null ? "String_Node_Str" : masterMemento.toVerboseString())});
  return (result ? masterMemento : null);
}

Fixed version (ground truth):
protected ManagementNodeSyncRecord hasHealthyMaster(){
  ManagementPlaneSyncRecord memento=loadManagementPlaneSyncRecord(false);
  String nodeId=memento.getMasterNodeId();
  ManagementNodeSyncRecord masterMemento=(nodeId == null) ? null : memento.getManagementNodes().get(nodeId);
  ManagementNodeSyncRecord ourMemento=memento.getManagementNodes().get(ownNodeId);
  boolean result=masterMemento != null && masterMemento.getStatus() == ManagementNodeState.MASTER && isHeartbeatOk(masterMemento,ourMemento);
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str",new Object[]{result,nodeId,(masterMemento == null ? "String_Node_Str" : masterMemento.toVerboseString()),(ourMemento == null ? "String_Node_Str" : ourMemento.toVerboseString())});
  return (result ? masterMemento : null);
}
Program: 79469
Project: 79469
Buggy source:
public void run(){
  if (staggerStart != null)   Time.sleep(staggerStart.multiply(Math.random()));
  n.ha.start(HighAvailabilityMode.AUTO);
}

Fixed version (ground truth):
public void run(){
  if (staggerStart != null)   Time.sleep(staggerStart.multiply(Math.random()));
  n.ha.start(HighAvailabilityMode.AUTO);
  n.ha.setPollPeriod(Duration.millis(20));
}
Program: 79470
Project: 79470
Buggy source:
@Override public Boolean call() throws Exception {
  ManagementPlaneSyncRecord memento=nodes.get(0).ha.getManagementPlaneSyncState();
  int masters=0, standbys=0, savedMasters=0, savedStandbys=0;
  for (  HaMgmtNode n : nodes) {
    if (n.ha.getNodeState() == ManagementNodeState.MASTER)     masters++;
    if (n.ha.getNodeState() == ManagementNodeState.STANDBY)     standbys++;
    ManagementNodeSyncRecord m=memento.getManagementNodes().get(n.ownNodeId);
    if (m != null) {
      if (m.getStatus() == ManagementNodeState.MASTER)       savedMasters++;
      if (m.getStatus() == ManagementNodeState.STANDBY)       savedStandbys++;
    }
  }
  log.info("String_Node_Str" + nodes.size() + "String_Node_Str"+ masters+ "String_Node_Str"+ standbys+ "String_Node_Str"+ memento.getManagementNodes().size()+ "String_Node_Str"+ memento.getMasterNodeId()+ "String_Node_Str"+ savedMasters+ "String_Node_Str"+ savedStandbys+ "String_Node_Str");
  return masters == 1 && standbys == nodes.size() - 1 && savedMasters == 1 && savedStandbys == nodes.size() - 1;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  ManagementPlaneSyncRecord memento=nodes.get(0).ha.getManagementPlaneSyncState();
  int masters=0, standbys=0, savedMasters=0, savedStandbys=0;
  for (  HaMgmtNode n : nodes) {
    if (n.ha.getNodeState() == ManagementNodeState.MASTER)     masters++;
    if (n.ha.getNodeState() == ManagementNodeState.STANDBY)     standbys++;
    ManagementNodeSyncRecord m=memento.getManagementNodes().get(n.ownNodeId);
    if (m != null) {
      if (m.getStatus() == ManagementNodeState.MASTER)       savedMasters++;
      if (m.getStatus() == ManagementNodeState.STANDBY)       savedStandbys++;
    }
  }
  log.info("String_Node_Str" + nodes.size() + "String_Node_Str"+ masters+ "String_Node_Str"+ standbys+ "String_Node_Str"+ memento.getManagementNodes().size()+ "String_Node_Str"+ memento.getMasterNodeId()+ "String_Node_Str"+ savedMasters+ "String_Node_Str"+ savedStandbys+ "String_Node_Str");
  if (timer.isRunning() && Duration.of(timer).compareTo(Duration.TEN_SECONDS) > 0) {
    log.warn("String_Node_Str");
    timer.stop();
  }
  return masters == 1 && standbys == nodes.size() - 1 && savedMasters == 1 && savedStandbys == nodes.size() - 1;
}
Program: 79471
Project: 79471
Buggy source:
protected abstract <T>Task<T> submitInternal(Map<?,?> properties,Object task);

Fixed version (ground truth):
/** 
 * does the work internally of submitting the task; note that the return value may be a wrapper task even if a task is passed in, if the execution context where the target should run is different (e.g. submitting an effector task cross-context) 
 */
protected abstract <T>Task<T> submitInternal(Map<?,?> properties,Object task);
Program: 79472
Project: 79472
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public CompoundTask(Map<String,?> flags,Collection<?> jobs){
  super(flags);
  super.job=new Callable<List<T>>(){
    @Override public List<T> call() throws Exception {
      return runJobs();
    }
  }
;
  this.result=new ArrayList<Object>(jobs.size());
  this.children=new ArrayList<Task<? extends T>>(jobs.size());
  for (  Object job : jobs) {
    Task subtask;
    if (job instanceof TaskAdaptable) {
      subtask=((TaskAdaptable)job).asTask();
    }
 else     if (job instanceof Closure) {
      subtask=new BasicTask<T>((Closure)job);
    }
 else     if (job instanceof Callable) {
      subtask=new BasicTask<T>((Callable)job);
    }
 else     if (job instanceof Runnable) {
      subtask=new BasicTask<T>((Runnable)job);
    }
 else     throw new IllegalArgumentException("String_Node_Str" + (job == null ? null : job.getClass() + "String_Node_Str" + job+ "String_Node_Str") + "String_Node_Str");
    BrooklynTaskTags.addTagDynamically(subtask,ManagementContextInternal.SUB_TASK_TAG);
    children.add(subtask);
  }
  for (  Task<?> t : getChildren())   ((TaskInternal<?>)t).markQueued();
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public CompoundTask(Map<String,?> flags,Collection<?> jobs){
  super(flags);
  super.job=new Callable<List<T>>(){
    @Override public List<T> call() throws Exception {
      return runJobs();
    }
  }
;
  this.result=new ArrayList<Object>(jobs.size());
  this.children=new ArrayList<Task<? extends T>>(jobs.size());
  for (  Object job : jobs) {
    Task subtask;
    if (job instanceof TaskAdaptable) {
      subtask=((TaskAdaptable)job).asTask();
    }
 else     if (job instanceof Closure) {
      subtask=new BasicTask<T>((Closure)job);
    }
 else     if (job instanceof Callable) {
      subtask=new BasicTask<T>((Callable)job);
    }
 else     if (job instanceof Runnable) {
      subtask=new BasicTask<T>((Runnable)job);
    }
 else     throw new IllegalArgumentException("String_Node_Str" + (job == null ? null : job.getClass() + "String_Node_Str" + job+ "String_Node_Str") + "String_Node_Str");
    BrooklynTaskTags.addTagDynamically(subtask,ManagementContextInternal.SUB_TASK_TAG);
    children.add(subtask);
  }
  for (  Task<?> t : getChildren()) {
    ((TaskInternal<?>)t).markQueued();
  }
}
Program: 79473
Project: 79473
Buggy source:
@SuppressWarnings("String_Node_Str") public <T extends Entity>T createEntityProxy(EntitySpec<T> spec,T entity){
  ClassLoader classloader=(spec.getImplementation() != null ? spec.getImplementation() : spec.getType()).getClassLoader();
  MutableSet.Builder<Class<?>> builder=MutableSet.<Class<?>>builder().add(EntityProxy.class,Entity.class,EntityLocal.class,EntityInternal.class);
  if (spec.getType().isInterface()) {
    builder.add(spec.getType());
  }
 else {
    log.warn("String_Node_Str" + spec.getType() + "String_Node_Str");
  }
  builder.addAll(spec.getAdditionalInterfaces());
  Set<Class<?>> interfaces=builder.build();
  AggregateClassLoader aggregateClassLoader=AggregateClassLoader.newInstanceWithNoLoaders();
  aggregateClassLoader.addFirst(classloader);
  aggregateClassLoader.addFirst(entity.getClass().getClassLoader());
  for (  Class<?> iface : interfaces) {
    aggregateClassLoader.addLast(iface.getClassLoader());
  }
  return (T)java.lang.reflect.Proxy.newProxyInstance(aggregateClassLoader,interfaces.toArray(new Class[interfaces.size()]),new EntityProxyImpl(entity));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T extends Entity>T createEntityProxy(EntitySpec<T> spec,T entity){
  MutableSet.Builder<Class<?>> builder=MutableSet.<Class<?>>builder().add(EntityProxy.class,Entity.class,EntityLocal.class,EntityInternal.class);
  if (spec.getType().isInterface()) {
    builder.add(spec.getType());
  }
 else {
    log.warn("String_Node_Str" + spec.getType() + "String_Node_Str");
  }
  builder.addAll(spec.getAdditionalInterfaces());
  Set<Class<?>> interfaces=builder.build();
  AggregateClassLoader aggregateClassLoader=AggregateClassLoader.newInstanceWithNoLoaders();
  aggregateClassLoader.addFirst(entity.getClass().getClassLoader());
  for (  Class<?> iface : interfaces) {
    aggregateClassLoader.addLast(iface.getClassLoader());
  }
  return (T)java.lang.reflect.Proxy.newProxyInstance(aggregateClassLoader,interfaces.toArray(new Class[interfaces.size()]),new EntityProxyImpl(entity));
}
Program: 79474
Project: 79474
Buggy source:
public <T>Maybe<Class<T>> tryResolveClass(String type,Iterable<String> bundleUrlsOrNameVersionString){
  Map<String,Throwable> bundleProblems=MutableMap.of();
  for (  String bundleUrlOrNameVersionString : bundleUrlsOrNameVersionString) {
    try {
      String bundleNameVersion=bundleUrlToNameVersionString.get(bundleUrlOrNameVersionString);
      if (bundleNameVersion == null) {
        bundleNameVersion=bundleUrlOrNameVersionString;
      }
      Maybe<Bundle> bundle=Osgis.getBundle(framework,bundleNameVersion);
      if (bundle.isPresent()) {
        @SuppressWarnings("String_Node_Str") Class<T> clazz=(Class<T>)bundle.get().loadClass(type);
        return Maybe.of(clazz);
      }
 else {
        bundleProblems.put(bundleUrlOrNameVersionString,new IllegalStateException("String_Node_Str" + bundleUrlOrNameVersionString));
      }
    }
 catch (    Exception e) {
      Exceptions.propagateIfFatal(e);
      bundleProblems.put(bundleUrlOrNameVersionString,e);
    }
  }
  return Maybe.absent("String_Node_Str" + type + "String_Node_Str"+ bundleProblems);
}

Fixed version (ground truth):
public <T>Maybe<Class<T>> tryResolveClass(String type,Iterable<String> bundleUrlsOrNameVersionString){
  Map<String,Throwable> bundleProblems=MutableMap.of();
  for (  String bundleUrlOrNameVersionString : bundleUrlsOrNameVersionString) {
    try {
      String bundleNameVersion=bundleUrlToNameVersionString.get(bundleUrlOrNameVersionString);
      if (bundleNameVersion == null) {
        bundleNameVersion=bundleUrlOrNameVersionString;
      }
      Maybe<Bundle> bundle=Osgis.getBundle(framework,bundleNameVersion);
      if (bundle.isPresent()) {
        Bundle b=bundle.get();
        Class<T> clazz;
        if (Osgis.isExtensionBundle(b)) {
          @SuppressWarnings("String_Node_Str") Class<T> c=(Class<T>)Class.forName(type);
          clazz=c;
        }
 else {
          @SuppressWarnings("String_Node_Str") Class<T> c=(Class<T>)b.loadClass(type);
          clazz=c;
        }
        return Maybe.of(clazz);
      }
 else {
        bundleProblems.put(bundleUrlOrNameVersionString,new IllegalStateException("String_Node_Str" + bundleUrlOrNameVersionString));
      }
    }
 catch (    Exception e) {
      Exceptions.propagateIfFatal(e);
      bundleProblems.put(bundleUrlOrNameVersionString,e);
      Throwable cause=e.getCause();
      if (cause != null && cause.getMessage().contains("String_Node_Str")) {
        log.warn("String_Node_Str" + bundleUrlOrNameVersionString + "String_Node_Str"+ type+ "String_Node_Str"+ cause.getMessage());
        if (log.isDebugEnabled())         log.debug("String_Node_Str",e);
      }
    }
  }
  return Maybe.absent("String_Node_Str" + type + "String_Node_Str"+ bundleProblems);
}
Program: 79475
Project: 79475
Buggy source:
public String getClassLoaderDir(String resourceInThatDir){
  resourceInThatDir=Strings.removeFromStart(resourceInThatDir,"String_Node_Str");
  URL url=getLoader().getResource(resourceInThatDir);
  if (url == null)   throw new NoSuchElementException("String_Node_Str" + resourceInThatDir + "String_Node_Str");
  boolean isJar="String_Node_Str".equals(url.getProtocol());
  if (isJar) {
    try {
      JarURLConnection connection=(JarURLConnection)url.openConnection();
      url=connection.getJarFileURL();
    }
 catch (    IOException e) {
      throw new IllegalStateException(e);
    }
  }
 else {
    String path=url.toString();
    int i=path.indexOf(resourceInThatDir);
    if (i == -1)     throw new IllegalStateException("String_Node_Str" + resourceInThatDir + "String_Node_Str"+ url+ "String_Node_Str");
    String parent=path.substring(0,i);
    try {
      url=new URL(parent);
    }
 catch (    MalformedURLException e) {
      throw new IllegalStateException("String_Node_Str" + resourceInThatDir + "String_Node_Str"+ parent+ "String_Node_Str",e);
    }
  }
  if (!"String_Node_Str".equals(url.getProtocol()))   throw new IllegalStateException("String_Node_Str" + resourceInThatDir + "String_Node_Str"+ url+ "String_Node_Str");
  File file;
  try {
    file=new File(url.toURI());
  }
 catch (  URISyntaxException e) {
    throw new IllegalStateException("String_Node_Str" + resourceInThatDir + "String_Node_Str"+ url+ "String_Node_Str",e);
  }
  if (!file.exists())   throw new IllegalStateException("String_Node_Str" + url + "String_Node_Str");
  return file.getPath();
}

Fixed version (ground truth):
public String getClassLoaderDir(String resourceInThatDir){
  resourceInThatDir=Strings.removeFromStart(resourceInThatDir,"String_Node_Str");
  URL resourceUrl=getLoader().getResource(resourceInThatDir);
  if (resourceUrl == null)   throw new NoSuchElementException("String_Node_Str" + resourceInThatDir + "String_Node_Str");
  URL containerUrl=getContainerUrl(resourceUrl,resourceInThatDir);
  if (!"String_Node_Str".equals(containerUrl.getProtocol()))   throw new IllegalStateException("String_Node_Str" + resourceInThatDir + "String_Node_Str"+ containerUrl+ "String_Node_Str");
  File file;
  try {
    file=new File(containerUrl.toURI());
  }
 catch (  URISyntaxException e) {
    throw new IllegalStateException("String_Node_Str" + resourceInThatDir + "String_Node_Str"+ containerUrl+ "String_Node_Str",e);
  }
  if (!file.exists())   throw new IllegalStateException("String_Node_Str" + containerUrl + "String_Node_Str");
  return file.getPath();
}
Program: 79476
Project: 79476
Buggy source:
/** 
 * creates a task which returns modifies sudoers to ensure non-tty access is permitted; also gives nice warnings if sudo is not permitted 
 */
public static ProcessTaskFactory<Boolean> dontRequireTtyForSudo(SshMachineLocation machine,final boolean requireSuccess){
  final String id=Identifiers.makeRandomId(6);
  return newSshExecTaskFactory(machine,BashCommands.dontRequireTtyForSudo(),BashCommands.sudo("String_Node_Str" + id)).summary("String_Node_Str").configure(SshTool.PROP_ALLOCATE_PTY,true).allowingNonZeroExitCode().returning(new Function<ProcessTaskWrapper<?>,Boolean>(){
    public Boolean apply(    ProcessTaskWrapper<?> task){
      if (task.getExitCode() == 0 && task.getStdout().contains("String_Node_Str" + id))       return true;
      Entity entity=BrooklynTaskTags.getTargetOrContextEntity(Tasks.current());
      log.warn("String_Node_Str" + task.getMachine().getUser() + "String_Node_Str"+ task.getMachine().getAddress().getHostName()+ "String_Node_Str"+ "String_Node_Str"+ task.getExitCode()+ (entity != null ? "String_Node_Str" + entity : "String_Node_Str")+ "String_Node_Str");
      Streams.logStreamTail(log,"String_Node_Str",Streams.byteArrayOfString(task.getStderr()),1024);
      if (requireSuccess) {
        throw new IllegalStateException("String_Node_Str" + task.getMachine().getUser() + "String_Node_Str"+ task.getMachine().getAddress().getHostName()+ (entity != null ? "String_Node_Str" + entity + "String_Node_Str" : "String_Node_Str"));
      }
      return true;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * creates a task which returns modifies sudoers to ensure non-tty access is permitted; also gives nice warnings if sudo is not permitted 
 */
public static ProcessTaskFactory<Boolean> dontRequireTtyForSudo(SshMachineLocation machine,final boolean requireSuccess){
  final String id=Identifiers.makeRandomId(6);
  return newSshExecTaskFactory(machine,BashCommands.dontRequireTtyForSudo(),BashCommands.sudo("String_Node_Str" + id)).summary("String_Node_Str").configure(SshTool.PROP_ALLOCATE_PTY,true).allowingNonZeroExitCode().returning(new Function<ProcessTaskWrapper<?>,Boolean>(){
    public Boolean apply(    ProcessTaskWrapper<?> task){
      if (task.getExitCode() == 0 && task.getStdout().contains("String_Node_Str" + id))       return true;
      Entity entity=BrooklynTaskTags.getTargetOrContextEntity(Tasks.current());
      String message="String_Node_Str" + task.getMachine().getUser() + "String_Node_Str"+ task.getMachine().getAddress().getHostName()+ "String_Node_Str"+ "String_Node_Str"+ task.getExitCode()+ (entity != null ? "String_Node_Str" + entity : "String_Node_Str")+ "String_Node_Str";
      DynamicTasks.queueIfPossible(Tasks.warning(message,null));
      Streams.logStreamTail(log,"String_Node_Str",Streams.byteArrayOfString(task.getStderr()),1024);
      if (requireSuccess) {
        throw new IllegalStateException("String_Node_Str" + task.getMachine().getUser() + "String_Node_Str"+ task.getMachine().getAddress().getHostName()+ (entity != null ? "String_Node_Str" + entity + "String_Node_Str" : "String_Node_Str"));
      }
      return true;
    }
  }
);
}
Program: 79477
Project: 79477
Buggy source:
/** 
 * Runs a script and returns the result code, supporting flags including: out, err as output/error streams; logPrefix, prefix string to put in log output; env, map of environment vars to pass to shell environment 
 */
int execute(Map flags,List<String> script,String summaryForLogging);

Fixed version (ground truth):
/** 
 * Runs a script and returns the result code, supporting flags including: out, err as output/error streams; logPrefix, prefix string to put in log output; env, map of environment vars to pass to shell environment 
 */
@SuppressWarnings("String_Node_Str") int execute(Map flags,List<String> script,String summaryForLogging);
Program: 79478
Project: 79478
Buggy source:
public int executeInternal(){
  if (!executionCheck.apply(this)) {
    return 0;
  }
  List<String> lines=getLines();
  if (log.isTraceEnabled())   log.trace("String_Node_Str",summary,lines);
  int result;
  try {
    mutexAcquire.run();
    Map flags=getFlags();
    if (closeSshConnection) {
      flags.put("String_Node_Str",true);
    }
    if (gatherOutput) {
      if (stdout == null)       stdout=new ByteArrayOutputStream();
      if (stderr == null)       stderr=new ByteArrayOutputStream();
      flags.put("String_Node_Str",stdout);
      flags.put("String_Node_Str",stderr);
    }
    result=runner.execute(flags,lines,summary);
  }
 catch (  RuntimeInterruptedException e) {
    throw logWithDetailsAndThrow(format("String_Node_Str",summary,e.getMessage()),e);
  }
catch (  Exception e) {
    throw logWithDetailsAndThrow(format("String_Node_Str",summary,e.getMessage()),e);
  }
 finally {
    mutexRelease.run();
  }
  if (log.isTraceEnabled())   log.trace("String_Node_Str",summary,result);
  if (!resultCodeCheck.apply(result)) {
    throw logWithDetailsAndThrow(format("String_Node_Str",result,summary),null);
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public int executeInternal(){
  if (!executionCheck.apply(this)) {
    return 0;
  }
  List<String> lines=getLines();
  if (log.isTraceEnabled())   log.trace("String_Node_Str",summary,lines);
  int result;
  try {
    mutexAcquire.run();
    Map flags=getFlags();
    if (closeSshConnection) {
      flags.put("String_Node_Str",true);
    }
    if (gatherOutput) {
      if (stdout == null)       stdout=new ByteArrayOutputStream();
      if (stderr == null)       stderr=new ByteArrayOutputStream();
      flags.put("String_Node_Str",stdout);
      flags.put("String_Node_Str",stderr);
    }
    result=runner.execute(flags,lines,summary);
  }
 catch (  RuntimeInterruptedException e) {
    throw logWithDetailsAndThrow(format("String_Node_Str",summary,e.getMessage()),e);
  }
catch (  Exception e) {
    throw logWithDetailsAndThrow(format("String_Node_Str",summary,e.getMessage()),e);
  }
 finally {
    mutexRelease.run();
  }
  if (log.isTraceEnabled())   log.trace("String_Node_Str",summary,result);
  if (!resultCodeCheck.apply(result)) {
    throw logWithDetailsAndThrow(format("String_Node_Str",result,summary),null);
  }
  return result;
}
Program: 79479
Project: 79479
Buggy source:
public Map getFlags(){
  return flags;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Map getFlags(){
  return flags;
}
Program: 79480
Project: 79480
Buggy source:
@Override public void redeployAll(){
  Map<String,String> wars=MutableMap.copyOf(getConfig(WARS_BY_CONTEXT));
  String redeployPrefix="String_Node_Str" + wars.size() + "String_Node_Str";
  log.debug("String_Node_Str" + this + "String_Node_Str"+ getConfig(WARS_BY_CONTEXT));
  Iterable<CanDeployAndUndeploy> targets=Iterables.filter(getChildren(),CanDeployAndUndeploy.class);
  TaskBuilder<Void> tb=Tasks.<Void>builder().parallel(true).name(redeployPrefix + "String_Node_Str" + Iterables.size(targets)+ "String_Node_Str");
  for (  Entity target : targets) {
    TaskBuilder<Void> redeployAllToTarget=Tasks.<Void>builder().name(redeployPrefix + "String_Node_Str" + target+ "String_Node_Str");
    for (    String targetName : wars.keySet()) {
      redeployAllToTarget.add(Effectors.invocation(target,DEPLOY,MutableMap.of("String_Node_Str",wars.get(targetName),"String_Node_Str",targetName)));
    }
    tb.add(redeployAllToTarget.build());
  }
  DynamicTasks.queueIfPossible(tb.build()).orSubmitAsync(this).asTask().getUnchecked();
}

Fixed version (ground truth):
@Override public void redeployAll(){
  Map<String,String> wars=MutableMap.copyOf(getConfig(WARS_BY_CONTEXT));
  String redeployPrefix="String_Node_Str" + wars.size() + "String_Node_Str";
  log.debug("String_Node_Str" + this + "String_Node_Str"+ getConfig(WARS_BY_CONTEXT));
  Iterable<CanDeployAndUndeploy> targets=Iterables.filter(getChildren(),CanDeployAndUndeploy.class);
  TaskBuilder<Void> tb=Tasks.<Void>builder().parallel(true).name(redeployPrefix + "String_Node_Str" + Iterables.size(targets)+ "String_Node_Str");
  for (  Entity target : targets) {
    TaskBuilder<Void> redeployAllToTarget=Tasks.<Void>builder().name(redeployPrefix + "String_Node_Str" + target+ "String_Node_Str");
    for (    String targetName : wars.keySet()) {
      redeployAllToTarget.add(Effectors.invocation(target,DEPLOY,MutableMap.of("String_Node_Str",wars.get(targetName),"String_Node_Str",targetName)));
    }
    tb.add(whenServiceUp(target,redeployAllToTarget.build(),redeployPrefix + "String_Node_Str" + target+ "String_Node_Str"));
  }
  DynamicTasks.queueIfPossible(tb.build()).orSubmitAsync(this).asTask().getUnchecked();
}
Program: 79481
Project: 79481
Buggy source:
/** 
 * Clear the registry. 
 */
public static void clearRegistry(){
  RendererHints.registry.clear();
}

Fixed version (ground truth):
/** 
 * Clear the registry.  MUST be used by a single test only. TestNG interleaves the tests (sequentially) which results in tearDown  executing in the middle of another class' tests. Only one tearDown may call this method.
 */
public static void clearRegistry(){
  RendererHints.registry.clear();
}
Program: 79482
Project: 79482
Buggy source:
/** 
 * Sets up the application and entity. <p> Adds a sensor and sets its value to   {@code 12345}. Configures a display value hint that appends   {@code frogs} to the value of the sensor.
 */
@BeforeClass(alwaysRun=true) @Override public void setUp() throws Exception {
  super.setUp();
  ClientResponse deploy=clientDeploy(simpleSpec);
  waitForApplicationToBeRunning(deploy.getLocation());
  entity=(EntityInternal)Iterables.find(getManagementContext().getEntityManager().getEntities(),new Predicate<Entity>(){
    @Override public boolean apply(    @Nullable Entity input){
      return "String_Node_Str".equals(input.getEntityType().getSimpleName());
    }
  }
);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) @Override public void setUp() throws Exception {
  super.setUp();
  ClientResponse deploy=clientDeploy(simpleSpec);
  waitForApplicationToBeRunning(deploy.getLocation());
  entity=(EntityInternal)Iterables.find(getManagementContext().getEntityManager().getEntities(),new Predicate<Entity>(){
    @Override public boolean apply(    @Nullable Entity input){
      return "String_Node_Str".equals(input.getEntityType().getSimpleName());
    }
  }
);
}
Program: 79483
Project: 79483
Buggy source:
@VisibleForTesting public void waitForPendingComplete(Duration duration) throws InterruptedException, TimeoutException ;

Fixed version (ground truth):
/** 
 * waits for any needed or pending writes to complete 
 */
@VisibleForTesting public void waitForPendingComplete(Duration duration) throws InterruptedException, TimeoutException ;
Program: 79484
Project: 79484
Buggy source:
public void start(){
  running=true;
  Callable<Task<?>> taskFactory=new Callable<Task<?>>(){
    @Override public Task<Void> call(){
      return new BasicTask<Void>(new Callable<Void>(){
        public Void call(){
          try {
            persistNow();
            return null;
          }
 catch (          Exception e) {
            LOG.warn("String_Node_Str",e);
            return null;
          }
catch (          Throwable t) {
            LOG.warn("String_Node_Str",t);
            throw Exceptions.propagate(t);
          }
        }
      }
);
    }
  }
;
  scheduledTask=(ScheduledTask)executionManager.submit(new ScheduledTask(taskFactory).period(period));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void start(){
  running=true;
  Callable<Task<?>> taskFactory=new Callable<Task<?>>(){
    @Override public Task<Void> call(){
      return new BasicTask<Void>(new Callable<Void>(){
        public Void call(){
          try {
            persistNow();
            return null;
          }
 catch (          Exception e) {
            LOG.warn("String_Node_Str",e);
            return null;
          }
catch (          Throwable t) {
            LOG.warn("String_Node_Str",t);
            throw Exceptions.propagate(t);
          }
        }
      }
);
    }
  }
;
  scheduledTask=(ScheduledTask)executionManager.submit(new ScheduledTask(taskFactory).period(period));
}
Program: 79487
Project: 79487
Buggy source:
/** 
 * Publishes (via   {@link #persister}) the state of this management node with itself set to master.
 */
protected synchronized void publishDemotionFromMasterOnFailure(){
  checkState(getNodeState() == ManagementNodeState.FAILED,"String_Node_Str",getNodeState());
  if (persister == null) {
    LOG.info("String_Node_Str");
    return;
  }
  ManagementNodeSyncRecord memento=createManagementNodeSyncRecord(false);
  Delta delta=ManagementPlaneSyncRecordDeltaImpl.builder().node(memento).clearMaster(ownNodeId).build();
  persister.delta(delta);
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str",memento);
}

Fixed version (ground truth):
/** 
 * Publishes (via   {@link #persister}) the state of this management node with itself set to master.
 */
protected synchronized void publishDemotionFromMasterOnFailure(){
  checkState(getNodeState() == ManagementNodeState.FAILED,"String_Node_Str",getNodeState());
  publishDemotionFromMaster(true);
}
Program: 79488
Project: 79488
Buggy source:
public void waitForPendingComplete(Duration timeout) throws InterruptedException, TimeoutException {
  throw new IllegalStateException("String_Node_Str" + NonDeploymentManagementContext.this + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void waitForPendingComplete(Duration timeout) throws InterruptedException, TimeoutException {
  throw new IllegalStateException("String_Node_Str" + NonDeploymentManagementContext.this + "String_Node_Str");
}
Program: 79489
Project: 79489
Buggy source:
public InMemoryObjectStore(Map<String,String> map,Map<String,Date> fileModTimesByName){
  filesByName=map;
  this.fileModTimesByName=fileModTimesByName;
  log.info("String_Node_Str");
}

Fixed version (ground truth):
public InMemoryObjectStore(Map<String,String> map,Map<String,Date> fileModTimesByName){
  filesByName=map;
  this.fileModTimesByName=fileModTimesByName;
  log.debug("String_Node_Str");
}
Program: 79490
Project: 79490
Buggy source:
/** 
 * returns a (mutable) map of the standard flags which should be placed on an effector 
 */
public static Map<Object,Object> getTaskFlagsForEffectorInvocation(Entity entity,Effector<?> effector){
  return MutableMap.builder().put("String_Node_Str","String_Node_Str" + effector.getName() + "String_Node_Str"+ entity.getDisplayName()).put("String_Node_Str",effector.getName()).put("String_Node_Str",MutableList.of(ManagementContextInternal.EFFECTOR_TAG,BrooklynTaskTags.tagForTargetEntity(entity))).build();
}

Fixed version (ground truth):
/** 
 * returns a (mutable) map of the standard flags which should be placed on an effector 
 */
public static Map<Object,Object> getTaskFlagsForEffectorInvocation(Entity entity,Effector<?> effector){
  return MutableMap.builder().put("String_Node_Str","String_Node_Str" + effector.getName() + "String_Node_Str"+ entity.getDisplayName()).put("String_Node_Str",effector.getName()).put("String_Node_Str",MutableList.of(BrooklynTaskTags.EFFECTOR_TAG,BrooklynTaskTags.tagForEffectorName(effector.getName()),BrooklynTaskTags.tagForTargetEntity(entity))).build();
}
Program: 79491
Project: 79491
Buggy source:
public synchronized BlobStoreContext getBlobStoreContext(){
  if (context == null) {
    if (location == null) {
      Preconditions.checkNotNull(locationSpec,"String_Node_Str");
      Preconditions.checkNotNull(mgmt,"String_Node_Str");
      location=(JcloudsLocation)mgmt.getLocationRegistry().resolve(locationSpec);
    }
    String identity=checkNotNull(location.getConfig(LocationConfigKeys.ACCESS_IDENTITY),"String_Node_Str");
    String credential=checkNotNull(location.getConfig(LocationConfigKeys.ACCESS_CREDENTIAL),"String_Node_Str");
    String provider=checkNotNull(location.getConfig(LocationConfigKeys.CLOUD_PROVIDER),"String_Node_Str");
    String endpoint=location.getConfig(CloudLocationConfig.CLOUD_ENDPOINT);
    ContextBuilder contextBuilder=ContextBuilder.newBuilder(provider).credentials(identity,credential);
    if (!Strings.isBlank(endpoint)) {
      contextBuilder.endpoint(endpoint);
    }
    context=contextBuilder.buildView(BlobStoreContext.class);
    context.getBlobStore().createContainerInLocation(null,getContainerName());
  }
  return context;
}

Fixed version (ground truth):
public synchronized BlobStoreContext getBlobStoreContext(){
  if (context == null) {
    if (location == null) {
      Preconditions.checkNotNull(locationSpec,"String_Node_Str");
      Preconditions.checkNotNull(mgmt,"String_Node_Str");
      location=(JcloudsLocation)mgmt.getLocationRegistry().resolve(locationSpec);
    }
    String identity=checkNotNull(location.getConfig(LocationConfigKeys.ACCESS_IDENTITY),"String_Node_Str");
    String credential=checkNotNull(location.getConfig(LocationConfigKeys.ACCESS_CREDENTIAL),"String_Node_Str");
    String provider=checkNotNull(location.getConfig(LocationConfigKeys.CLOUD_PROVIDER),"String_Node_Str");
    String endpoint=location.getConfig(CloudLocationConfig.CLOUD_ENDPOINT);
    context=JcloudsUtil.newBlobstoreContext(provider,endpoint,identity,credential,true);
    context.getBlobStore().createContainerInLocation(null,getContainerName());
  }
  return context;
}
Program: 79494
Project: 79494
Buggy source:
@Override public Map<String,String> getShellEnvironment(){
  return MutableMap.<String,String>builder().putAll(super.getShellEnvironment()).put("String_Node_Str",Os.mergePathsUnix(getRunDir(),"String_Node_Str")).renameKey("String_Node_Str","String_Node_Str").build();
}

Fixed version (ground truth):
@Override public Map<String,String> getShellEnvironment(){
  return MutableMap.<String,String>builder().putAll(super.getShellEnvironment()).put("String_Node_Str",getRunDir()).put("String_Node_Str",Os.mergePathsUnix(getRunDir(),"String_Node_Str")).renameKey("String_Node_Str","String_Node_Str").build();
}
Program: 79495
Project: 79495
Buggy source:
@Override public void launch(){
  Map ports=MutableMap.of("String_Node_Str",getHttpPort(),"String_Node_Str",getJmxPort(),"String_Node_Str",getRmiRegistryPort());
  Networking.checkPortsValid(ports);
  newScript(MutableMap.of(USE_PID_FILE,false),LAUNCHING).body.append("String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + getLogFileLocation() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str").execute();
  log.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void launch(){
  Map ports=MutableMap.of("String_Node_Str",getHttpPort(),"String_Node_Str",getJmxPort(),"String_Node_Str",getRmiRegistryPort());
  Networking.checkPortsValid(ports);
  newScript(MutableMap.of(USE_PID_FILE,false),LAUNCHING).body.append("String_Node_Str" + (Strings.isEmpty(getConfigXmlTemplateUrl()) ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str","String_Node_Str" + "String_Node_Str" + getLogFileLocation() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str").execute();
  log.debug("String_Node_Str");
}
Program: 79496
Project: 79496
Buggy source:
@Override public void customize(){
  newScript(CUSTOMIZING).body.append("String_Node_Str",format("String_Node_Str",getExpandedInstallDir()),format("String_Node_Str",getExpandedInstallDir())).execute();
  String destinationBrooklynConfig=Os.mergePathsUnix(getRunDir(),"String_Node_Str");
  copyTemplate("String_Node_Str",destinationBrooklynConfig);
  String customConfigTemplateUrl=getConfigXmlTemplateUrl();
  if (customConfigTemplateUrl != null) {
    String destinationConfigFile=Os.mergePathsUnix(getRunDir(),"String_Node_Str");
    copyTemplate(customConfigTemplateUrl,destinationConfigFile);
  }
  getEntity().deployInitialWars();
}

Fixed version (ground truth):
@Override public void customize(){
  newScript(CUSTOMIZING).body.append("String_Node_Str",format("String_Node_Str",getExpandedInstallDir()),format("String_Node_Str",getExpandedInstallDir())).execute();
  String destinationBrooklynConfig=Os.mergePathsUnix(getRunDir(),"String_Node_Str");
  copyTemplate("String_Node_Str",destinationBrooklynConfig);
  String customConfigTemplateUrl=getConfigXmlTemplateUrl();
  if (Strings.isNonEmpty(customConfigTemplateUrl)) {
    String destinationConfigFile=Os.mergePathsUnix(getRunDir(),"String_Node_Str");
    copyTemplate(customConfigTemplateUrl,destinationConfigFile);
  }
  getEntity().deployInitialWars();
}
Program: 79498
Project: 79498
Buggy source:
@Test public void testAggregatingExcludingBlankString(){
  group.addMember(entity);
  group.addMember(entity2);
  group.addEnricher(Enrichers.builder().aggregating(STR1).publishing(SET1).fromMembers().excludingBlank().computing(new Function<Collection<?>,Set<Object>>(){
    @Override public Set<Object> apply(    Collection<?> input){
      return (input == null) ? ImmutableSet.<Object>of() : MutableSet.<Object>copyOf(input);
    }
  }
).build());
  entity.setAttribute(STR1,"String_Node_Str");
  entity2.setAttribute(STR1,"String_Node_Str");
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of("String_Node_Str","String_Node_Str"));
  entity.setAttribute(STR1,"String_Node_Str");
  entity2.setAttribute(STR1,null);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of("String_Node_Str"));
  entity.setAttribute(STR1,"String_Node_Str");
  entity2.setAttribute(STR1,"String_Node_Str");
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testAggregatingExcludingBlankString(){
  group.addMember(entity);
  group.addMember(entity2);
  group.addEnricher(Enrichers.builder().aggregating(STR1).publishing(SET1).fromMembers().excludingBlank().computing((Function)new Function<Collection<?>,Set<Object>>(){
    @Override public Set<Object> apply(    Collection<?> input){
      return (input == null) ? ImmutableSet.<Object>of() : MutableSet.<Object>copyOf(input);
    }
  }
).build());
  entity.setAttribute(STR1,"String_Node_Str");
  entity2.setAttribute(STR1,"String_Node_Str");
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of("String_Node_Str","String_Node_Str"));
  entity.setAttribute(STR1,"String_Node_Str");
  entity2.setAttribute(STR1,null);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of("String_Node_Str"));
  entity.setAttribute(STR1,"String_Node_Str");
  entity2.setAttribute(STR1,"String_Node_Str");
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of("String_Node_Str"));
}
Program: 79499
Project: 79499
Buggy source:
@Test public void testAggregatingExcludingNull(){
  group.addMember(entity);
  group.addEnricher(Enrichers.builder().aggregating(NUM1).publishing(SET1).fromMembers().excludingBlank().computing(new Function<Collection<?>,Set<Object>>(){
    @Override public Set<Object> apply(    Collection<?> input){
      return (input == null) ? ImmutableSet.<Object>of() : MutableSet.<Object>copyOf(input);
    }
  }
).build());
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of());
  entity.setAttribute(NUM1,1);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of(1));
  entity.setAttribute(NUM1,null);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of());
  entity.setAttribute(NUM1,2);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of(2));
}

Fixed version (ground truth):
@Test public void testAggregatingExcludingNull(){
  group.addMember(entity);
  group.addEnricher(Enrichers.builder().aggregating(NUM1).publishing(SET1).fromMembers().excludingBlank().computing((Function)new Function<Collection<?>,Set<Object>>(){
    @Override public Set<Object> apply(    Collection<?> input){
      return (input == null) ? ImmutableSet.<Object>of() : MutableSet.<Object>copyOf(input);
    }
  }
).build());
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of());
  entity.setAttribute(NUM1,1);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of(1));
  entity.setAttribute(NUM1,null);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of());
  entity.setAttribute(NUM1,2);
  EntityTestUtils.assertAttributeEqualsEventually(group,SET1,ImmutableSet.<Object>of(2));
}
Program: 79501
Project: 79501
Buggy source:
@Test(groups="String_Node_Str",dependsOnMethods={"String_Node_Str","String_Node_Str"}) public void testTriggerRedisStopEffector() throws Exception {
  String entityId=getManagementContext().getApplications().iterator().next().getChildren().iterator().next().getId();
  Response response=api.getEffectorApi().invoke("String_Node_Str",entityId,"String_Node_Str","String_Node_Str",ImmutableMap.<String,String>of());
  assertEquals(response.getStatus(),Response.Status.ACCEPTED.getStatusCode());
  while (!api.getSensorApi().get("String_Node_Str",entityId,"String_Node_Str").equals(Lifecycle.STOPPED.toString())) {
    Thread.sleep(5000);
  }
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",dependsOnMethods={"String_Node_Str","String_Node_Str"}) public void testTriggerRedisStopEffector() throws Exception {
  String entityId=getManagementContext().getApplications().iterator().next().getChildren().iterator().next().getId();
  Response response=api.getEffectorApi().invoke("String_Node_Str",entityId,"String_Node_Str","String_Node_Str",ImmutableMap.<String,String>of());
  assertEquals(response.getStatus(),Response.Status.ACCEPTED.getStatusCode());
  while (!api.getSensorApi().get("String_Node_Str",entityId,"String_Node_Str",false).equals(Lifecycle.STOPPED.toString())) {
    Thread.sleep(5000);
  }
}
Program: 79502
Project: 79502
Buggy source:
@Test(groups="String_Node_Str",dependsOnMethods="String_Node_Str") public void testDeployLegacyRedisApplication() throws Exception {
  @SuppressWarnings("String_Node_Str") Response response=api.getApplicationApi().create(legacyRedisSpec);
  assertEquals(response.getStatus(),201);
  assertEquals(getManagementContext().getApplications().size(),2);
  while (!api.getSensorApi().get("String_Node_Str","String_Node_Str","String_Node_Str").equals(Lifecycle.RUNNING.toString())) {
    Thread.sleep(100);
  }
  Response deleteResponse=api.getApplicationApi().delete("String_Node_Str");
  assertEquals(deleteResponse.getStatus(),202);
  assertEquals(getManagementContext().getApplications().size(),1);
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",dependsOnMethods="String_Node_Str") public void testDeployLegacyRedisApplication() throws Exception {
  @SuppressWarnings("String_Node_Str") Response response=api.getApplicationApi().create(legacyRedisSpec);
  assertEquals(response.getStatus(),201);
  assertEquals(getManagementContext().getApplications().size(),2);
  while (!api.getSensorApi().get("String_Node_Str","String_Node_Str","String_Node_Str",false).equals(Lifecycle.RUNNING.toString())) {
    Thread.sleep(100);
  }
  Response deleteResponse=api.getApplicationApi().delete("String_Node_Str");
  assertEquals(deleteResponse.getStatus(),202);
  assertEquals(getManagementContext().getApplications().size(),1);
}
Program: 79503
Project: 79503
Buggy source:
@Test(groups="String_Node_Str") public void testDeployRedisApplication() throws Exception {
  Response response=api.getApplicationApi().createPoly(redisSpec.getBytes());
  assertEquals(response.getStatus(),201);
  assertEquals(getManagementContext().getApplications().size(),1);
  String entityId=getManagementContext().getApplications().iterator().next().getChildren().iterator().next().getId();
  while (!api.getSensorApi().get("String_Node_Str",entityId,"String_Node_Str").equals(Lifecycle.RUNNING.toString())) {
    Thread.sleep(100);
  }
}

Fixed version (ground truth):
@Test(groups="String_Node_Str") public void testDeployRedisApplication() throws Exception {
  Response response=api.getApplicationApi().createPoly(redisSpec.getBytes());
  assertEquals(response.getStatus(),201);
  assertEquals(getManagementContext().getApplications().size(),1);
  String entityId=getManagementContext().getApplications().iterator().next().getChildren().iterator().next().getId();
  while (!api.getSensorApi().get("String_Node_Str",entityId,"String_Node_Str",false).equals(Lifecycle.RUNNING.toString())) {
    Thread.sleep(100);
  }
}
Program: 79504
Project: 79504
Buggy source:
protected CloudMachineNamer getCloudMachineNamer(ConfigBag config){
  String namerClass=config.get(LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS);
  if (Strings.isNonBlank(namerClass)) {
    Optional<CloudMachineNamer> cloudNamer=Reflections.invokeConstructorWithArgs(getManagementContext().getCatalog().getRootClassLoader(),namerClass,config);
    if (cloudNamer.isPresent()) {
      return cloudNamer.get();
    }
 else {
      throw new IllegalStateException("String_Node_Str" + namerClass);
    }
  }
 else {
    return new JcloudsMachineNamer(config);
  }
}

Fixed version (ground truth):
protected CloudMachineNamer getCloudMachineNamer(ConfigBag config){
  String namerClass=config.get(LocationConfigKeys.CLOUD_MACHINE_NAMER_CLASS);
  if (Strings.isNonBlank(namerClass)) {
    Optional<CloudMachineNamer> cloudNamer=Reflections.invokeConstructorWithArgs(getManagementContext().getCatalog().getRootClassLoader(),namerClass,config);
    if (cloudNamer.isPresent()) {
      return cloudNamer.get();
    }
 else {
      throw new IllegalStateException("String_Node_Str" + namerClass + "String_Node_Str"+ this);
    }
  }
 else {
    return new JcloudsMachineNamer(config);
  }
}