nus-yam/ex-repair huggingface dataset:
Program: 79505
Project: 79505
Buggy source:
@Override public void joinCluster(@EffectorParam(name="String_Node_Str") RiakNode node){
  getDriver().joinCluster(node);
}

Fixed version (ground truth):
@Override public void joinCluster(RiakNode node){
  getDriver().joinCluster(node);
}
Program: 79506
Project: 79506
Buggy source:
@Override public void joinCluster(RiakNode node){
  if (!isInCluster()) {
    String riakName=node.getAttribute(RiakNode.RIAK_NODE_NAME);
    newScript("String_Node_Str").body.append(format("String_Node_Str",getRiakAdminCmd(),riakName)).body.append(format("String_Node_Str",getRiakAdminCmd())).body.append(format("String_Node_Str",getRiakAdminCmd())).failOnNonZeroResultCode().execute();
    entity.setAttribute(RiakNode.RIAK_NODE_IN_CLUSTER,Boolean.TRUE);
  }
 else {
    log.warn("String_Node_Str",entity.getId());
  }
}

Fixed version (ground truth):
@Override public void joinCluster(RiakNode node){
  if (!isInCluster()) {
    String riakName=node.getAttribute(RiakNode.RIAK_NODE_NAME);
    ScriptHelper joinClusterScript=newScript("String_Node_Str").body.append(format("String_Node_Str",getRiakAdminCmd(),riakName)).body.append(format("String_Node_Str",getRiakAdminCmd())).body.append(format("String_Node_Str",getRiakAdminCmd())).failOnNonZeroResultCode();
    if (!isRiakOnPath) {
      Map<String,String> newPathVariable=ImmutableMap.of("String_Node_Str",sbinPath);
      log.warn("String_Node_Str",getShellEnvironment(),newPathVariable);
      joinClusterScript.environmentVariablesReset(newPathVariable);
    }
    joinClusterScript.execute();
    entity.setAttribute(RiakNode.RIAK_NODE_IN_CLUSTER,Boolean.TRUE);
  }
 else {
    log.warn("String_Node_Str",entity.getId());
  }
}
Program: 79507
Project: 79507
Buggy source:
private Boolean isInCluster(){
  Optional<Boolean> inCluster=Optional.of(entity.getAttribute(RiakNode.RIAK_NODE_IN_CLUSTER));
  if (inCluster.isPresent())   return inCluster.get();
 else   return Boolean.FALSE;
}

Fixed version (ground truth):
private Boolean isInCluster(){
  return Optional.fromNullable(entity.getAttribute(RiakNode.RIAK_NODE_IN_CLUSTER)).or(Boolean.FALSE);
}
Program: 79508
Project: 79508
Buggy source:
@Override public void launch(){
  newScript(LAUNCHING).failOnNonZeroResultCode().body.append(format("String_Node_Str",getRiakCmd())).execute();
}

Fixed version (ground truth):
@Override public void launch(){
  String command=format("String_Node_Str",getRiakCmd());
  command=isPackageInstall ? "String_Node_Str" + command : command;
  ScriptHelper launchScript=newScript(LAUNCHING).failOnNonZeroResultCode().body.append(command);
  if (!isRiakOnPath) {
    Map<String,String> newPathVariable=ImmutableMap.of("String_Node_Str",sbinPath);
    log.warn("String_Node_Str",getShellEnvironment(),newPathVariable);
    launchScript.environmentVariablesReset(newPathVariable);
  }
  launchScript.execute();
}
Program: 79509
Project: 79509
Buggy source:
@Override public void customize(){
  OsDetails osDetails=getMachine().getMachineDetails().getOsDetails();
  List<String> commands=Lists.newLinkedList();
  String vmArgsTemplate=processTemplate(entity.getConfig(RiakNode.RIAK_VM_ARGS_TEMPLATE_URL));
  DynamicTasks.queueIfPossible(newScript(CUSTOMIZING).body.append("String_Node_Str").newTask());
  DynamicTasks.queueIfPossible(SshEffectorTasks.put(getRunDir() + "String_Node_Str").contents(Streams.newInputStreamWithContents(vmArgsTemplate)).machine(getMachine()).summary("String_Node_Str"));
  commands.add(sudo("String_Node_Str" + getRunDir() + "String_Node_Str"));
  commands.add(sudo("String_Node_Str" + getRunDir() + "String_Node_Str"+ getEtcDir()));
  commands.add(sudo(format("String_Node_Str",getPrivateIp(),getAppConfigLocation())));
  if (osDetails.isMac())   commands.add("String_Node_Str");
  DynamicTasks.queueIfPossible(newScript(CUSTOMIZING).failOnNonZeroResultCode().body.append(commands).newTask());
  entity.setAttribute(RiakNode.RIAK_NODE_NAME,format("String_Node_Str",getHostname()));
}

