nus-yam/ex-repair huggingface dataset:
Program: 79651
Project: 79651
Buggy source:
protected void waitForPageNotFoundResponse(String resource,Class<?> clazz) throws InterruptedException, TimeoutException {
  int count=0;
  while (true) {
    try {
      client().resource(resource).get(clazz);
    }
 catch (    UniformInterfaceException e) {
      if (e.getResponse().getStatus() == 404) {
        break;
      }
    }
    Thread.sleep(100);
    count+=1;
    if (count > 200) {
      throw new TimeoutException("String_Node_Str" + resource);
    }
  }
}

Fixed version (ground truth):
protected void waitForPageNotFoundResponse(final String resource,final Class<?> clazz){
  boolean found=Repeater.create("String_Node_Str").until(new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      try {
        client().resource(resource).get(clazz);
        return false;
      }
 catch (      UniformInterfaceException e) {
        return e.getResponse().getStatus() == 404;
      }
    }
  }
).every(1,TimeUnit.SECONDS).limitTimeTo(30,TimeUnit.SECONDS).run();
  assertTrue(found);
}
Program: 79652
Project: 79652
Buggy source:
public static ManagementContext newManagementContext(Map<?,?> props){
  return new LocalManagementContext(props);
}

Fixed version (ground truth):
public static ManagementContext newManagementContext(Map<?,?> props){
  return new LocalManagementContext(BrooklynProperties.Factory.newEmpty().addFromMap(props));
}
Program: 79654
Project: 79654
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Object applyToKeyInMap(ListConfigKey<T> key,Map target){
  if (clearFirst)   StructuredModifications.clearing().applyToKeyInMap(key,target);
  for (  T o : this)   target.put(key.subKey(),o);
  return null;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Object applyToKeyInMap(ListConfigKey<T> key,Map target){
  if (clearFirst) {
    StructuredModification<StructuredConfigKey> clearing=StructuredModifications.clearing();
    clearing.applyToKeyInMap(key,target);
  }
  for (  T o : this)   target.put(key.subKey(),o);
  return null;
}
Program: 79655
Project: 79655
Buggy source:
@SuppressWarnings({"String_Node_Str"}) @Override public Object applyToKeyInMap(MapConfigKey<V> key,Map target){
  if (clearFirst)   StructuredModifications.clearing().applyToKeyInMap(key,target);
  return key.applyValueToMap(new LinkedHashMap<String,V>(this),target);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @Override public Object applyToKeyInMap(MapConfigKey<V> key,Map target){
  if (clearFirst) {
    StructuredModification<StructuredConfigKey> clearing=StructuredModifications.clearing();
    clearing.applyToKeyInMap(key,target);
  }
  return key.applyValueToMap(new LinkedHashMap<String,V>(this),target);
}
Program: 79656
Project: 79656
Buggy source:
public LocalManagementContext(BrooklynProperties brooklynProperties){
  super(brooklynProperties);
}

Fixed version (ground truth):
public LocalManagementContext(BrooklynProperties brooklynProperties){
  super(brooklynProperties);
  configMap.putAll(checkNotNull(brooklynProperties,"String_Node_Str"));
}
Program: 79657
Project: 79657
Buggy source:
public AbstractGroupImpl(Map<?,?> props,Entity parent){
  super(props,parent);
  setAttribute(Changeable.GROUP_SIZE,0);
}

Fixed version (ground truth):
public AbstractGroupImpl(Map props,Entity parent){
  super(props,parent);
  setAttribute(Changeable.GROUP_SIZE,0);
}
Program: 79658
Project: 79658
Buggy source:
public RebindSupport<T> getRebindSupport();

Fixed version (ground truth):
public RebindSupport getRebindSupport();
Program: 79659
Project: 79659
Buggy source:
/** 
 * Add a child   {@link Entity}, and set this entity as its parent, returning the added child. TODO Signature will change to   {@code <T extends Entity> T addChild(T child)}, but that currently breaks groovy AbstractEntity subclasses sometimes so deferring that until (hopefully) the next release.
 */
Entity addChild(Entity child);

Fixed version (ground truth):
/** 
 * Creates an   {@link Entity} from the given spec and adds it, setting this entity as the parent,returning the added child. 
 */
<T extends Entity>T addChild(EntitySpec<T> spec);
Program: 79660
Project: 79660
Buggy source:
@Override public Application getApplication(){
  if (getParent() == null) {
    if (application != null)     return application;
    return this;
  }
  return getParent().getApplication();
}

Fixed version (ground truth):
@Override public Application getApplication(){
  if (application != null) {
    if (application.getId().equals(getId())) {
      if (getProxy() != null)       return (Application)getProxy();
    }
    return application;
  }
  if (getParent() == null) {
    if (getProxy() != null)     return (Application)getProxy();
    return this;
  }
  return getParent().getApplication();
}
Program: 79661
Project: 79661
Buggy source:
@Override protected synchronized void setApplication(Application app){
  application=app;
  super.setApplication(app);
}

Fixed version (ground truth):
@Override protected synchronized void setApplication(Application app){
  if (app.getId().equals(getId())) {
    application=getProxy() != null ? (Application)getProxy() : app;
  }
 else {
    application=app;
    if (getParent() == null) {
      log.warn("String_Node_Str" + this + "String_Node_Str"+ app+ "String_Node_Str"+ this+ "String_Node_Str");
    }
 else     if (getParent().getApplicationId().equals(app.getParent())) {
      log.warn("String_Node_Str" + this + "String_Node_Str"+ app+ "String_Node_Str"+ getParent()+ "String_Node_Str"+ getParent().getApplication());
    }
  }
  super.setApplication(app);
}
Program: 79662
Project: 79662
Buggy source:
/** 
 * Finds the effectors defined on the entity's class, statics and optionally any non-static (discouraged).
 */
protected static Map<String,Effector<?>> findEffectors(Class<? extends Entity> clazz,Entity optionalEntity){
  try {
    Map<String,Effector<?>> result=Maps.newLinkedHashMap();
    Map<String,Field> sources=Maps.newLinkedHashMap();
    for (    Field f : clazz.getFields()) {
      if (Effector.class.isAssignableFrom(f.getType())) {
        if (!Modifier.isStatic(f.getModifiers())) {
          LOG.warn("String_Node_Str" + f + "String_Node_Str"+ (optionalEntity != null ? optionalEntity : clazz));
          if (optionalEntity == null)           continue;
        }
        Effector<?> eff=(Effector<?>)f.get(optionalEntity);
        Effector<?> overwritten=result.put(eff.getName(),eff);
        Field source=sources.put(eff.getName(),f);
        if (overwritten != null && overwritten != eff)         LOG.warn("String_Node_Str",new Object[]{eff.getName(),optionalEntity != null ? optionalEntity : clazz,eff,f,overwritten,source});
      }
    }
    return result;
  }
 catch (  IllegalAccessException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
/** 
 * Finds the effectors defined on the entity's class, statics and optionally any non-static (discouraged).
 */
protected static Map<String,Effector<?>> findEffectors(Class<? extends Entity> clazz,Entity optionalEntity){
  try {
    Map<String,Effector<?>> result=Maps.newLinkedHashMap();
    Map<String,Field> sources=Maps.newLinkedHashMap();
    for (    Field f : clazz.getFields()) {
      if (Effector.class.isAssignableFrom(f.getType())) {
        if (!Modifier.isStatic(f.getModifiers())) {
          LOG.warn("String_Node_Str" + f + "String_Node_Str"+ (optionalEntity != null ? optionalEntity : clazz));
          if (optionalEntity == null)           continue;
        }
        Effector<?> eff=(Effector<?>)f.get(optionalEntity);
        Effector<?> overwritten=result.put(eff.getName(),eff);
        Field source=sources.put(eff.getName(),f);
        if (overwritten != null && overwritten != eff) {
          LOG.warn("String_Node_Str",new Object[]{eff.getName(),optionalEntity != null ? optionalEntity : clazz,eff,f,overwritten,source});
        }
      }
    }
    return result;
  }
 catch (  IllegalAccessException e) {
    throw Throwables.propagate(e);
  }
}
Program: 79664
Project: 79664
Buggy source:
/** 
 * Adds template options which are used for building, but not for matching/filtering.  (eg tags added here will be set on any machine created by this template, but will not be required when matching this template to existing machines) 
 */
public T addOptionalOptions(TemplateOptions options){
  additionalOptionalOptions.add(options);
  return (T)this;
}

Fixed version (ground truth):
/** 
 * Adds template options which are used for building, but not for matching/filtering.  (eg tags added here will be set on any machine created by this template, but will not be required when matching this template to existing machines) 
 */
@SuppressWarnings("String_Node_Str") public T addOptionalOptions(TemplateOptions options){
  additionalOptionalOptions.add(options);
  return (T)this;
}
Program: 79665
Project: 79665
Buggy source:
protected String makeNonTrivialArgumentsString(){
  String s=super.makeNonTrivialArgumentsString();
  TemplateOptions aggr=computeAggregatedOptions(false);
  if (aggr.getInboundPorts().length > 0)   s="String_Node_Str" + Arrays.asList(aggr.getInboundPorts()) + (s != null && s.length() > 0 ? "String_Node_Str" + s : "String_Node_Str");
  if (!aggr.getUserMetadata().isEmpty())   s="String_Node_Str" + aggr.getUserMetadata() + (s != null && s.length() > 0 ? "String_Node_Str" + s : "String_Node_Str");
  if (!aggr.getTags().isEmpty())   s="String_Node_Str" + aggr.getTags() + (s != null && s.length() > 0 ? "String_Node_Str" + s : "String_Node_Str");
  return s;
}

Fixed version (ground truth):
protected String makeNonTrivialArgumentsString(){
  String s=super.makeNonTrivialArgumentsString();
  TemplateOptions aggr=computeAggregatedOptions(false);
  if (aggr.getInboundPorts().length > 0)   s="String_Node_Str" + Ints.asList(aggr.getInboundPorts()) + (s != null && s.length() > 0 ? "String_Node_Str" + s : "String_Node_Str");
  if (!aggr.getUserMetadata().isEmpty())   s="String_Node_Str" + aggr.getUserMetadata() + (s != null && s.length() > 0 ? "String_Node_Str" + s : "String_Node_Str");
  if (!aggr.getTags().isEmpty())   s="String_Node_Str" + aggr.getTags() + (s != null && s.length() > 0 ? "String_Node_Str" + s : "String_Node_Str");
  return s;
}
Program: 79667
Project: 79667
Buggy source:
private int execProcess(Map<String,?> props,List<String> cmd){
  OutputStream out=getOptionalVal(props,PROP_OUT_STREAM);
  OutputStream err=getOptionalVal(props,PROP_ERR_STREAM);
  StreamGobbler errgobbler=null;
  StreamGobbler outgobbler=null;
  ProcessBuilder pb=new ProcessBuilder(cmd);
  try {
    Process p=pb.start();
    if (true) {
      InputStream outstream=p.getInputStream();
      outgobbler=new StreamGobbler(outstream,out,LOG).setLogPrefix("String_Node_Str");
      outgobbler.start();
    }
    if (true) {
      InputStream errstream=p.getErrorStream();
      errgobbler=new StreamGobbler(errstream,err,LOG).setLogPrefix("String_Node_Str");
      errgobbler.start();
    }
    return p.waitFor();
  }
 catch (  InterruptedException e) {
    throw Exceptions.propagate(e);
  }
catch (  IOException e) {
    throw Exceptions.propagate(e);
  }
 finally {
    closeWhispering(outgobbler,this);
    closeWhispering(errgobbler,this);
  }
}

Fixed version (ground truth):
private int execProcess(Map<String,?> props,List<String> cmd){
  OutputStream out=getOptionalVal(props,PROP_OUT_STREAM);
  OutputStream err=getOptionalVal(props,PROP_ERR_STREAM);
  StreamGobbler errgobbler=null;
  StreamGobbler outgobbler=null;
  ProcessBuilder pb=new ProcessBuilder(cmd);
  try {
    Process p=pb.start();
    if (true) {
      InputStream outstream=p.getInputStream();
      outgobbler=new StreamGobbler(outstream,out,LOG).setLogPrefix("String_Node_Str");
      outgobbler.start();
    }
    if (true) {
      InputStream errstream=p.getErrorStream();
      errgobbler=new StreamGobbler(errstream,err,LOG).setLogPrefix("String_Node_Str");
      errgobbler.start();
    }
    int result=p.waitFor();
    outgobbler.blockUntilFinished();
    errgobbler.blockUntilFinished();
    if (result == 255)     throw new SshException("String_Node_Str");
    return result;
  }
 catch (  InterruptedException e) {
    throw Exceptions.propagate(e);
  }
catch (  IOException e) {
    throw Exceptions.propagate(e);
  }
 finally {
    closeWhispering(outgobbler,this);
    closeWhispering(errgobbler,this);
  }
}
Program: 79668
Project: 79668
Buggy source:
public static WebApplicationException notFound(String format,Object... args){
  String msg=String.format(format,args);
  if (log.isInfoEnabled())   log.info("String_Node_Str" + msg + "String_Node_Str");
  throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity(new ApiError(msg)).build());
}

Fixed version (ground truth):
public static WebApplicationException notFound(String format,Object... args){
  String msg=String.format(format,args);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + msg + "String_Node_Str");
  throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).type(MediaType.APPLICATION_JSON_TYPE).entity(new ApiError(msg)).build());
}
Program: 79669
Project: 79669
Buggy source:
public static WebApplicationException preconditionFailed(String format,Object... args){
  String msg=String.format(format,args);
  if (log.isInfoEnabled())   log.info("String_Node_Str" + msg + "String_Node_Str");
  throw new WebApplicationException(Response.status(Response.Status.PRECONDITION_FAILED).entity(new ApiError(msg)).build());
}