Fixed version (ground truth):
@Override public void customize(){
  isRiakOnPath=isPackageInstall ? isRiakOnPath() : true;
  OsDetails osDetails=getMachine().getMachineDetails().getOsDetails();
  List<String> commands=Lists.newLinkedList();
  String vmArgsTemplate=processTemplate(entity.getConfig(RiakNode.RIAK_VM_ARGS_TEMPLATE_URL));
  DynamicTasks.queueIfPossible(newScript(CUSTOMIZING).body.append("String_Node_Str").newTask());
  DynamicTasks.queueIfPossible(SshEffectorTasks.put(getRunDir() + "String_Node_Str").contents(Streams.newInputStreamWithContents(vmArgsTemplate)).machine(getMachine()).summary("String_Node_Str"));
  if (osDetails.isMac())   commands.add("String_Node_Str");
 else   if (osDetails.isLinux()) {
    commands.add(sudo("String_Node_Str" + getRunDir() + "String_Node_Str"));
  }
  commands.add(sudo("String_Node_Str" + getRunDir() + "String_Node_Str"+ getEtcDir()));
  commands.add(sudo(format("String_Node_Str",getPrivateIp(),getAppConfigLocation())));
  ScriptHelper customizeScript=newScript(CUSTOMIZING).failOnNonZeroResultCode().body.append(commands);
  if (!isRiakOnPath) {
    Map<String,String> newPathVariable=ImmutableMap.of("String_Node_Str",sbinPath);
    log.warn("String_Node_Str",getShellEnvironment(),newPathVariable);
    customizeScript.environmentVariablesReset(newPathVariable);
  }
  customizeScript.execute();
  entity.setAttribute(RiakNode.RIAK_NODE_NAME,format("String_Node_Str",getHostname()));
}
Program: 79510
Project: 79510
Buggy source:
private String getPrivateIp(){
  Optional<String> subnetAddress=Optional.of(entity.getAttribute(Attributes.SUBNET_ADDRESS));
  if (subnetAddress.isPresent())   return subnetAddress.get();
 else   throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
private String getPrivateIp(){
  Optional<String> subnetAddress=Optional.fromNullable(entity.getAttribute(Attributes.SUBNET_ADDRESS));
  if (subnetAddress.isPresent())   return subnetAddress.get();
 else   throw new IllegalArgumentException("String_Node_Str");
}
Program: 79511
Project: 79511
Buggy source:
@Override public void stop(){
  newScript(STOPPING).failOnNonZeroResultCode().body.append(sudo(format("String_Node_Str",getRiakCmd()))).execute();
}

Fixed version (ground truth):
@Override public void stop(){
  leaveCluster();
  String command=format("String_Node_Str",getRiakCmd());
  command=isPackageInstall ? "String_Node_Str" + command : command;
  ScriptHelper stopScript=newScript(STOPPING).failOnNonZeroResultCode().body.append(command);
  if (!isRiakOnPath) {
    Map<String,String> newPathVariable=ImmutableMap.of("String_Node_Str",sbinPath);
    log.warn("String_Node_Str",getShellEnvironment(),newPathVariable);
    stopScript.environmentVariablesReset(newPathVariable);
  }
  stopScript.execute();
}
Program: 79512
Project: 79512
Buggy source:
@Override public boolean isRunning(){
  return newScript(CHECK_RUNNING).body.append(sudo(format("String_Node_Str",getRiakAdminCmd()))).execute() == 0;
}

Fixed version (ground truth):
@Override public boolean isRunning(){
  ScriptHelper checkRunningScript=newScript(CHECK_RUNNING).body.append(format("String_Node_Str",getRiakCmd()));
  if (!isRiakOnPath) {
    Map<String,String> newPathVariable=ImmutableMap.of("String_Node_Str",sbinPath);
    log.warn("String_Node_Str",getShellEnvironment(),newPathVariable);
    checkRunningScript.environmentVariablesReset(newPathVariable);
  }
  return (checkRunningScript.execute() == 0);
}
Program: 79513
Project: 79513
Buggy source:
@Override public void leaveCluster(){
  if (isInCluster()) {
    newScript("String_Node_Str").body.append(format("String_Node_Str")).body.append(format("String_Node_Str",getRiakAdminCmd())).body.append(format("String_Node_Str",getRiakAdminCmd())).failOnNonZeroResultCode().execute();
    entity.setAttribute(RiakNode.RIAK_NODE_IN_CLUSTER,Boolean.FALSE);
  }
 else {
    log.warn("String_Node_Str",entity.getId());
  }
}

Fixed version (ground truth):
@Override public void leaveCluster(){
  if (isInCluster()) {
    ScriptHelper leaveClusterScript=newScript("String_Node_Str").body.append(format("String_Node_Str")).body.append(format("String_Node_Str",getRiakAdminCmd())).body.append(format("String_Node_Str",getRiakAdminCmd())).failOnNonZeroResultCode();
    if (!isRiakOnPath) {
      Map<String,String> newPathVariable=ImmutableMap.of("String_Node_Str",sbinPath);
      log.warn("String_Node_Str",getShellEnvironment(),newPathVariable);
      leaveClusterScript.environmentVariablesReset(newPathVariable);
    }
    leaveClusterScript.execute();
    entity.setAttribute(RiakNode.RIAK_NODE_IN_CLUSTER,Boolean.FALSE);
  }
 else {
    log.warn("String_Node_Str",entity.getId());
  }
}
Program: 79514
Project: 79514
Buggy source:
private List<String> installLinux(String expandedInstallDir){
  LOG.info("String_Node_Str",getEntity().getConfig(RiakNode.SUGGESTED_VERSION));
  isPackageInstall=true;
  String installBin=Urls.mergePaths(expandedInstallDir,"String_Node_Str");
  String apt=chainGroup("String_Node_Str","String_Node_Str" + sudo("String_Node_Str"),sudo("String_Node_Str"),sudo("String_Node_Str"),sudo("String_Node_Str" + getEntity().getConfig(RiakNode.SUGGESTED_VERSION) + "String_Node_Str"));
  String yum=chainGroup("String_Node_Str",sudo("String_Node_Str"),sudo("String_Node_Str" + getEntity().getConfig(RiakNode.SUGGESTED_VERSION) + "String_Node_Str"));
  return ImmutableList.<String>builder().add("String_Node_Str" + installBin).add(INSTALL_CURL).add(alternatives(apt,yum)).add("String_Node_Str" + Urls.mergePaths(installBin,"String_Node_Str")).add("String_Node_Str" + Urls.mergePaths(installBin,"String_Node_Str")).build();
}

Fixed version (ground truth):
private List<String> installLinux(String expandedInstallDir){
  LOG.info("String_Node_Str",getEntity().getConfig(RiakNode.SUGGESTED_VERSION));
  isPackageInstall=true;
  String installBin=Urls.mergePaths(expandedInstallDir,"String_Node_Str");
  String apt=chainGroup("String_Node_Str","String_Node_Str","String_Node_Str" + sudo("String_Node_Str"),sudo("String_Node_Str"),sudo("String_Node_Str"),sudo("String_Node_Str" + getEntity().getConfig(RiakNode.SUGGESTED_VERSION) + "String_Node_Str"));
  String yum=chainGroup("String_Node_Str",sudo("String_Node_Str"),sudo("String_Node_Str" + getEntity().getConfig(RiakNode.SUGGESTED_VERSION) + "String_Node_Str"));
  return ImmutableList.<String>builder().add("String_Node_Str" + installBin).add(INSTALL_CURL).add(alternatives(apt,yum)).add("String_Node_Str" + Urls.mergePaths(installBin,"String_Node_Str")).add("String_Node_Str" + Urls.mergePaths(installBin,"String_Node_Str")).build();
}
Program: 79515
Project: 79515
Buggy source:
private static String sudoNew(String command){
  if (command == null)   return null;
  return "String_Node_Str" + command + "String_Node_Str"+ BashStringEscapes.wrapBash(command)+ "String_Node_Str";
}

Fixed version (ground truth):
private static String sudoNew(String command){
  if (command == null)   return null;
  return "String_Node_Str" + command + "String_Node_Str"+ "String_Node_Str"+ BashStringEscapes.wrapBash(command)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}
Program: 79516
Project: 79516
Buggy source:
@Override public void reloadBrooklynProperties(){
  log.info("String_Node_Str" + builder);
  BrooklynProperties properties=builder.build();
  configMap=properties;
  if (brooklynAdditionalProperties != null) {
    log.info("String_Node_Str" + brooklynAdditionalProperties);
    configMap.addFromMap(brooklynAdditionalProperties);
  }
  this.downloadsManager=BasicDownloadsManager.newDefault(configMap);
  this.locationRegistry=null;
  for (  PropertiesReloadListener listener : reloadListeners) {
    listener.reloaded();
  }
}

Fixed version (ground truth):
@Override public void reloadBrooklynProperties(){
  log.info("String_Node_Str" + builder);
  if (builder.hasDelegateOriginalProperties())   log.warn("String_Node_Str" + this + "String_Node_Str");
  BrooklynProperties properties=builder.build();
  configMap=properties;
  if (brooklynAdditionalProperties != null) {
    log.info("String_Node_Str" + brooklynAdditionalProperties);
    configMap.addFromMap(brooklynAdditionalProperties);
  }
  this.downloadsManager=BasicDownloadsManager.newDefault(configMap);
  this.locationRegistry=null;
  for (  PropertiesReloadListener listener : reloadListeners) {
    listener.reloaded();
  }
}
Program: 79517
Project: 79517
Buggy source:
/** 
 * @see LocationPropertiesFromBrooklynProperties#getLocationProperties(String,String,Map)
 */
public Map<String,Object> getJcloudsProperties(String providerOrApi,String regionName,String namedLocation,Map<String,?> properties){
  if (Strings.isNullOrEmpty(namedLocation) && Strings.isNullOrEmpty(providerOrApi)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ConfigBag jcloudsProperties=ConfigBag.newInstance();
  String provider=getProviderName(providerOrApi,namedLocation,properties);
  jcloudsProperties.put(LocationConfigKeys.CLOUD_PROVIDER,provider);
  jcloudsProperties.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties)));
  jcloudsProperties.putAll(transformDeprecated(getGenericJcloudsSingleWordProperties(providerOrApi,properties)));
  jcloudsProperties.putAll(transformDeprecated(getProviderOrApiJcloudsProperties(providerOrApi,properties)));
  jcloudsProperties.putAll(transformDeprecated(getRegionJcloudsProperties(providerOrApi,regionName,properties)));
  if (!Strings.isNullOrEmpty(namedLocation))   jcloudsProperties.putAll(transformDeprecated(getNamedJcloudsProperties(namedLocation,properties)));
  setLocalTempDir(properties,jcloudsProperties);
  return jcloudsProperties.getAllConfigRaw();
}