Fixed version (ground truth):
public static WebApplicationException preconditionFailed(String format,Object... args){
  String msg=String.format(format,args);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + msg + "String_Node_Str");
  throw new WebApplicationException(Response.status(Response.Status.PRECONDITION_FAILED).type(MediaType.APPLICATION_JSON_TYPE).entity(new ApiError(msg)).build());
}
Program: 79671
Project: 79671
Buggy source:
public static String generateGroupId(){
  String user=System.getProperty("String_Node_Str");
  String rand=Identifiers.makeRandomId(6);
  String result="String_Node_Str" + Strings.maxlen(user,4) + "String_Node_Str"+ rand;
  return result.toLowerCase();
}

Fixed version (ground truth):
public static String generateGroupId(String provider){
  String user=System.getProperty("String_Node_Str");
  String rand=Identifiers.makeRandomId(("String_Node_Str".equals(provider)) ? 2 : 6);
  String result="String_Node_Str" + Strings.maxlen(user,4) + "String_Node_Str"+ rand;
  return result.toLowerCase();
}
Program: 79672
Project: 79672
Buggy source:
public void shutdown(){
  running.set(false);
  interrupt();
}

Fixed version (ground truth):
/** 
 * @deprecate Use close() instead.
 */
@Deprecated public void shutdown(){
  close();
}
Program: 79674
Project: 79674
Buggy source:
@Override public void close() throws IOException {
  super.close();
  if (sftp != null)   sftp.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  super.close();
  closeWhispering(sftp,this);
}
Program: 79675
Project: 79675
Buggy source:
@Override public void clear() throws TransportException, ConnectionException {
  if (session != null) {
    session.close();
  }
  if (shell != null) {
    shell.close();
  }
  if (outgobbler != null) {
    outgobbler.shutdown();
  }
  if (errgobbler != null) {
    errgobbler.shutdown();
  }
}