Fixed version (ground truth):
/** 
 * @see LocationPropertiesFromBrooklynProperties#getLocationProperties(String,String,Map)
 */
public Map<String,Object> getJcloudsProperties(String providerOrApi,String regionOrEndpoint,String namedLocation,Map<String,?> properties){
  if (Strings.isNullOrEmpty(namedLocation) && Strings.isNullOrEmpty(providerOrApi)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ConfigBag jcloudsProperties=ConfigBag.newInstance();
  String provider=getProviderName(providerOrApi,namedLocation,properties);
  jcloudsProperties.put(LocationConfigKeys.CLOUD_PROVIDER,provider);
  jcloudsProperties.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties)));
  jcloudsProperties.putAll(transformDeprecated(getGenericJcloudsSingleWordProperties(providerOrApi,properties)));
  jcloudsProperties.putAll(transformDeprecated(getProviderOrApiJcloudsProperties(providerOrApi,properties)));
  jcloudsProperties.putAll(transformDeprecated(getRegionJcloudsProperties(providerOrApi,regionOrEndpoint,properties)));
  if (!Strings.isNullOrEmpty(namedLocation))   jcloudsProperties.putAll(transformDeprecated(getNamedJcloudsProperties(namedLocation,properties)));
  setLocalTempDir(properties,jcloudsProperties);
  return jcloudsProperties.getAllConfigRaw();
}
Program: 79519
Project: 79519
Buggy source:
private Map getAllProperties(brooklyn.location.LocationRegistry registry,Map<?,?> properties){
  Map<Object,Object> allProperties=Maps.newHashMap();
  if (registry != null)   allProperties.putAll(registry.getProperties());
  allProperties.putAll(properties);
  return allProperties;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Map getAllProperties(brooklyn.location.LocationRegistry registry,Map<?,?> properties){
  Map<Object,Object> allProperties=Maps.newHashMap();
  if (registry != null)   allProperties.putAll(registry.getProperties());
  allProperties.putAll(properties);
  return allProperties;
}
Program: 79520
Project: 79520
Buggy source:
public String getInstallDir(){
  if (installDir != null)   return installDir;
  String existingVal=getEntity().getAttribute(SoftwareProcess.INSTALL_DIR);
  if (Strings.isNonBlank(existingVal)) {
    installDir=existingVal;
    return installDir;
  }
  setInstallLabel();
  Maybe<Object> minstallDir=getEntity().getConfigRaw(SoftwareProcess.INSTALL_DIR,true);
  if (!minstallDir.isPresent() || minstallDir.get() == null) {
    String installBasedir=((EntityInternal)entity).getManagementContext().getConfig().getFirst("String_Node_Str");
    if (installBasedir != null) {
      log.warn("String_Node_Str" + entity + "String_Node_Str");
      installDir=Os.mergePathsUnix(installBasedir,getEntityVersionLabel() + "String_Node_Str" + entity.getId());
      installDir=Os.tidyPath(installDir);
      getEntity().setAttribute(SoftwareProcess.INSTALL_DIR,installDir);
      return installDir;
    }
  }
  installDir=Os.tidyPath(ConfigToAttributes.apply(getEntity(),SoftwareProcess.INSTALL_DIR));
  entity.setAttribute(SoftwareProcess.INSTALL_DIR,installDir);
  return installDir;
}

Fixed version (ground truth):
public String getInstallDir(){
  if (installDir != null)   return installDir;
  String existingVal=getEntity().getAttribute(SoftwareProcess.INSTALL_DIR);
  if (Strings.isNonBlank(existingVal)) {
    installDir=existingVal;
    return installDir;
  }
  setInstallLabel();
  Maybe<Object> minstallDir=getEntity().getConfigRaw(SoftwareProcess.INSTALL_DIR,true);
  if (!minstallDir.isPresent() || minstallDir.get() == null) {
    String installBasedir=((EntityInternal)entity).getManagementContext().getConfig().getFirst("String_Node_Str");
    if (installBasedir != null) {
      log.warn("String_Node_Str" + entity + "String_Node_Str");
      installDir=Os.mergePathsUnix(installBasedir,getEntityVersionLabel() + "String_Node_Str" + entity.getId());
      installDir=Os.tidyPath(installDir);
      getEntity().setAttribute(SoftwareProcess.INSTALL_DIR,installDir);
      return installDir;
    }
  }
  setInstallDir(Os.tidyPath(ConfigToAttributes.apply(getEntity(),SoftwareProcess.INSTALL_DIR)));
  return installDir;
}
Program: 79521
Project: 79521
Buggy source:
public String getRunDir(){
  if (runDir != null)   return runDir;
  String existingVal=getEntity().getAttribute(SoftwareProcess.RUN_DIR);
  if (Strings.isNonBlank(existingVal)) {
    runDir=existingVal;
    return runDir;
  }
  Maybe<Object> mRunDir=getEntity().getConfigRaw(SoftwareProcess.RUN_DIR,true);
  if (!mRunDir.isPresent() || mRunDir.get() == null) {
    String runBasedir=((EntityInternal)entity).getManagementContext().getConfig().getFirst("String_Node_Str");
    if (runBasedir != null) {
      log.warn("String_Node_Str" + entity + "String_Node_Str");
      runDir=Os.mergePathsUnix(runBasedir,entity.getApplication().getId() + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ getEntityVersionLabel()+ "String_Node_Str"+ entity.getId());
      runDir=Os.tidyPath(runDir);
      getEntity().setAttribute(SoftwareProcess.RUN_DIR,runDir);
      return runDir;
    }
  }
  runDir=Os.tidyPath(ConfigToAttributes.apply(getEntity(),SoftwareProcess.RUN_DIR));
  entity.setAttribute(SoftwareProcess.RUN_DIR,runDir);
  return runDir;
}

Fixed version (ground truth):
public String getRunDir(){
  if (runDir != null)   return runDir;
  String existingVal=getEntity().getAttribute(SoftwareProcess.RUN_DIR);
  if (Strings.isNonBlank(existingVal)) {
    runDir=existingVal;
    return runDir;
  }
  Maybe<Object> mRunDir=getEntity().getConfigRaw(SoftwareProcess.RUN_DIR,true);
  if (!mRunDir.isPresent() || mRunDir.get() == null) {
    String runBasedir=((EntityInternal)entity).getManagementContext().getConfig().getFirst("String_Node_Str");
    if (runBasedir != null) {
      log.warn("String_Node_Str" + entity + "String_Node_Str");
      runDir=Os.mergePathsUnix(runBasedir,entity.getApplication().getId() + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ getEntityVersionLabel()+ "String_Node_Str"+ entity.getId());
      runDir=Os.tidyPath(runDir);
      getEntity().setAttribute(SoftwareProcess.RUN_DIR,runDir);
      return runDir;
    }
  }
  setRunDir(Os.tidyPath(ConfigToAttributes.apply(getEntity(),SoftwareProcess.RUN_DIR)));
  return runDir;
}
Program: 79523
Project: 79523
Buggy source:
public static String render(Object focus){
  if (focus instanceof Map) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    boolean first=true;
    for (    Object entry : ((Map<?,?>)focus).entrySet()) {
      if (!first)       sb.append("String_Node_Str");
 else       first=false;
      sb.append("String_Node_Str");
      sb.append(render(((Map.Entry<?,?>)entry).getKey()));
      sb.append("String_Node_Str");
      sb.append(render(((Map.Entry<?,?>)entry).getValue()));
    }
    sb.append("String_Node_Str");
    return sb.toString();
  }
  if (focus instanceof Collection) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    boolean first=true;
    for (    Object entry : ((Map<?,?>)focus).entrySet()) {
      if (!first)       sb.append("String_Node_Str");
 else       first=false;
      sb.append("String_Node_Str");
      sb.append(render(((Map.Entry<?,?>)entry).getKey()));
      sb.append("String_Node_Str");
      sb.append(render(((Map.Entry<?,?>)entry).getValue()));
    }
    sb.append("String_Node_Str");
    return sb.toString();
  }
  if (focus instanceof String) {
    return JavaStringEscapes.wrapJavaString((String)focus);
  }
  if (focus == null || focus instanceof Number || focus instanceof Boolean)   return "String_Node_Str" + focus;
  return render("String_Node_Str" + focus);
}