Fixed version (ground truth):
@Override public void clear() throws TransportException, ConnectionException {
  closeWhispering(session,this);
  closeWhispering(shell,this);
  closeWhispering(outgobbler,this);
  closeWhispering(errgobbler,this);
  session=null;
  shell=null;
}
Program: 79676
Project: 79676
Buggy source:
protected SshAction<Session> newSessionAction(){
  return new SshAction<Session>(){
    private Session session=null;
    @Override public void clear() throws TransportException, ConnectionException {
      if (session != null)       session.close();
    }
    @Override public Session create() throws Exception {
      checkConnected();
      session=sshClientConnection.ssh.startSession();
      allocatePTY(session);
      return session;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
protected SshAction<Session> newSessionAction(){
  return new SshAction<Session>(){
    private Session session=null;
    @Override public void clear() throws TransportException, ConnectionException {
      closeWhispering(session,this);
      session=null;
    }
    @Override public Session create() throws Exception {
      checkConnected();
      session=sshClientConnection.ssh.startSession();
      allocatePTY(session);
      return session;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}
Program: 79677
Project: 79677
Buggy source:
public void shutdown(){
  running.set(false);
  interrupt();
}

Fixed version (ground truth):
/** 
 * @deprecate Use close() instead.
 */
@Deprecated public void shutdown(){
  close();
}
Program: 79679
Project: 79679
Buggy source:
@Override public void close() throws IOException {
  super.close();
  if (sftp != null)   sftp.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  super.close();
  closeWhispering(sftp,this);
}
Program: 79680
Project: 79680
Buggy source:
@Override public void clear() throws TransportException, ConnectionException {
  if (session != null) {
    session.close();
  }
  if (shell != null) {
    shell.close();
  }
  if (outgobbler != null) {
    outgobbler.shutdown();
  }
  if (errgobbler != null) {
    errgobbler.shutdown();
  }
}

Fixed version (ground truth):
@Override public void clear() throws TransportException, ConnectionException {
  closeWhispering(session,this);
  closeWhispering(shell,this);
  closeWhispering(outgobbler,this);
  closeWhispering(errgobbler,this);
  session=null;
  shell=null;
}
Program: 79681
Project: 79681
Buggy source:
protected SshAction<Session> newSessionAction(){
  return new SshAction<Session>(){
    private Session session=null;
    @Override public void clear() throws TransportException, ConnectionException {
      if (session != null)       session.close();
    }
    @Override public Session create() throws Exception {
      checkConnected();
      session=sshClientConnection.ssh.startSession();
      allocatePTY(session);
      return session;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
protected SshAction<Session> newSessionAction(){
  return new SshAction<Session>(){
    private Session session=null;
    @Override public void clear() throws TransportException, ConnectionException {
      closeWhispering(session,this);
      session=null;
    }
    @Override public Session create() throws Exception {
      checkConnected();
      session=sshClientConnection.ssh.startSession();
      allocatePTY(session);
      return session;
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
;
}
Program: 79682
Project: 79682
Buggy source:
private static void addGlobalProperties(BrooklynProperties p){
  File globalPropertiesFile=new File(p.getFirst(MutableMap.of("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str") + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str");
  if (globalPropertiesFile.exists()) {
    p.addFrom(globalPropertiesFile);
  }
}

Fixed version (ground truth):
private static void addGlobalProperties(BrooklynProperties p){
  String userHome=System.getProperty("String_Node_Str");
  File globalPropertiesFile=new File(userHome + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str");
  if (globalPropertiesFile.exists()) {
    p.addFrom(globalPropertiesFile);
  }
}
Program: 79683
Project: 79683
Buggy source:
private static void addGlobalProperties(BrooklynProperties p){
  File globalPropertiesFile=new File(p.getFirst(MutableMap.of("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str") + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str");
  if (globalPropertiesFile.exists()) {
    p.addFrom(globalPropertiesFile);
  }
}

Fixed version (ground truth):
private static void addGlobalProperties(BrooklynProperties p){
  String userHome=System.getProperty("String_Node_Str");
  File globalPropertiesFile=new File(userHome + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str");
  if (globalPropertiesFile.exists()) {
    p.addFrom(globalPropertiesFile);
  }
}
Program: 79684
Project: 79684
Buggy source:
public Set<SubscriptionHandle> getSubscriptionsForEntitySensor(Entity source,Sensor<?> sensor){
  Set<SubscriptionHandle> subscriptions=new LinkedHashSet<SubscriptionHandle>();
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,null)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,null)),Collections.emptySet()));
  return subscriptions;
}

Fixed version (ground truth):
public synchronized Set<SubscriptionHandle> getSubscriptionsForEntitySensor(Entity source,Sensor<?> sensor){
  Set<SubscriptionHandle> subscriptions=new LinkedHashSet<SubscriptionHandle>();
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,null)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,null)),Collections.emptySet()));
  return subscriptions;
}
Program: 79685
Project: 79685
Buggy source:
@Override public TimeDuration apply(final Object input){
  return JavaGroovyEquivalents.toTimeDuration(input);
}

Fixed version (ground truth):
@Override public AtomicInteger apply(final String input){
  return new AtomicInteger(Integer.parseInt(input));
}
Program: 79686
Project: 79686
Buggy source:
public Set<SubscriptionHandle> getSubscriptionsForEntitySensor(Entity source,Sensor<?> sensor){
  Set<SubscriptionHandle> subscriptions=new LinkedHashSet<SubscriptionHandle>();
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,null)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,null)),Collections.emptySet()));
  return subscriptions;
}

Fixed version (ground truth):
public synchronized Set<SubscriptionHandle> getSubscriptionsForEntitySensor(Entity source,Sensor<?> sensor){
  Set<SubscriptionHandle> subscriptions=new LinkedHashSet<SubscriptionHandle>();
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,sensor)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(source,null)),Collections.emptySet()));
  subscriptions.addAll(elvis(subscriptionsByToken.get(makeEntitySensorToken(null,null)),Collections.emptySet()));
  return subscriptions;
}
Program: 79688
Project: 79688
Buggy source:
public String apply(Map.Entry entry){
  Object k=entry.getKey();
  Object v=entry.getValue();
  try {
    if (v != null && Primitives.isWrapperType(v.getClass())) {
      v="String_Node_Str" + v;
    }
 else {
      v=BasicConfigKey.resolveValue(v,Object.class,entity.getExecutionContext());
      if (v == null) {
      }
 else       if (v instanceof CharSequence) {
      }
 else       if (TypeCoercions.isPrimitiveOrBoxer(v.getClass())) {
        v="String_Node_Str" + v;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + v + "String_Node_Str"+ v.getClass()+ "String_Node_Str");
      }
    }
    return "String_Node_Str" + k + (v != null ? "String_Node_Str" + v : "String_Node_Str");
  }
 catch (  Exception e) {
    log.warn("String_Node_Str",k,e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
public String apply(Map.Entry<String,?> entry){
  String k=entry.getKey();
  Object v=entry.getValue();
  try {
    if (v != null && Primitives.isWrapperType(v.getClass())) {
      v="String_Node_Str" + v;
    }
 else {
      v=BasicConfigKey.resolveValue(v,Object.class,entity.getExecutionContext());
      if (v == null) {
      }
 else       if (v instanceof CharSequence) {
      }
 else       if (TypeCoercions.isPrimitiveOrBoxer(v.getClass())) {
        v="String_Node_Str" + v;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + v + "String_Node_Str"+ v.getClass()+ "String_Node_Str");
      }
    }
    return "String_Node_Str" + k + (v != null ? "String_Node_Str" + v : "String_Node_Str");
  }
 catch (  Exception e) {
    log.warn("String_Node_Str",k,e);
    throw Throwables.propagate(e);
  }
}
Program: 79690
Project: 79690
Buggy source:
/** 
 * Returns the complete set of Java system properties (-D defines) to set for the application. <p> This is exposed to the JVM as the contents of the   {@code JAVA_OPTS} environment variable. Default set contains config key, custom system properties, and JMX defines. <p> Null value means to set -Dkey otherwise it is -Dkey=value. <p> See  {@link #getShellEnvironment()} for discussion of quoting/escaping strategy.
 */
protected Map getJavaSystemProperties(){
  return MutableMap.builder().putAll(entity.getConfig(UsesJava.JAVA_OPTIONS)).putAll(getCustomJavaSystemProperties()).putAll(isJmxEnabled() ? getJmxJavaSystemProperties() : Collections.emptyMap()).build();
}

Fixed version (ground truth):
/** 
 * Returns the complete set of Java system properties (-D defines) to set for the application. <p> This is exposed to the JVM as the contents of the   {@code JAVA_OPTS} environment variable. Defaultset contains config key, custom system properties, and JMX defines. <p> Null value means to set -Dkey otherwise it is -Dkey=value. <p> See  {@link #getShellEnvironment()} for discussion of quoting/escaping strategy.
 */
protected Map<String,?> getJavaSystemProperties(){
  return MutableMap.<String,Object>builder().putAll(getCustomJavaSystemProperties()).putAll(isJmxEnabled() ? getJmxJavaSystemProperties() : Collections.<String,Object>emptyMap()).putAll(entity.getConfig(UsesJava.JAVA_SYSPROPS)).build();
}
Program: 79691
Project: 79691
Buggy source:
/** 
 * Return the configuration properties required to enable JMX for a Java application. These should be set as properties in the   {@code JAVA_OPTS} environment variablewhen calling the run script for the application. TODO security!
 */
protected Map<String,?> getJmxJavaSystemProperties(){
  Integer jmxRemotePort=checkNotNull(getJmxPort(),"String_Node_Str" + entity);
  String hostName=checkNotNull(getMachine().getAddress().getHostName(),"String_Node_Str" + entity);
  return MutableMap.<String,Object>builder().put("String_Node_Str",null).put("String_Node_Str",jmxRemotePort).put("String_Node_Str",false).put("String_Node_Str",false).put("String_Node_Str",hostName).build();
}

Fixed version (ground truth):
/** 
 * Return the configuration properties required to enable JMX for a Java application. These should be set as properties in the   {@code JAVA_OPTS} environment variable when calling therun script for the application. TODO security!
 */
protected Map<String,?> getJmxJavaSystemProperties(){
  Integer jmxRemotePort=checkNotNull(getJmxPort(),"String_Node_Str" + entity);
  String hostName=checkNotNull(getMachine().getAddress().getHostName(),"String_Node_Str" + entity);
  return MutableMap.<String,Object>builder().put("String_Node_Str",null).put("String_Node_Str",jmxRemotePort).put("String_Node_Str",false).put("String_Node_Str",false).put("String_Node_Str",hostName).build();
}
Program: 79692
Project: 79692
Buggy source:
@Override public Integer getRmiPort(){
  return !isJmxEnabled() ? -1 : entity.getAttribute(UsesJmx.RMI_PORT);
}

Fixed version (ground truth):
@Deprecated @Override public Integer getRmiPort(){
  return getRmiServerPort();
}
Program: 79693
Project: 79693
Buggy source:
/** 
 * Sets all JVM options (-X.. -D..) in an environment var JAVA_OPTS. <p> That variable is constructed from getJavaOpts(), then wrapped _unescaped_ in double quotes. An error is thrown if there is an unescaped double quote in the string. All other unescaped characters are permitted, but unless $var expansion or `command` execution is desired (although this is not confirmed as supported) the generally caller should escape any such characters, for example using   {@link StringEscapeUtils#escapeLiteralForDoubleQuotedBash(String)}. 
 */
@Override public Map<String,String> getShellEnvironment(){
  for (  String it : getJavaOpts()) {
    StringEscapeUtils.assertValidForDoubleQuotingInBash(it);
  }
  String sJavaOpts=Joiner.on("String_Node_Str").join(getJavaOpts());
  return MutableMap.<String,String>builder().putAll(super.getShellEnvironment()).put("String_Node_Str",sJavaOpts).build();
}

Fixed version (ground truth):
/** 
 * Sets all JVM options (-X.. -D..) in an environment var JAVA_OPTS. <p> That variable is constructed from getJavaOpts(), then wrapped _unescaped_ in double quotes. An error is thrown if there is an unescaped double quote in the string. All other unescaped characters are permitted, but unless $var expansion or `command` execution is desired (although this is not confirmed as supported) the generally caller should escape any such characters, for example using   {@link StringEscapeUtils#escapeLiteralForDoubleQuotedBash(String)}.
 */
@Override public Map<String,String> getShellEnvironment(){
  for (  String it : getJavaOpts()) {
    StringEscapeUtils.assertValidForDoubleQuotingInBash(it);
  }
  String sJavaOpts=Joiner.on("String_Node_Str").join(getJavaOpts());
  return MutableMap.<String,String>builder().putAll(super.getShellEnvironment()).put("String_Node_Str",sJavaOpts).build();
}
Program: 79695
Project: 79695
Buggy source:
@Test(enabled=true) public void testInferFormatClass() throws Exception {
  DeployCommand cmd=new DeployCommand();
  cmd.app="String_Node_Str";
  assertEquals(cmd.inferAppFormat(cmd.app),DeployCommand.CLASS_FORMAT);
}

Fixed version (ground truth):
@Test(enabled=true) public void testInferFormatClass() throws Exception {
  String inferredCommand=cmd.inferAppFormat("String_Node_Str");
  assertEquals(inferredCommand,DeployCommand.CLASS_FORMAT);
}
Program: 79696
Project: 79696
Buggy source:
@Test(enabled=true) public void testInferFormatGroovy() throws Exception {
  DeployCommand cmd=new DeployCommand();
  cmd.app="String_Node_Str";
  assertEquals(cmd.format,DeployCommand.GROOVY_FORMAT);
}

Fixed version (ground truth):
@Test(enabled=true) public void testInferFormatGroovy() throws Exception {
  String inferredCommand=cmd.inferAppFormat("String_Node_Str");
  assertEquals(inferredCommand,DeployCommand.GROOVY_FORMAT);
}
Program: 79697
Project: 79697
Buggy source:
@Test(enabled=true) public void testInferFormatJson() throws Exception {
  DeployCommand cmd=new DeployCommand();
  cmd.app="String_Node_Str";
  assertEquals(cmd.format,DeployCommand.JSON_FORMAT);
  DeployCommand cmd2=new DeployCommand();
  cmd2.app="String_Node_Str";
  assertEquals(cmd.format,DeployCommand.JSON_FORMAT);
}

Fixed version (ground truth):
@Test(enabled=true) public void testInferFormatJson() throws Exception {
  String inferredCommand1=cmd.inferAppFormat("String_Node_Str");
  assertEquals(inferredCommand1,DeployCommand.JSON_FORMAT);
  String inferredCommand2=cmd.inferAppFormat("String_Node_Str");
  assertEquals(inferredCommand2,DeployCommand.JSON_FORMAT);
}
Program: 79698
Project: 79698
Buggy source:
protected SshTool connectSsh(Map props){
  if (!truth(user))   user=System.getProperty("String_Node_Str");
  Map<?,?> allprops=ImmutableMap.builder().putAll(config).putAll(leftoverProperties).putAll(props).build();
  Map<String,Object> args=MutableMap.<String,Object>of("String_Node_Str",user,"String_Node_Str",address.getHostName());
  for (  Map.Entry<?,?> entry : allprops.entrySet()) {
    String k="String_Node_Str" + entry.getKey();
    Object v=entry.getValue();
    if (SSH_PROPS.contains(k)) {
      args.put(k,v);
    }
 else     if (k.startsWith(SSHCONFIG_PREFIX + "String_Node_Str")) {
      args.put(k.substring(SSHCONFIG_PREFIX.length() + 1),v);
    }
 else {
      if (!NON_SSH_PROPS.contains(k)) {
        LOG.warn("String_Node_Str" + k + "String_Node_Str"+ this+ "String_Node_Str");
        args.put(k,v);
      }
    }
  }
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + args);
  SshTool ssh=new SshjTool(args);
  ssh.connect();
  return ssh;
}

Fixed version (ground truth):
protected SshTool connectSsh(Map props){
  if (!truth(user))   user=System.getProperty("String_Node_Str");
  Map<?,?> allprops=MutableMap.builder().putAll(config).putAll(leftoverProperties).putAll(props).build();
  Map<String,Object> args=MutableMap.<String,Object>of("String_Node_Str",user,"String_Node_Str",address.getHostName());
  for (  Map.Entry<?,?> entry : allprops.entrySet()) {
    String k="String_Node_Str" + entry.getKey();
    Object v=entry.getValue();
    if (SSH_PROPS.contains(k)) {
      args.put(k,v);
    }
 else     if (k.startsWith(SSHCONFIG_PREFIX + "String_Node_Str")) {
      args.put(k.substring(SSHCONFIG_PREFIX.length() + 1),v);
    }
 else {
      if (!NON_SSH_PROPS.contains(k)) {
        LOG.warn("String_Node_Str" + k + "String_Node_Str"+ this+ "String_Node_Str");
        args.put(k,v);
      }
    }
  }
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + args);
  SshTool ssh=new SshjTool(args);
  ssh.connect();
  return ssh;
}
Program: 79699
Project: 79699
Buggy source:
public ImmutableMap<K,V> toImmutable(){
  return ImmutableMap.<K,V>builder().putAll(this).build();
}