Fixed version (ground truth):
public static String render(Object focus){
  if (focus instanceof Map) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    boolean first=true;
    for (    Object entry : ((Map<?,?>)focus).entrySet()) {
      if (!first)       sb.append("String_Node_Str");
 else       first=false;
      sb.append("String_Node_Str");
      sb.append(render(((Map.Entry<?,?>)entry).getKey()));
      sb.append("String_Node_Str");
      sb.append(render(((Map.Entry<?,?>)entry).getValue()));
    }
    sb.append("String_Node_Str");
    return sb.toString();
  }
  if (focus instanceof Collection) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    boolean first=true;
    for (    Object entry : (Collection<?>)focus) {
      if (!first)       sb.append("String_Node_Str");
 else       first=false;
      sb.append(render(entry));
    }
    sb.append("String_Node_Str");
    return sb.toString();
  }
  if (focus instanceof String) {
    return JavaStringEscapes.wrapJavaString((String)focus);
  }
  if (focus == null || focus instanceof Number || focus instanceof Boolean)   return "String_Node_Str" + focus;
  return render("String_Node_Str" + focus);
}
Program: 79524
Project: 79524
Buggy source:
public byte[] getContent(){
synchronized (mutex) {
    if (content == null) {
      InputStream in=null;
      try {
        in=response.getEntity().getContent();
        ByteArrayOutputStream out=new ByteArrayOutputStream();
        ByteStreams.copy(in,out);
        content=out.toByteArray();
      }
 catch (      IOException e) {
        throw Throwables.propagate(e);
      }
 finally {
        Closeables.closeQuietly(in);
      }
    }
  }
  return content;
}

Fixed version (ground truth):
public byte[] getContent(){
synchronized (mutex) {
    if (content == null) {
      InputStream in=null;
      try {
        in=response.getEntity().getContent();
        ByteArrayOutputStream out=new ByteArrayOutputStream();
        ByteStreams.copy(in,out);
        content=out.toByteArray();
      }
 catch (      IOException e) {
        throw Throwables.propagate(e);
      }
 finally {
        Streams.closeQuietly(in);
      }
    }
  }
  return content;
}
Program: 79525
Project: 79525
Buggy source:
protected boolean removeChild(Location child){
  boolean removed;
synchronized (children) {
    removed=children.remove(child);
  }
  if (removed) {
    if (child instanceof Closeable) {
      Closeables.closeQuietly((Closeable)child);
    }
    child.setParent(null);
    if (isManaged()) {
      managementContext.getLocationManager().unmanage(child);
    }
  }
  return removed;
}

Fixed version (ground truth):
protected boolean removeChild(Location child){
  boolean removed;
synchronized (children) {
    removed=children.remove(child);
  }
  if (removed) {
    if (child instanceof Closeable) {
      Streams.closeQuietly((Closeable)child);
    }
    child.setParent(null);
    if (isManaged()) {
      managementContext.getLocationManager().unmanage(child);
    }
  }
  return removed;
}
Program: 79526
Project: 79526
Buggy source:
@Override public void close(){
  for (  MachineProvisioningLocation<?> provisioner : provisioners) {
    if (provisioner instanceof Closeable) {
      Closeables.closeQuietly((Closeable)provisioner);
    }
  }
}

Fixed version (ground truth):
@Override public void close(){
  for (  MachineProvisioningLocation<?> provisioner : provisioners) {
    if (provisioner instanceof Closeable) {
      Streams.closeQuietly((Closeable)provisioner);
    }
  }
}
Program: 79527
Project: 79527
Buggy source:
@Override public void close(){
  for (  T machine : machines) {
    if (machine instanceof Closeable)     Closeables.closeQuietly((Closeable)machine);
  }
}

Fixed version (ground truth):
@Override public void close(){
  for (  T machine : machines) {
    if (machine instanceof Closeable)     Streams.closeQuietly((Closeable)machine);
  }
}
Program: 79528
Project: 79528
Buggy source:
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (feed != null)   feed.stop();
  if (app != null)   Entities.destroyAll(app.getManagementContext());
  if (loc != null)   Closeables.closeQuietly(loc);
}

Fixed version (ground truth):
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (feed != null)   feed.stop();
  if (app != null)   Entities.destroyAll(app.getManagementContext());
  if (loc != null)   Streams.closeQuietly(loc);
}
Program: 79529
Project: 79529
Buggy source:
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (feed != null)   feed.stop();
  if (app != null)   Entities.destroyAll(app.getManagementContext());
  if (loc != null)   Closeables.closeQuietly(loc);
}

Fixed version (ground truth):
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (feed != null)   feed.stop();
  if (app != null)   Entities.destroyAll(app.getManagementContext());
  if (loc != null)   Streams.closeQuietly(loc);
}
Program: 79530
Project: 79530
Buggy source:
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (provisioner != null)   Closeables.closeQuietly(provisioner);
  if (provisioner2 != null)   Closeables.closeQuietly(provisioner2);
}

Fixed version (ground truth):
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (provisioner != null)   Streams.closeQuietly(provisioner);
  if (provisioner2 != null)   Streams.closeQuietly(provisioner2);
}
Program: 79531
Project: 79531
Buggy source:
@AfterMethod(alwaysRun=true) public void afterMethod() throws Exception {
  if (executor != null)   executor.shutdownNow();
  Closeables.closeQuietly(machine);
}

Fixed version (ground truth):
@AfterMethod(alwaysRun=true) public void afterMethod() throws Exception {
  if (executor != null)   executor.shutdownNow();
  Streams.closeQuietly(machine);
}
Program: 79532
Project: 79532
Buggy source:
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (host != null)   Closeables.closeQuietly(host);
  RecordingSshjTool.reset();
}

Fixed version (ground truth):
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (host != null)   Streams.closeQuietly(host);
  RecordingSshjTool.reset();
}
Program: 79533
Project: 79533
Buggy source:
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (host != null)   Closeables.closeQuietly(host);
}

Fixed version (ground truth):
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception {
  if (host != null)   Streams.closeQuietly(host);
}
Program: 79536
Project: 79536
Buggy source:
public void handleError(HttpCommand command,HttpResponse response){
  String message=parseMessage(response);
  Exception exception=message != null ? new HttpResponseException(command,response,message) : new HttpResponseException(command,response);
  try {
    message=message != null ? message : String.format("String_Node_Str",command.getCurrentRequest().getRequestLine(),response.getStatusLine());
switch (response.getStatusCode()) {
case 401:
case 403:
      exception=new AuthorizationException(message,exception);
    break;
case 404:
  if (!command.getCurrentRequest().getMethod().equals("String_Node_Str")) {
    exception=new ResourceNotFoundException(message,exception);
  }
break;
case 500:
if (message != null) {
if (message.indexOf("String_Node_Str") != -1) {
  exception=new ResourceNotFoundException(message,exception);
}
 else if (message.indexOf("String_Node_Str") != -1) {
  exception=new IllegalStateException(message,exception);
}
 else if (message.indexOf("String_Node_Str") != -1) {
  exception=new SoftLayerOrderItemDuplicateException(command,response,message);
}
}
}
}
  finally {
Closeables.closeQuietly(response.getPayload());
command.setException(exception);
}
}