Fixed version (ground truth):
public ImmutableMap<K,V> toImmutable(){
  return ImmutableMap.copyOf(this);
}
Program: 79700
Project: 79700
Buggy source:
private void onContainerAdded(Entity newContainer){
  subscribe(newContainer,Startable.SERVICE_UP,eventHandler);
  if (!(newContainer instanceof Startable) || newContainer.getAttribute(Startable.SERVICE_UP)) {
    onContainerUp(newContainer);
  }
}

Fixed version (ground truth):
private void onContainerAdded(Entity newContainer){
  subscribe(newContainer,Startable.SERVICE_UP,eventHandler);
  if (!(newContainer instanceof Startable) || Boolean.TRUE.equals(newContainer.getAttribute(Startable.SERVICE_UP))) {
    onContainerUp(newContainer);
  }
}
Program: 79701
Project: 79701
Buggy source:
private void onContainerAdded(BalanceableContainer<?> newContainer){
  subscribe(newContainer,Startable.SERVICE_UP,eventHandler);
  if (!(newContainer instanceof Startable) || newContainer.getAttribute(Startable.SERVICE_UP)) {
    onContainerUp(newContainer);
  }
}

Fixed version (ground truth):
private void onContainerAdded(BalanceableContainer<?> newContainer){
  subscribe(newContainer,Startable.SERVICE_UP,eventHandler);
  if (!(newContainer instanceof Startable) || Boolean.TRUE.equals(newContainer.getAttribute(Startable.SERVICE_UP))) {
    onContainerUp(newContainer);
  }
}
Program: 79703
Project: 79703
Buggy source:
protected String getEntityVersionLabel(String separator){
  return elvis(entity.getClass().getSimpleName(),entity.getClass().getName()) + (getVersion() != NO_VERSION_INFO ? separator + getVersion() : "String_Node_Str");
}