Fixed version (ground truth):
public void handleError(HttpCommand command,HttpResponse response){
  String message=parseMessage(response);
  Exception exception=message != null ? new HttpResponseException(command,response,message) : new HttpResponseException(command,response);
  try {
    message=message != null ? message : String.format("String_Node_Str",command.getCurrentRequest().getRequestLine(),response.getStatusLine());
switch (response.getStatusCode()) {
case 401:
case 403:
      exception=new AuthorizationException(message,exception);
    break;
case 404:
  if (!command.getCurrentRequest().getMethod().equals("String_Node_Str")) {
    exception=new ResourceNotFoundException(message,exception);
  }
break;
case 500:
if (message != null) {
if (message.indexOf("String_Node_Str") != -1) {
  exception=new ResourceNotFoundException(message,exception);
}
 else if (message.indexOf("String_Node_Str") != -1) {
  exception=new IllegalStateException(message,exception);
}
 else if (message.indexOf("String_Node_Str") != -1) {
  exception=new SoftLayerOrderItemDuplicateException(command,response,message);
}
}
}
}
  finally {
Streams.closeQuietly(response.getPayload());
command.setException(exception);
}
}
Program: 79537
Project: 79537
Buggy source:
private void assertSshable(Map<?,?> machineConfig){
  SshMachineLocation machineUsingPassword=managementContext.getLocationManager().createLocation(LocationSpec.create(SshMachineLocation.class).configure(machineConfig));
  try {
    assertSshable(machineUsingPassword);
  }
  finally {
    Closeables.closeQuietly(machineUsingPassword);
  }
}

Fixed version (ground truth):
private void assertSshable(Map<?,?> machineConfig){
  SshMachineLocation machineUsingPassword=managementContext.getLocationManager().createLocation(LocationSpec.create(SshMachineLocation.class).configure(machineConfig));
  try {
    assertSshable(machineUsingPassword);
  }
  finally {
    Streams.closeQuietly(machineUsingPassword);
  }
}
Program: 79542
Project: 79542
Buggy source:
protected String lookup(LockInfo info){
  return GroovyJavaMethods.truth(info) ? "String_Node_Str" + info : "String_Node_Str";
}

Fixed version (ground truth):
protected String lookup(LockInfo info){
  return info != null ? "String_Node_Str" + info : "String_Node_Str";
}
Program: 79543
Project: 79543
Buggy source:
public static Task<List<?>> parallel(String name,TaskAdaptable<?>... tasks){
  return parallelInternal(name,asTasks(tasks));
}

Fixed version (ground truth):
public static Task<List<?>> parallel(String name,Iterable<? extends TaskAdaptable<?>> tasks){
  return parallelInternal(name,asTasks(Iterables.toArray(tasks,TaskAdaptable.class)));
}
Program: 79544
Project: 79544
Buggy source:
/** 
 * core method for obtaining a VM using jclouds; Map should contain CLOUD_PROVIDER and CLOUD_ENDPOINT or CLOUD_REGION, depending on the cloud, as well as ACCESS_IDENTITY and ACCESS_CREDENTIAL, plus any further properties to specify e.g. images, hardware profiles, accessing user (for initial login, and a user potentially to create for subsequent ie normal access) 
 */
public JcloudsSshMachineLocation obtain(Map<?,?> flags) throws NoMachinesAvailableException {
  ConfigBag setup=ConfigBag.newInstanceExtending(getAllConfigBag(),flags);
  Integer attempts=setup.get(MACHINE_CREATE_ATTEMPTS);
  List<Exception> exceptions=Lists.newArrayList();
  if (attempts == null || attempts < 1)   attempts=1;
  for (int i=1; i <= attempts; i++) {
    try {
      return obtainOnce(setup);
    }
 catch (    RuntimeException e) {
      LOG.warn("String_Node_Str",new Object[]{i,attempts,e});
      exceptions.add(e);
    }
  }
  String msg=String.format("String_Node_Str",attempts,attempts == 1 ? "String_Node_Str" : "String_Node_Str");
  Exception cause=(exceptions.size() == 1) ? exceptions.get(0) : new CompoundRuntimeException(msg + "String_Node_Str" + exceptions.get(exceptions.size() - 1),exceptions);
  if (exceptions.get(exceptions.size() - 1) instanceof NoMachinesAvailableException) {
    throw new NoMachinesAvailableException(msg,cause);
  }
 else {
    throw Exceptions.propagate(cause);
  }
}

Fixed version (ground truth):
/** 
 * core method for obtaining a VM using jclouds; Map should contain CLOUD_PROVIDER and CLOUD_ENDPOINT or CLOUD_REGION, depending on the cloud, as well as ACCESS_IDENTITY and ACCESS_CREDENTIAL, plus any further properties to specify e.g. images, hardware profiles, accessing user (for initial login, and a user potentially to create for subsequent ie normal access) 
 */
public JcloudsSshMachineLocation obtain(Map<?,?> flags) throws NoMachinesAvailableException {
  ConfigBag setup=ConfigBag.newInstanceExtending(getAllConfigBag(),flags);
  Integer attempts=setup.get(MACHINE_CREATE_ATTEMPTS);
  List<Exception> exceptions=Lists.newArrayList();
  if (attempts == null || attempts < 1)   attempts=1;
  for (int i=1; i <= attempts; i++) {
    try {
      return obtainOnce(setup);
    }
 catch (    RuntimeException e) {
      LOG.warn("String_Node_Str",new Object[]{i,attempts,e});
      exceptions.add(e);
    }
  }
  String msg=String.format("String_Node_Str",attempts,attempts == 1 ? "String_Node_Str" : "String_Node_Str");
  Exception cause=(exceptions.size() == 1) ? exceptions.get(0) : new CompoundRuntimeException(msg + "String_Node_Str" + "String_Node_Str"+ exceptions.get(0)+ "String_Node_Str"+ "String_Node_Str"+ (exceptions.size() - 1)+ "String_Node_Str"+ exceptions.get(exceptions.size() - 1)+ "String_Node_Str",exceptions.get(0),exceptions);
  if (exceptions.get(exceptions.size() - 1) instanceof NoMachinesAvailableException) {
    throw new NoMachinesAvailableException(msg,cause);
  }
 else {
    throw Exceptions.propagate(cause);
  }
}
Program: 79546
Project: 79546
Buggy source:
@Override public void install(){
  Maybe<Object> url=getEntity().getConfigRaw(SoftwareProcess.DOWNLOAD_URL,true);
  if (url.isPresentAndNonNull()) {
    DownloadResolver resolver=Entities.newDownloader(this);
    List<String> urls=resolver.getTargets();
    downloadedFilename=resolver.getFilename();
    List<String> commands=new LinkedList<String>();
    commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls,downloadedFilename));
switch (ArchiveType.of(downloadedFilename)) {
case TAR:
case TGZ:
      commands.add(BashCommands.INSTALL_TAR);
    break;
case ZIP:
  commands.add(BashCommands.INSTALL_UNZIP);
break;
case UNKNOWN:
break;
}
newScript(INSTALLING).failOnNonZeroResultCode().environmentVariablesReset().body.append(commands).execute();
}
}

Fixed version (ground truth):
@Override public void install(){
  Maybe<Object> url=getEntity().getConfigRaw(SoftwareProcess.DOWNLOAD_URL,true);
  if (url.isPresentAndNonNull()) {
    DownloadResolver resolver=Entities.newDownloader(this);
    List<String> urls=resolver.getTargets();
    downloadedFilename=resolver.getFilename();
    List<String> commands=new LinkedList<String>();
    commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls,downloadedFilename));
switch (ArchiveType.of(downloadedFilename)) {
case TAR:
case TGZ:
      commands.add(BashCommands.INSTALL_TAR);
    break;
case ZIP:
  commands.add(BashCommands.INSTALL_UNZIP);
break;
case UNKNOWN:
break;
}
newScript(INSTALLING).failOnNonZeroResultCode().environmentVariablesReset().execute();
newScript("String_Node_Str" + url.get()).failOnNonZeroResultCode().environmentVariablesReset().body.append(commands).execute();
}
}
Program: 79547
Project: 79547
Buggy source:
@Override public void launch(){
  String command=format("String_Node_Str",getMonitPidFile(),expandedInstallDir,remoteControlFilePath);
  newScript(LAUNCHING).updateTaskAndFailOnNonZeroResultCode().body.append(command).execute();
}

Fixed version (ground truth):
@Override public void launch(){
  String command=format("String_Node_Str",getMonitPidFile(),expandedInstallDir,remoteControlFilePath,getMonitPidFile());
  newScript(MutableMap.of("String_Node_Str",false),LAUNCHING).updateTaskAndFailOnNonZeroResultCode().body.append(command).execute();
}
Program: 79548
Project: 79548
Buggy source:
protected String getMonitPidFile(){
  return getRunDir() + "String_Node_Str";
}

Fixed version (ground truth):
protected String getMonitPidFile(){
  return getRunDir() + "String_Node_Str" + AbstractSoftwareProcessSshDriver.PID_FILENAME;
}
Program: 79549
Project: 79549
Buggy source:
/** 
 * returns the /tmp dir, based on java.io.tmpdir but ignoring it if it's weird (e.g. /var/folders/q2/363yynwx5lb_qpch1km2xvr80000gn/T/) and /tmp exists 
 */
public static String tmp(){
  String tmpdir=System.getProperty("String_Node_Str");
  if (tmpdir.contains("String_Node_Str") && new File("String_Node_Str").exists())   return "String_Node_Str";
  return tmpdir;
}

Fixed version (ground truth):
/** 
 * returns the best tmp dir to use; see   {@link TmpDirFinder} for the logic(and the explanation why this is needed!) 
 */