Fixed version (ground truth):
protected String getEntityVersionLabel(String separator){
  return elvis(entity.getClass().getSimpleName(),entity.getClass().getName()) + (!getVersion().equals(NO_VERSION_INFO) ? separator + getVersion() : "String_Node_Str");
}
Program: 79704
Project: 79704
Buggy source:
@Override public Void call() throws Exception {
  log.debug("String_Node_Str");
  if (verbose) {
    System.out.println("String_Node_Str" + app + "String_Node_Str"+ Iterables.toString(locations));
  }
  ResourceUtils utils=new ResourceUtils(this);
  ClassLoader parent=utils.getLoader();
  GroovyClassLoader loader=new GroovyClassLoader(parent);
  log.debug("String_Node_Str",app);
  AbstractApplication application=loadApplicationFromClasspathOrParse(utils,loader,app);
  if (script != null) {
    log.debug("String_Node_Str",script);
    String content=utils.getResourceAsString(script);
    GroovyShell shell=new GroovyShell(loader);
    shell.evaluate(content);
  }
  List<Location> brooklynLocations=new LocationRegistry().getLocationsById((locations == null || Iterables.isEmpty(locations)) ? ImmutableSet.of(CommandLineLocations.LOCALHOST) : locations);
  log.info("String_Node_Str");
  BrooklynLauncher.manage(application,port,!noShutdownOnExit,!noConsole);
  log.info("String_Node_Str",app);
  application.start(brooklynLocations);
  if (verbose) {
    Entities.dumpInfo(application);
  }
  if (stopOnKeyPress) {
    log.info("String_Node_Str");
    System.in.read();
    application.stop();
  }
 else {
    log.info("String_Node_Str");
    waitUntilInterrupted();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  log.debug("String_Node_Str");
  if (verbose) {
    System.out.println("String_Node_Str" + app + "String_Node_Str"+ locations);
  }
  ResourceUtils utils=new ResourceUtils(this);
  ClassLoader parent=utils.getLoader();
  GroovyClassLoader loader=new GroovyClassLoader(parent);
  log.debug("String_Node_Str",app);
  AbstractApplication application=loadApplicationFromClasspathOrParse(utils,loader,app);
  if (script != null) {
    log.debug("String_Node_Str",script);
    String content=utils.getResourceAsString(script);
    GroovyShell shell=new GroovyShell(loader);
    shell.evaluate(content);
  }
  Iterable<String> parsedLocations=Splitter.on("String_Node_Str").split(locations);
  List<Location> brooklynLocations=new LocationRegistry().getLocationsById((parsedLocations == null || Iterables.isEmpty(parsedLocations)) ? ImmutableSet.of(CommandLineLocations.LOCALHOST) : parsedLocations);
  log.info("String_Node_Str");
  BrooklynLauncher.manage(application,port,!noShutdownOnExit,!noConsole);
  log.info("String_Node_Str",app,brooklynLocations);
  application.start(brooklynLocations);
  if (verbose) {
    Entities.dumpInfo(application);
  }
  if (stopOnKeyPress) {
    log.info("String_Node_Str");
    System.in.read();
    application.stop();
  }
 else {
    log.info("String_Node_Str");
    waitUntilInterrupted();
  }
  return null;
}
Program: 79705
Project: 79705
Buggy source:
@Override public Void call() throws Exception {
  if (verbose) {
    System.out.println("String_Node_Str" + app + "String_Node_Str"+ Iterables.toString(locations));
  }
  ResourceUtils utils=new ResourceUtils(this);
  ClassLoader parent=utils.getLoader();
  GroovyClassLoader loader=new GroovyClassLoader(parent);
  AbstractApplication application=loadApplicationFromClasspathOrParse(utils,loader,app);
  if (script != null) {
    String content=utils.getResourceAsString(script);
    GroovyShell shell=new GroovyShell(loader);
    shell.evaluate(content);
  }
  List<Location> brooklynLocations=new LocationRegistry().getLocationsById(locations);
  BrooklynLauncher.manage(application,port,!noShutdownOnExit,!noConsole);
  application.start(brooklynLocations);
  if (verbose) {
    Entities.dumpInfo(application);
  }
  waitUntilInterrupted();
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  if (verbose) {
    System.out.println("String_Node_Str" + app + "String_Node_Str"+ Iterables.toString(locations));
  }
  ResourceUtils utils=new ResourceUtils(this);
  ClassLoader parent=utils.getLoader();
  GroovyClassLoader loader=new GroovyClassLoader(parent);
  AbstractApplication application=loadApplicationFromClasspathOrParse(utils,loader,app);
  if (script != null) {
    String content=utils.getResourceAsString(script);
    GroovyShell shell=new GroovyShell(loader);
    shell.evaluate(content);
  }
  List<Location> brooklynLocations=new LocationRegistry().getLocationsById(Iterables.isEmpty(locations) ? ImmutableSet.of(CommandLineLocations.LOCALHOST) : locations);
  BrooklynLauncher.manage(application,port,!noShutdownOnExit,!noConsole);
  application.start(brooklynLocations);
  if (verbose) {
    Entities.dumpInfo(application);
  }
  waitUntilInterrupted();
  return null;
}
Program: 79706
Project: 79706
Buggy source:
/** 
 * @see SubscriptionContext#subscribeToMembers(Entity,Sensor,SensorEventListener) 
 */
public <T>SubscriptionHandle subscribeToMembers(Entity parent,Sensor<T> sensor,SensorEventListener<? super T> listener){
  SubscriptionHandle handle=subscription.subscribeToMembers(parent,sensor,listener);
  subscriptions.put(parent,handle);
  return handle;
}

Fixed version (ground truth):
/** 
 * @see SubscriptionContext#subscribeToMembers(Entity,Sensor,SensorEventListener) 
 */
public <T>SubscriptionHandle subscribeToMembers(Group parent,Sensor<T> sensor,SensorEventListener<? super T> listener){
  SubscriptionHandle handle=subscription.subscribeToMembers(parent,sensor,listener);
  subscriptions.put(parent,handle);
  return handle;
}
Program: 79709
Project: 79709
Buggy source:
public void exportTable(File file,boolean isFullLog,boolean append,boolean header) throws IOException {
  FileWriter out=new FileWriter(file,append);
  if (header) {
    out.write(LogEntry.getCSVHeader(LoggerPlusPlus.getInstance().getLogTable(),isFullLog));
    out.write("String_Node_Str");
  }
  for (  LogEntry item : LoggerPlusPlus.getInstance().getLogManager().getLogEntries()) {
    out.write(item.toCSVString(isFullLog) + "String_Node_Str");
  }
  out.close();
  MoreHelp.showMessage("String_Node_Str" + file.getAbsolutePath() + file.getName());
}

Fixed version (ground truth):
public void exportTable(File file,boolean isFullLog,boolean append,boolean header) throws IOException {
  FileWriter out=new FileWriter(file,append);
  if (header) {
    out.write(LogEntry.getCSVHeader(LoggerPlusPlus.getInstance().getLogTable(),isFullLog));
    out.write("String_Node_Str");
  }
  for (  LogEntry item : LoggerPlusPlus.getInstance().getLogManager().getLogEntries()) {
    out.write(item.toCSVString(isFullLog) + "String_Node_Str");
  }
  out.close();
  MoreHelp.showMessage("String_Node_Str" + file.getAbsolutePath());
}
Program: 79710
Project: 79710
Buggy source:
public String toCSVString(boolean isFullLog){
  StringBuilder result=new StringBuilder();
  LogTableColumnModel columnModel=LoggerPlusPlus.getInstance().getLogTable().getColumnModel();
  ArrayList<LogTableColumn> columns=columnModel.getAllColumns();
  Collections.sort(columns);
  short count=0;
  for (  LogTableColumn logTableColumn : columns) {
    if (logTableColumn.isVisible() && logTableColumn.isEnabled()) {
      result.append(StringEscapeUtils.escapeCsv(getValue(logTableColumn.getIdentifier()).toString()));
      if (count < columnModel.getColumnCount() - 1)       result.append("String_Node_Str");
    }
    count++;
  }
  if (isFullLog) {
    result.append("String_Node_Str");
    if (requestResponse != null && requestResponse.getRequest() != null)     result.append(StringEscapeUtils.escapeCsv(new String(requestResponse.getRequest())));
    result.append("String_Node_Str");
    if (requestResponse != null && requestResponse.getResponse() != null)     result.append(StringEscapeUtils.escapeCsv(new String(requestResponse.getResponse())));
  }
  return result.toString();
}

Fixed version (ground truth):
public String toCSVString(boolean isFullLog){
  StringBuilder result=new StringBuilder();
  LogTableColumnModel columnModel=LoggerPlusPlus.getInstance().getLogTable().getColumnModel();
  ArrayList<LogTableColumn> columns=columnModel.getAllColumns();
  Collections.sort(columns);
  boolean firstDone=false;
  for (  LogTableColumn logTableColumn : columns) {
    if (logTableColumn.isVisible() && logTableColumn.isEnabled()) {
      if (firstDone) {
        result.append("String_Node_Str");
      }
 else {
        firstDone=true;
      }
      result.append(StringEscapeUtils.escapeCsv(getValue(logTableColumn.getIdentifier()).toString()));
    }
  }
  if (isFullLog) {
    result.append("String_Node_Str");
    if (requestResponse != null && requestResponse.getRequest() != null)     result.append(StringEscapeUtils.escapeCsv(new String(requestResponse.getRequest())));
    result.append("String_Node_Str");
    if (requestResponse != null && requestResponse.getResponse() != null)     result.append(StringEscapeUtils.escapeCsv(new String(requestResponse.getResponse())));
  }
  return result.toString();
}
Program: 79711
Project: 79711
Buggy source:
public static String getCSVHeader(LogTable table,boolean isFullLog){
  StringBuilder result=new StringBuilder();
  short count=0;
  ArrayList<LogTableColumn> columns=table.getColumnModel().getAllColumns();
  Collections.sort(columns);
  for (  LogTableColumn logTableColumn : columns) {
    if (logTableColumn.isVisible() && logTableColumn.isEnabled()) {
      result.append(logTableColumn.getName());
      if (count < columns.size() - 1)       result.append("String_Node_Str");
    }
    count++;
  }
  if (isFullLog) {
    result.append("String_Node_Str");
    result.append("String_Node_Str");
    result.append("String_Node_Str");
    result.append("String_Node_Str");
  }
  return result.toString();
}

Fixed version (ground truth):
public static String getCSVHeader(LogTable table,boolean isFullLog){
  StringBuilder result=new StringBuilder();
  boolean firstDone=false;
  ArrayList<LogTableColumn> columns=table.getColumnModel().getAllColumns();
  Collections.sort(columns);
  for (  LogTableColumn logTableColumn : columns) {
    if (logTableColumn.isVisible() && logTableColumn.isEnabled()) {
      if (firstDone) {
        result.append("String_Node_Str");
      }
 else {
        firstDone=true;
      }
      result.append(logTableColumn.getName());
    }
  }
  if (isFullLog) {
    result.append("String_Node_Str");
    result.append("String_Node_Str");
    result.append("String_Node_Str");
    result.append("String_Node_Str");
  }
  return result.toString();
}