public static String tmp(){
  Maybe<String> tmp=tmpdir.get();
  if (tmp.isPresent())   return tmp.get();
  tmpdir.useWithWarning(System.getProperty("String_Node_Str"));
  return tmp.get();
}
Program: 79550
Project: 79550
Buggy source:
public static String user(){
  return System.getProperty("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * user name 
 */
public static String user(){
  return System.getProperty("String_Node_Str");
}
Program: 79551
Project: 79551
Buggy source:
/** 
 * Checks if a correct error and help message is given if using incorrect application.
 */
@Test(groups="String_Node_Str") public void testLaunchCliAppLaunchError() throws Throwable {
  final Process brooklyn=startBrooklyn("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  BrooklynCliTest test=new BrooklynCliTest(brooklyn){
    @Override public void checkConsole(){
      assertConsoleOutput("String_Node_Str");
      assertConsoleError("String_Node_Str");
    }
  }
;
  testBrooklyn(brooklyn,test,2);
}

Fixed version (ground truth):
/** 
 * Checks if a correct error and help message is given if using incorrect application.
 */
@Test(groups="String_Node_Str") public void testLaunchCliAppLaunchError() throws Throwable {
  final String app="String_Node_Str";
  final Process brooklyn=startBrooklyn("String_Node_Str","String_Node_Str",app,"String_Node_Str","String_Node_Str");
  BrooklynCliTest test=new BrooklynCliTest(brooklyn){
    @Override public void checkConsole(){
      assertConsoleOutput("String_Node_Str");
      assertConsoleError("String_Node_Str" + app + "String_Node_Str");
    }
  }
;
  testBrooklyn(brooklyn,test,2);
}
Program: 79552
Project: 79552
Buggy source:
@Override public void checkConsole(){
  assertConsoleOutput("String_Node_Str");
  assertConsoleError("String_Node_Str");
}

Fixed version (ground truth):
@Override public void checkConsole(){
  assertConsoleOutput("String_Node_Str");
  assertConsoleError("String_Node_Str" + app + "String_Node_Str");
}
Program: 79553
Project: 79553
Buggy source:
public void run(){
  try {
    V val=job.call();
    if (handler.checkSuccess(val)) {
      handler.onSuccess(val);
    }
 else {
      handler.onFailure(val);
    }
  }
 catch (  Exception e) {
    handler.onException(e);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    V val=job.call();
    if (handler.checkSuccess(val)) {
      handler.onSuccess(val);
    }
 else {
      handler.onFailure(val);
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str" + job + "String_Node_Str"+ e+ "String_Node_Str"+ handler);
    handler.onException(e);
  }
}
Program: 79554
Project: 79554
Buggy source:
PollJob(final Callable<V> job,final PollHandler<? super V> handler,Duration period){
  this.handler=handler;
  this.pollPeriod=period;
  wrappedJob=new Runnable(){
    public void run(){
      try {
        V val=job.call();
        if (handler.checkSuccess(val)) {
          handler.onSuccess(val);
        }
 else {
          handler.onFailure(val);
        }
      }
 catch (      Exception e) {
        handler.onException(e);
      }
    }
  }
;
}

Fixed version (ground truth):
PollJob(final Callable<V> job,final PollHandler<? super V> handler,Duration period){
  this.handler=handler;
  this.pollPeriod=period;
  wrappedJob=new Runnable(){
    public void run(){
      try {
        V val=job.call();
        if (handler.checkSuccess(val)) {
          handler.onSuccess(val);
        }
 else {
          handler.onFailure(val);
        }
      }
 catch (      Exception e) {
        log.debug("String_Node_Str" + job + "String_Node_Str"+ e+ "String_Node_Str"+ handler);
        handler.onException(e);
      }
    }
  }
;
}
Program: 79557
Project: 79557
Buggy source:
public String configFile(){
  String templateUrl=driver.getEntity().getConfig(NginxController.SERVER_CONF_TEMPLATE_URL);
  ResourceUtils.create(this).checkUrlExists(templateUrl);
  ProxySslConfig ssl=driver.getEntity().getConfig(NginxController.SSL_CONFIG);
  if (ssl != null && Strings.isEmpty(ssl.getCertificateDestination()) && Strings.isEmpty(ssl.getCertificateSourceUrl())) {
    throw new IllegalStateException("String_Node_Str");
  }
  Iterable<UrlMapping> mappings=((NginxController)driver.getEntity()).getUrlMappings();
  Multimap<String,UrlMapping> mappingsByDomain=LinkedHashMultimap.create();
  for (  UrlMapping mapping : mappings) {
    Collection<String> addrs=mapping.getAttribute(UrlMapping.TARGET_ADDRESSES);
    if (addrs != null && addrs.size() > 0) {
      mappingsByDomain.put(mapping.getDomain(),mapping);
    }
  }
  Map<String,Object> substitutions=MutableMap.<String,Object>of("String_Node_Str",ssl,"String_Node_Str",mappings,"String_Node_Str",mappingsByDomain);
  String contents=ResourceUtils.create(driver.getEntity()).getResourceAsString(templateUrl);
  return TemplateProcessor.processTemplateContents(contents,driver,substitutions);
}

Fixed version (ground truth):
public String configFile(){
  String templateUrl=driver.getEntity().getConfig(NginxController.SERVER_CONF_TEMPLATE_URL);
  ResourceUtils.create(this).checkUrlExists(templateUrl);
  ProxySslConfig ssl=driver.getEntity().getConfig(NginxController.SSL_CONFIG);
  if (ssl != null && Strings.isEmpty(ssl.getCertificateDestination()) && Strings.isEmpty(ssl.getCertificateSourceUrl())) {
    throw new IllegalStateException("String_Node_Str");
  }
  Iterable<UrlMapping> mappings=((NginxController)driver.getEntity()).getUrlMappings();
  Multimap<String,UrlMapping> mappingsByDomain=LinkedHashMultimap.create();
  for (  UrlMapping mapping : mappings) {
    Collection<String> addrs=mapping.getAttribute(UrlMapping.TARGET_ADDRESSES);
    if (addrs != null && addrs.size() > 0) {
      mappingsByDomain.put(mapping.getDomain(),mapping);
    }
  }
  MutableMap.Builder<String,Object> builder=MutableMap.<String,Object>builder().put("String_Node_Str",mappings).put("String_Node_Str",mappingsByDomain);
  if (ssl != null)   builder.put("String_Node_Str",ssl);
  Map<String,Object> substitutions=builder.build();
  String contents=ResourceUtils.create(driver.getEntity()).getResourceAsString(templateUrl);
  return TemplateProcessor.processTemplateContents(contents,driver,substitutions);
}
Program: 79558
Project: 79558
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testReadEachSensor(){
  Set<SensorSummary> sensors=client().resource("String_Node_Str").get(new GenericType<Set<SensorSummary>>(){
  }
);
  Map<String,String> readings=Maps.newHashMap();
  for (  SensorSummary sensor : sensors) {
    readings.put(sensor.getName(),client().resource(sensor.getLinks().get("String_Node_Str")).get(String.class));
  }
  assertEquals(readings.get(RestMockSimpleEntity.SAMPLE_SENSOR.getName()),"String_Node_Str");
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testReadEachSensor(){
  Set<SensorSummary> sensors=client().resource("String_Node_Str").get(new GenericType<Set<SensorSummary>>(){
  }
);
  Map<String,String> readings=Maps.newHashMap();
  for (  SensorSummary sensor : sensors) {
    try {
      readings.put(sensor.getName(),client().resource(sensor.getLinks().get("String_Node_Str")).get(String.class));
    }
 catch (    UniformInterfaceException uie) {
      if (uie.getResponse().getStatus() == 204) {
        readings.put(sensor.getName(),null);
      }
 else {
        Exceptions.propagate(uie);
      }
    }
  }
  assertEquals(readings.get(RestMockSimpleEntity.SAMPLE_SENSOR.getName()),"String_Node_Str");
}
Program: 79559
Project: 79559
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){
  return newSshExecTaskFactory(machine,BashCommands.dontRequireTtyForSudo()).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)       return true;
      Entity entity=BrooklynTasks.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=BrooklynTasks.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;
    }
  }
);
}