nus-yam/ex-repair huggingface dataset:
Program: 141506
Project: 141506
Buggy source:
@Test public void timestamp_is_required(){
  givenWithContent(authToken).body(minValidPayload().put(Key.TIMESTAMP,null).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is(Key.TIMESTAMP)).body("String_Node_Str",is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void timestamp_is_required(){
  givenWithContent(authToken).body(minValidPayload().put(Key.TIMESTAMP,null).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is("String_Node_Str" + Key.TIMESTAMP)).body("String_Node_Str",is("String_Node_Str"));
}
Program: 141507
Project: 141507
Buggy source:
@Test public void usage_is_required(){
  givenWithContent(authToken).body(minValidPayload().put(Key.USAGE,null).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is(Key.USAGE)).body("String_Node_Str",is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void usage_is_required(){
  givenWithContent(authToken).body(minValidPayload().put(Key.USAGE,null).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is("String_Node_Str" + Key.USAGE)).body("String_Node_Str",is("String_Node_Str"));
}
Program: 141508
Project: 141508
Buggy source:
@Test public void spaces_available_is_required(){
  givenWithContent(authToken).body(minValidPayload().put(Key.SPACES_AVAILABLE,null).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is(Key.SPACES_AVAILABLE)).body("String_Node_Str",is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void spaces_available_is_required(){
  givenWithContent(authToken).body(minValidPayload().put(Key.SPACES_AVAILABLE,null).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is("String_Node_Str" + Key.SPACES_AVAILABLE)).body("String_Node_Str",is("String_Node_Str"));
}
Program: 141509
Project: 141509
Buggy source:
@Test public void facility_id_in_playload_cannot_be_different_from_facility_id_in_path(){
  givenWithContent(authToken).body(minValidPayload().put(Key.FACILITY_ID,f.id + 1).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is(Key.FACILITY_ID)).body("String_Node_Str",is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void facility_id_in_playload_cannot_be_different_from_facility_id_in_path(){
  givenWithContent(authToken).body(minValidPayload().put(Key.FACILITY_ID,f.id + 1).asArray()).when().put(UrlSchema.FACILITY_UTILIZATION,f.id).then().spec(assertResponse(HttpStatus.BAD_REQUEST,ValidationException.class)).body("String_Node_Str",is("String_Node_Str" + Key.FACILITY_ID)).body("String_Node_Str",is("String_Node_Str"));
}
Program: 141510
Project: 141510
Buggy source:
@Override public T deserialize(JsonParser jp,DeserializationContext ctxt) throws IOException, JsonProcessingException {
  try {
    return jsonMapper.fromJson(jp.readValueAsTree().toString(),type);
  }
 catch (  JsonException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override public T deserialize(JsonParser jp,DeserializationContext ctxt) throws IOException, JsonProcessingException {
  try {
    return jsonMapper.fromJson(jp.readValueAsTree().toString(),type);
  }
 catch (  JsonException e) {
    throw new JsonMappingException(e.getMessage(),jp.getCurrentLocation(),e.getCause());
  }
}
Program: 141511
Project: 141511
Buggy source:
@Bean public ExceptionHandlerExceptionResolver exceptionHandlerExceptionResolver(){
  return new ExceptionHandlerExceptionResolver();
}

Fixed version (ground truth):
@Bean public ExceptionHandlerExceptionResolver exceptionHandlerExceptionResolver(){
  ExceptionHandlerExceptionResolver resolver=new ExceptionHandlerExceptionResolver();
  resolver.setMessageConverters(messageConverters.getConverters());
  return resolver;
}
Program: 141512
Project: 141512
Buggy source:
public ValidationException(Iterable<Violation> violations){
  this.violations=ImmutableList.copyOf(violations);
}

Fixed version (ground truth):
public ValidationException(Iterable<Violation> violations){
  super("String_Node_Str");
  this.violations=ImmutableList.copyOf(violations);
}
Program: 141513
Project: 141513
Buggy source:
private void setLocaleWith(Locale locale) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException {
  Class<?> activityManagerNativeClass=Class.forName("String_Node_Str");
  Object amn;
  Configuration config;
  Method methodGetDefault=activityManagerNativeClass.getMethod("String_Node_Str");
  methodGetDefault.setAccessible(true);
  amn=methodGetDefault.invoke(activityManagerNativeClass);
  Method methodGetConfiguration=activityManagerNativeClass.getMethod("String_Node_Str");
  methodGetConfiguration.setAccessible(true);
  config=(Configuration)methodGetConfiguration.invoke(amn);
  Class<?> configClass=config.getClass();
  Field f=configClass.getField("String_Node_Str");
  f.setBoolean(config,true);
  config.locale=locale;
  Method methodUpdateConfiguration=activityManagerNativeClass.getMethod("String_Node_Str",Configuration.class);
  methodUpdateConfiguration.setAccessible(true);
  methodUpdateConfiguration.invoke(amn,config);
}

Fixed version (ground truth):
private void setLocaleWith(Locale locale) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException {
  Class<?> activityManagerNativeClass=Class.forName("String_Node_Str");
  Object amn;
  Configuration config;
  Method methodGetDefault=activityManagerNativeClass.getMethod("String_Node_Str");
  methodGetDefault.setAccessible(true);
  amn=methodGetDefault.invoke(activityManagerNativeClass);
  if (Build.VERSION.SDK_INT >= 26) {
    activityManagerNativeClass=Class.forName(amn.getClass().getName());
  }
  Method methodGetConfiguration=activityManagerNativeClass.getMethod("String_Node_Str");
  methodGetConfiguration.setAccessible(true);
  config=(Configuration)methodGetConfiguration.invoke(amn);
  Class<?> configClass=config.getClass();
  Field f=configClass.getField("String_Node_Str");
  f.setBoolean(config,true);
  config.locale=locale;
  Method methodUpdateConfiguration=activityManagerNativeClass.getMethod("String_Node_Str",Configuration.class);
  methodUpdateConfiguration.setAccessible(true);
  methodUpdateConfiguration.invoke(amn,config);
}
Program: 141514
Project: 141514
Buggy source:
public LocaleSettingHandler(Context context){
  this.context=context;
}

Fixed version (ground truth):
public LocaleSettingHandler(Context context){
  super(context,CHANGE_CONFIGURATION);
}
Program: 141516
Project: 141516
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Void beforeCommit(ImprovedTransactionData transactionData){
  changeWriter.recordChanges(transactionData.mutationsToStrings());
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Void beforeCommit(ImprovedTransactionData transactionData){
  if (transactionData.hasBeenDeleted(changeWriter.getRoot())) {
    throw new DeliberateTransactionRollbackException("String_Node_Str");
  }
  changeWriter.recordChanges(transactionData.mutationsToStrings());
  return null;
}
Program: 141517
Project: 141517
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + uuid + '\''+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ ArrayUtils.primitiveOrStringArrayToString(changes)+ '}';
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + uuid + '\''+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ ArrayUtils.primitiveOrStringArrayToString(getChangesAsArray())+ '}';
}
Program: 141518
Project: 141518
Buggy source:
/** 
 * Get the root.
 * @return root, will never be null.
 */
private Node getRoot(){
  if (root == null) {
    throw new IllegalStateException("String_Node_Str" + moduleId + "String_Node_Str");
  }
  return root;
}

Fixed version (ground truth):
/** 
 * Get the root.
 * @return root, will never be null.
 */
public Node getRoot(){
  if (root == null) {
    throw new IllegalStateException("String_Node_Str" + moduleId + "String_Node_Str");
  }
  return root;
}
Program: 141519
Project: 141519
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int hashCode(){
  int result=super.hashCode();
  result=31 * result + maxChanges;
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int hashCode(){
  int result=super.hashCode();
  result=31 * result + maxChanges;
  result=31 * result + pruneDelay;
  result=31 * result + pruneWhenMaxExceededBy;
  return result;
}
Program: 141520
Project: 141520
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  if (!super.equals(o))   return false;
  ChangeFeedConfiguration that=(ChangeFeedConfiguration)o;
  if (maxChanges != that.maxChanges)   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  if (!super.equals(o))   return false;
  ChangeFeedConfiguration that=(ChangeFeedConfiguration)o;
  if (maxChanges != that.maxChanges)   return false;
  if (pruneDelay != that.pruneDelay)   return false;
  if (pruneWhenMaxExceededBy != that.pruneWhenMaxExceededBy)   return false;
  return true;
}
Program: 141521
Project: 141521
Buggy source:
/** 
 * Initialize the sequence to the last used number. No need to synchronize, called from constructor, thus in a single thread.
 */
private void initializeSequence(){
  int startSequence=0;
  try (Transaction tx=database.beginTx()){
    Relationship nextRel=getRoot().getSingleRelationship(_GA_CHANGEFEED_NEXT_CHANGE,OUTGOING);
    if (nextRel != null) {
      startSequence=(Integer)nextRel.getEndNode().getProperty(SEQUENCE);
    }
    tx.success();
  }
   sequence=new AtomicInteger(startSequence);
}

Fixed version (ground truth):
/** 
 * Initialize the sequence to the last used number. No need to synchronize, called from constructor, thus in a single thread.
 */
private void initializeSequence(){
  long startSequence=0L;
  try (Transaction tx=database.beginTx()){
    Relationship nextRel=getRoot().getSingleRelationship(_GA_CHANGEFEED_NEXT_CHANGE,OUTGOING);
    if (nextRel != null) {
      startSequence=(long)nextRel.getEndNode().getProperty(SEQUENCE,0L);
    }
    tx.success();
  }
   sequence=new AtomicLong(startSequence);
}
Program: 141522
Project: 141522
Buggy source:
@Test public void feedShouldBeEmptyOnANewDatabase(){
  registerSingleModuleAndCreateReader();
  assertEquals(0,new GraphChangeReader(getDatabase()).getAllChanges().size());
  assertEquals(0,new GraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
  assertEquals(0,new CachingGraphChangeReader(getDatabase()).getAllChanges().size());
  assertEquals(0,new CachingGraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
}

Fixed version (ground truth):
@Test public void feedShouldBeEmptyOnANewDatabase(){
  registerSingleModuleAndStart();
  assertEquals(0,new GraphChangeReader(getDatabase()).getAllChanges().size());
  assertEquals(0,new GraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
  assertEquals(0,new CachingGraphChangeReader(getDatabase()).getAllChanges().size());
  assertEquals(0,new CachingGraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
}
Program: 141523
Project: 141523
Buggy source:
@Test public void shouldBeAbleToRegisterMultipleModules(){
}

Fixed version (ground truth):
@Test public void shouldBeAbleToRegisterMultipleModules(){
  registerMultipleModulesAndStart();
  try (Transaction tx=getDatabase().beginTx()){
    getDatabase().createNode(DynamicLabel.label("String_Node_Str"));
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    getDatabase().createNode(DynamicLabel.label("String_Node_Str"));
    tx.success();
  }
   assertEquals(1,new CachingGraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
  assertEquals(1,new GraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
  assertEquals(2,new CachingGraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
  assertEquals(2,new GraphChangeReader(getDatabase(),"String_Node_Str").getAllChanges().size());
}
Program: 141524
Project: 141524
Buggy source:
@Test public void transactionsNotCommittedShouldNotReflectInTheChangeFeed(){
  registerSingleModuleAndCreateReader();
  performChangesWithException();
  Collection<ChangeSet> changes=new GraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  Iterator<ChangeSet> it=changes.iterator();
  ChangeSet set1=it.next();
  long set1Date=set1.getTimestamp();
  assertEquals(1,set1.getChanges().size());
  assertTrue(set1.getChanges().contains("String_Node_Str"));
  assertEquals(set1.getSequence(),2);
  ChangeSet set2=it.next();
  long set2Date=set2.getTimestamp();
  assertEquals(3,set2.getChanges().size());
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertEquals(1,set2.getSequence());
  assertTrue(set1Date >= set2Date);
}

Fixed version (ground truth):
@Test public void transactionsNotCommittedShouldNotReflectInTheChangeFeed(){
  registerSingleModuleAndStart();
  performChangesWithException();
  Collection<ChangeSet> changes=new GraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  Iterator<ChangeSet> it=changes.iterator();
  ChangeSet set1=it.next();
  long set1Date=set1.getTimestamp();
  assertEquals(1,set1.getChanges().size());
  assertTrue(set1.getChanges().contains("String_Node_Str"));
  assertEquals(set1.getSequence(),2);
  ChangeSet set2=it.next();
  long set2Date=set2.getTimestamp();
  assertEquals(3,set2.getChanges().size());
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertEquals(1,set2.getSequence());
  assertTrue(set1Date >= set2Date);
}
Program: 141525
Project: 141525
Buggy source:
@Test public void sequenceNumbersShouldBeOrdered() throws InterruptedException {
  registerSingleModuleAndCreateReader();
  getDatabase().registerTransactionEventHandler(new TransactionEventHandler.Adapter<Void>(){
    protected volatile boolean hasRun=false;
    @Override public Void beforeCommit(    TransactionData data) throws Exception {
      if (!hasRun) {
        hasRun=true;
        Thread.sleep(100);
      }
      return null;
    }
  }
);
  ExecutorService executor=Executors.newFixedThreadPool(2);
  executor.submit(new Runnable(){
    @Override public void run(){
      try (Transaction tx=getDatabase().beginTx()){
        getDatabase().createNode().setProperty("String_Node_Str","String_Node_Str");
        tx.success();
      }
     }
  }
);
  executor.submit(new Runnable(){
    @Override public void run(){
      try (Transaction tx=getDatabase().beginTx()){
        getDatabase().createNode().setProperty("String_Node_Str","String_Node_Str");
        tx.success();
      }
     }
  }
);
  executor.shutdown();
  executor.awaitTermination(1000,TimeUnit.MILLISECONDS);
  Collection<ChangeSet> changes=new GraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  Iterator<ChangeSet> it=changes.iterator();
  assertEquals(2,it.next().getSequence());
  assertEquals(1,it.next().getSequence());
  changes=new CachingGraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  it=changes.iterator();
  assertEquals(2,it.next().getSequence());
  assertEquals(1,it.next().getSequence());
}

Fixed version (ground truth):
@Test public void sequenceNumbersShouldBeOrdered() throws InterruptedException {
  registerSingleModuleAndStart();
  getDatabase().registerTransactionEventHandler(new TransactionEventHandler.Adapter<Void>(){
    protected volatile boolean hasRun=false;
    @Override public Void beforeCommit(    TransactionData data) throws Exception {
      if (!hasRun) {
        hasRun=true;
        Thread.sleep(100);
      }
      return null;
    }
  }
);
  ExecutorService executor=Executors.newFixedThreadPool(2);
  executor.submit(new Runnable(){
    @Override public void run(){
      try (Transaction tx=getDatabase().beginTx()){
        getDatabase().createNode().setProperty("String_Node_Str","String_Node_Str");
        tx.success();
      }
     }
  }
);
  executor.submit(new Runnable(){
    @Override public void run(){
      try (Transaction tx=getDatabase().beginTx()){
        getDatabase().createNode().setProperty("String_Node_Str","String_Node_Str");
        tx.success();
      }
     }
  }
);
  executor.shutdown();
  executor.awaitTermination(1000,TimeUnit.MILLISECONDS);
  Collection<ChangeSet> changes=new GraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  Iterator<ChangeSet> it=changes.iterator();
  assertEquals(2,it.next().getSequence());
  assertEquals(1,it.next().getSequence());
  changes=new CachingGraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  it=changes.iterator();
  assertEquals(2,it.next().getSequence());
  assertEquals(1,it.next().getSequence());
}
Program: 141527
Project: 141527
Buggy source:
@Test public void transactionsNotCommittedShouldNotReflectInCachedChangeFeed(){
  registerSingleModuleAndCreateReader();
  performChangesWithException();
  Collection<ChangeSet> changes=new CachingGraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  Iterator<ChangeSet> it=changes.iterator();
  ChangeSet set1=it.next();
  long set1Date=set1.getTimestamp();
  assertEquals(1,set1.getChanges().size());
  assertTrue(set1.getChanges().contains("String_Node_Str"));
  assertEquals(set1.getSequence(),2);
  ChangeSet set2=it.next();
  long set2Date=set2.getTimestamp();
  assertEquals(3,set2.getChanges().size());
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertEquals(1,set2.getSequence());
  assertTrue(set1Date >= set2Date);
}

Fixed version (ground truth):
@Test public void transactionsNotCommittedShouldNotReflectInCachedChangeFeed(){
  registerSingleModuleAndStart();
  performChangesWithException();
  Collection<ChangeSet> changes=new CachingGraphChangeReader(getDatabase()).getAllChanges();
  assertEquals(2,changes.size());
  Iterator<ChangeSet> it=changes.iterator();
  ChangeSet set1=it.next();
  long set1Date=set1.getTimestamp();
  assertEquals(1,set1.getChanges().size());
  assertTrue(set1.getChanges().contains("String_Node_Str"));
  assertEquals(set1.getSequence(),2);
  ChangeSet set2=it.next();
  long set2Date=set2.getTimestamp();
  assertEquals(3,set2.getChanges().size());
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertTrue(set2.getChanges().contains("String_Node_Str"));
  assertEquals(1,set2.getSequence());
  assertTrue(set1Date >= set2Date);
}
Program: 141528
Project: 141528
Buggy source:
@Test public void changeRootShouldHavePointerToOldestChange(){
  registerSingleModuleAndCreateReader();
  performModifications();
  try (Transaction tx=getDatabase().beginTx()){
    Node changeRoot=getSingleOrNull(at(getDatabase()).getAllNodesWithLabel(Labels._GA_ChangeFeed));
    assertNotNull(changeRoot);
    Relationship rel=changeRoot.getSingleRelationship(Relationships._GA_CHANGEFEED_OLDEST_CHANGE,Direction.OUTGOING);
    assertNotNull(rel);
    assertEquals(1L,rel.getEndNode().getProperty(SEQUENCE));
    tx.success();
  }
 }

Fixed version (ground truth):
@Test public void changeRootShouldHavePointerToOldestChange(){
  registerSingleModuleAndStart();
  performModifications();
  try (Transaction tx=getDatabase().beginTx()){
    Node changeRoot=getSingleOrNull(at(getDatabase()).getAllNodesWithLabel(Labels._GA_ChangeFeed));
    assertNotNull(changeRoot);
    Relationship rel=changeRoot.getSingleRelationship(Relationships._GA_CHANGEFEED_OLDEST_CHANGE,Direction.OUTGOING);
    assertNotNull(rel);
    assertEquals(1L,rel.getEndNode().getProperty(SEQUENCE));
    tx.success();
  }
 }
Program: 141529
Project: 141529
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void pruneChanges(int keep,int mustBeExceededBy){
  try (Transaction tx=database.beginTx()){
    Relationship oldestChangeRel=getRoot().getSingleRelationship(_GA_CHANGEFEED_OLDEST_CHANGE,OUTGOING);
    if (oldestChangeRel != null) {
      Node oldestNode=oldestChangeRel.getEndNode();
      Node newestNode=getRoot().getSingleRelationship(_GA_CHANGEFEED_NEXT_CHANGE,OUTGOING).getEndNode();
      if (newestNode != null) {
        long highSequence=(long)newestNode.getProperty(SEQUENCE);
        long lowSequence=(long)oldestNode.getProperty(SEQUENCE);
        long nodesToDelete=((highSequence - lowSequence) + 1) - keep;
        Node newOldestNode=null;
        if (nodesToDelete >= mustBeExceededBy) {
          LOG.info("String_Node_Str",nodesToDelete);
          getRoot().getSingleRelationship(_GA_CHANGEFEED_OLDEST_CHANGE,OUTGOING).delete();
          while (nodesToDelete > 0) {
            Relationship rel=oldestNode.getSingleRelationship(_GA_CHANGEFEED_NEXT_CHANGE,INCOMING);
            newOldestNode=rel.getStartNode();
            rel.delete();
            oldestNode.delete();
            oldestNode=newOldestNode;
            nodesToDelete--;
          }
          getRoot().createRelationshipTo(newOldestNode,_GA_CHANGEFEED_OLDEST_CHANGE);
          LOG.info("String_Node_Str");
        }
      }
    }
    tx.success();
  }
 }

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void pruneChanges(int keep,int mustBeExceededBy){
  try (Transaction tx=database.beginTx()){
    Relationship oldestChangeRel=getRoot().getSingleRelationship(_GA_CHANGEFEED_OLDEST_CHANGE,OUTGOING);
    if (oldestChangeRel != null) {
      Node oldestNode=oldestChangeRel.getEndNode();
      Node newestNode=getRoot().getSingleRelationship(_GA_CHANGEFEED_NEXT_CHANGE,OUTGOING).getEndNode();
      if (newestNode != null) {
        long highSequence=(long)newestNode.getProperty(SEQUENCE);
        long lowSequence=(long)oldestNode.getProperty(SEQUENCE);
        long nodesToDelete=((highSequence - lowSequence) + 1) - keep;
        Node newOldestNode=null;
        if (nodesToDelete >= mustBeExceededBy) {
          LOG.debug("String_Node_Str",nodesToDelete);
          getRoot().getSingleRelationship(_GA_CHANGEFEED_OLDEST_CHANGE,OUTGOING).delete();
          while (nodesToDelete > 0) {
            Relationship rel=oldestNode.getSingleRelationship(_GA_CHANGEFEED_NEXT_CHANGE,INCOMING);
            newOldestNode=rel.getStartNode();
            rel.delete();
            oldestNode.delete();
            oldestNode=newOldestNode;
            nodesToDelete--;
          }
          getRoot().createRelationshipTo(newOldestNode,_GA_CHANGEFEED_OLDEST_CHANGE);
          LOG.debug("String_Node_Str");
        }
      }
    }
    tx.success();
  }
 }
Program: 141530
Project: 141530
Buggy source:
/** 
 * Populate the stack. Please note that the elements are added to the stack in the reverse order than presented by the input parameters. In other words, the first element of the input parameter will be returned first by this stack's iterator.
 * @param elements to populate the stack with.
 */
public void populate(Collection<E> elements){
  this.elements.addAll(elements);
}

Fixed version (ground truth):
/** 
 * Populate the stack. Please note that the elements are added to the stack in the reverse order than presented by the input parameters. In other words, the first element of the input parameter will be returned first by this stack's iterator.
 * @param elements to populate the stack with.
 */
public void populate(Collection<E> elements){
  this.elements.addAll(elements);
  while (this.elements.size() > maxCapacity) {
    this.elements.removeLast();
  }
}
Program: 141531
Project: 141531
Buggy source:
@Override public CommandResult execute(CommandSource sender,CommandContext args) throws CommandException {
  checkPermission(sender,getPermission());
  if (!args.hasAny("String_Node_Str")) {
    checkIfPlayer(sender);
    Player p=(Player)sender;
    p.getInventory().clear();
    Messages.send(sender,"String_Node_Str");
    return CommandResult.success();
  }
 else {
    Player t=args.<Player>getOne("String_Node_Str").get();
    t.getInventory().clear();
    Messages.send(sender,"String_Node_Str","String_Node_Str",VariableUtil.getNameEntity(t));
    Messages.send(sender,"String_Node_Str","String_Node_Str",sender);
    return CommandResult.success();
  }
}

Fixed version (ground truth):
@Override public CommandResult execute(CommandSource sender,CommandContext args) throws CommandException {
  checkPermission(sender,getPermission());
  if (!args.hasAny("String_Node_Str")) {
    checkIfPlayer(sender);
    Player p=(Player)sender;
    p.getInventory().clear();
    Messages.send(sender,"String_Node_Str");
    return CommandResult.success();
  }
 else {
    Player t=args.<Player>getOne("String_Node_Str").get();
    t.getInventory().clear();
    Messages.send(sender,"String_Node_Str","String_Node_Str",VariableUtil.getNameEntity(t));
    Messages.send(t,"String_Node_Str","String_Node_Str",sender);
    return CommandResult.success();
  }
}
Program: 141532
Project: 141532
Buggy source:
@Override public void save(Game arg,List<Warp> data){
  HashMap<UUID,List<Warp>> worldWarps=new HashMap<>();
  for (  Warp warp : data) {
    List<Warp> warps=worldWarps.containsKey(warp.getLocation().getExtent().getUniqueId()) ? worldWarps.get(warp.getLocation().getExtent().getUniqueId()) : new ArrayList<>();
    warps.add(warp);
    worldWarps.put(warp.getLocation().getExtent().getUniqueId(),warps);
  }
  for (  UUID uuid : worldWarps.keySet()) {
    WorldDataFile loader=new WorldDataFile(uuid);
    CommentedConfigurationNode node=loader.get();
    node.getNode("String_Node_Str").getChildrenMap().keySet().forEach(node.getNode("String_Node_Str")::removeChild);
    List<Warp> warps=worldWarps.get(uuid);
    for (    Warp warp : warps) {
      try {
        node.getNode("String_Node_Str",warp.getName()).setValue(TypeToken.of(Warp.class),warp);
      }
 catch (      ObjectMappingException e) {
        ErrorLogger.log(e,"String_Node_Str");
      }
    }
    loader.save(node);
  }
}

Fixed version (ground truth):
@Override public void save(Game arg,List<Warp> data){
  HashMap<UUID,List<Warp>> worldWarps=new HashMap<>();
  for (  Warp warp : data) {
    List<Warp> warps=worldWarps.containsKey(warp.getLocation().getExtent().getUniqueId()) ? worldWarps.get(warp.getLocation().getExtent().getUniqueId()) : new ArrayList<>();
    warps.add(warp);
    worldWarps.put(warp.getLocation().getExtent().getUniqueId(),warps);
  }
  for (  UUID uuid : worldWarps.keySet()) {
    WorldDataFile loader=new WorldDataFile(uuid);
    CommentedConfigurationNode node=loader.get();
    node.getNode("String_Node_Str").setValue(null);
    List<Warp> warps=worldWarps.get(uuid);
    for (    Warp warp : warps) {
      try {
        node.getNode("String_Node_Str",warp.getName()).setValue(TypeToken.of(Warp.class),warp);
      }
 catch (      ObjectMappingException e) {
        ErrorLogger.log(e,"String_Node_Str");
      }
    }
    loader.save(node);
  }
}
Program: 141533
Project: 141533
Buggy source:
@Override public CommandResult execute(CommandSource sender,CommandContext args) throws CommandException {
  checkPermission(sender,WarpPermissions.UC_WARP_DELWARP_BASE);
  Warp warp=args.<Warp>getOne("String_Node_Str").get();
  List<Warp> warps=GlobalData.get(WarpKeys.WARPS).get();
  warps.remove(warp);
  GlobalData.offer(WarpKeys.WARPS,warps);
  sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str","String_Node_Str",warp.getName()));
  return CommandResult.success();
}

Fixed version (ground truth):
@Override public CommandResult execute(CommandSource sender,CommandContext args) throws CommandException {
  checkPermission(sender,WarpPermissions.UC_WARP_DELWARP_BASE);
  Warp warp=args.<Warp>getOne("String_Node_Str").get();
  List<Warp> warps=GlobalData.get(WarpKeys.WARPS).get();
  warps=warps.stream().filter(w -> !w.getName().equalsIgnoreCase(warp.getName())).collect(Collectors.toList());
  GlobalData.offer(WarpKeys.WARPS,warps);
  sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str","String_Node_Str",warp.getName()));
  return CommandResult.success();
}
Program: 141534
Project: 141534
Buggy source:
public void reload(){
  try {
    if (!file.exists()) {
      file.createNewFile();
    }
    loader=HoconConfigurationLoader.builder().setPath(file.toPath()).build();
    node=loader.load();
  }
 catch (  IOException e) {
    ErrorLogger.log(e,"String_Node_Str" + file);
  }
}

Fixed version (ground truth):
public void reload(){
  try {
    if (!file.exists()) {
      file.getParentFile().mkdirs();
      file.createNewFile();
    }
    loader=HoconConfigurationLoader.builder().setPath(file.toPath()).build();
    node=loader.load();
  }
 catch (  IOException e) {
    ErrorLogger.log(e,"String_Node_Str" + file);
  }
}
Program: 141535
Project: 141535
Buggy source:
@Override public Text load(UltimateUser user){
  PlayerDataFile config=new PlayerDataFile(user.getIdentifier());
  CommentedConfigurationNode node=config.get();
  return Messages.toText(node.getNode("String_Node_Str").getString());
}

Fixed version (ground truth):
@Override public Text load(UltimateUser user){
  PlayerDataFile config=new PlayerDataFile(user.getIdentifier());
  CommentedConfigurationNode node=config.get();
  Text name=Messages.toText(node.getNode("String_Node_Str").getString());
  if (name == null)   return null;
  if (!name.toPlain().matches("String_Node_Str")) {
    return null;
  }
  return name;
}
Program: 141536
Project: 141536
Buggy source:
@Override public CommandResult execute(CommandSource sender,CommandContext args) throws CommandException {
  if (!args.hasAny("String_Node_Str")) {
    checkIfPlayer(sender);
    Player p=(Player)sender;
    UltimateUser up=UltimateCore.get().getUserService().getUser(p);
    Text name=TextUtil.replaceColors(args.<String>getOne("String_Node_Str").get(),sender,"String_Node_Str");
    sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str","String_Node_Str",name));
    up.offer(NickKeys.NICKNAME,name);
  }
 else {
    checkPermSuffix(sender,"String_Node_Str");
    Player t=args.<Player>getOne("String_Node_Str").get();
    UltimateUser up=UltimateCore.get().getUserService().getUser(t);
    Text name=TextUtil.replaceColors(args.<String>getOne("String_Node_Str").get(),sender,"String_Node_Str");
    sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str","String_Node_Str",t,"String_Node_Str",name));
    t.sendMessage(Messages.getFormatted(t,"String_Node_Str","String_Node_Str",sender,"String_Node_Str",name));
    up.offer(NickKeys.NICKNAME,name);
  }
  return CommandResult.success();
}

Fixed version (ground truth):
@Override public CommandResult execute(CommandSource sender,CommandContext args) throws CommandException {
  if (!args.hasAny("String_Node_Str")) {
    checkIfPlayer(sender);
    Player p=(Player)sender;
    UltimateUser up=UltimateCore.get().getUserService().getUser(p);
    Text name=TextUtil.replaceColors(args.<String>getOne("String_Node_Str").get(),sender,"String_Node_Str");
    if (!name.toPlain().matches("String_Node_Str")) {
      sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str"));
      return CommandResult.empty();
    }
    sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str","String_Node_Str",name));
    up.offer(NickKeys.NICKNAME,name);
  }
 else {
    checkPermSuffix(sender,"String_Node_Str");
    Player t=args.<Player>getOne("String_Node_Str").get();
    UltimateUser up=UltimateCore.get().getUserService().getUser(t);
    Text name=TextUtil.replaceColors(args.<String>getOne("String_Node_Str").get(),sender,"String_Node_Str");
    if (!name.toPlain().matches("String_Node_Str")) {
      sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str"));
      return CommandResult.empty();
    }
    sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str","String_Node_Str",t,"String_Node_Str",name));
    t.sendMessage(Messages.getFormatted(t,"String_Node_Str","String_Node_Str",sender,"String_Node_Str",name));
    up.offer(NickKeys.NICKNAME,name);
  }
  return CommandResult.success();
}
Program: 141537
Project: 141537
Buggy source:
public static void handleHeaderFooter(){
  ModuleConfig config=Modules.TABLIST.get().getConfig().get();
  boolean enablehf=config.get().getNode("String_Node_Str","String_Node_Str").getBoolean();
  if (enablehf) {
    String header;
    String footer;
    try {
      header=StringUtil.join("String_Node_Str",config.get().getNode("String_Node_Str","String_Node_Str").getList(TypeToken.of(String.class)));
      footer=StringUtil.join("String_Node_Str",config.get().getNode("String_Node_Str","String_Node_Str").getList(TypeToken.of(String.class)));
    }
 catch (    ObjectMappingException e) {
      ErrorLogger.log(e,"String_Node_Str");
      return;
    }
    for (    Player p : Sponge.getServer().getOnlinePlayers()) {
      p.getTabList().setHeaderAndFooter(VariableUtil.replaceVariables(Messages.toText(header),p),VariableUtil.replaceVariables(Messages.toText(footer),p));
    }
  }
}

Fixed version (ground truth):
public static void handleHeaderFooter(){
  ModuleConfig config=Modules.TABLIST.get().getConfig().get();
  boolean enablehf=config.get().getNode("String_Node_Str","String_Node_Str").getBoolean();
  if (enablehf) {
    String header;
    String footer;
    try {
      header=StringUtil.join("String_Node_Str",config.get().getNode("String_Node_Str","String_Node_Str").getList(TypeToken.of(String.class)));
      footer=StringUtil.join("String_Node_Str",config.get().getNode("String_Node_Str","String_Node_Str").getList(TypeToken.of(String.class)));
    }
 catch (    ObjectMappingException e) {
      ErrorLogger.log(e,"String_Node_Str");
      return;
    }
    for (    Player p : Sponge.getServer().getOnlinePlayers()) {
      Text h=VariableUtil.replaceVariables(Messages.toText(header),p);
      p.getTabList().setHeaderAndFooter(h,VariableUtil.replaceVariables(Messages.toText(footer),p));
    }
  }
}
Program: 141539
Project: 141539
Buggy source:
public void refreshNormal(){
  for (  Player p : Sponge.getServer().getOnlinePlayers()) {
    TabList list=p.getTabList();
    new ArrayList<>(list.getEntries()).forEach(entry -> list.removeEntry(entry.getProfile().getUniqueId()));
    names.forEach((uuid,name) -> {
      Player player=Sponge.getServer().getPlayer(uuid).get();
      list.addEntry(TabListEntry.builder().displayName(Text.of(name.getFirst(),name.getSecond(),name.getThird())).gameMode(player.gameMode().get()).latency(player.getConnection().getLatency()).list(list).profile(player.getProfile()).build());
    }
);
  }
}

Fixed version (ground truth):
public void refreshNormal(){
  for (  Player p : Sponge.getServer().getOnlinePlayers()) {
    TabList list=p.getTabList();
    new ArrayList<>(list.getEntries()).forEach(entry -> list.removeEntry(entry.getProfile().getUniqueId()));
    names.forEach((uuid,name) -> {
      Player player=Sponge.getServer().getPlayer(uuid).get();
      Text fullname=Text.of(name.getFirst(),name.getSecond(),name.getThird());
      list.addEntry(TabListEntry.builder().displayName(fullname).gameMode(player.gameMode().get()).latency(player.getConnection().getLatency()).list(list).profile(player.getProfile()).build());
    }
);
  }
}
Program: 141540
Project: 141540
Buggy source:
/** 
 * This will get a specific piece of text, starting at   {@code init} and ending at {@code end - 1}. This is the same as   {@link String#substring(int,int)}, but keeps formatting.
 * @param text  The text to get the subtext for
 * @param start The beginning index, inclusive
 * @param end   The ending index, exclusive
 * @return The subtext
 */
public static LiteralText subtext(Text text,int start,int end){
  if (start == end) {
    return Text.of("String_Node_Str");
  }
  List<LiteralText> chars=getFormattedChars(text);
  LiteralText.Builder sub=LiteralText.builder("String_Node_Str");
  for (  Text tex : Arrays.copyOfRange(chars.toArray(new Text[chars.size()]),start,end)) {
    sub.append(tex);
  }
  return sub.build();
}

Fixed version (ground truth):
/** 
 * This will get a specific piece of text, starting at   {@code init} and ending at {@code end - 1}. This is the same as   {@link String#substring(int,int)}, but keeps formatting.
 * @param text  The text to get the subtext for
 * @param start The beginning index, inclusive
 * @param end   The ending index, exclusive
 * @return The subtext
 */
public static LiteralText subtext(Text text,int start,int end){
  if (start == end) {
    return Text.of("String_Node_Str");
  }
  List<LiteralText> chars=getFormattedChars(text);
  LiteralText.Builder sub=LiteralText.builder("String_Node_Str");
  for (  Text tex : Arrays.copyOfRange(chars.toArray(new Text[chars.size()]),start,end)) {
    sub.append(tex);
  }
  return (LiteralText)TextSimplifier.simplify(sub.build());
}
Program: 141541
Project: 141541
Buggy source:
/** 
 * This will replace all literal matches of   {@code find} with {@code replace}. This is the same as   {@link String#replace(CharSequence,CharSequence)}, but keeps formatting. This does NOT support regex.
 * @param text    The text to search & replace in.
 * @param find    The string to search for.
 * @param replace The text to replace the string with.
 * @return The text, where every match has been replaced.
 */
public static Text replace(Text text,String find,Text replace){
  int index=text.toPlain().indexOf(find);
  if (replace.toPlain().contains(find)) {
    replace=replace(replace,find,Text.of());
  }
  while (index != -1) {
    Text charr=getChar(text,index);
    Text replacenew=merge(replace,charr);
    Text front=subtext(text,0,index);
    Text after=subtext(text,index + find.length(),text.toPlain().length());
    text=Text.of(front,replacenew,after);
    index=indexOf(text,find,true);
  }
  return text;
}

Fixed version (ground truth):
/** 
 * This will replace all literal matches of   {@code find} with {@code replace}. This is the same as   {@link String#replace(CharSequence,CharSequence)}, but keeps formatting. This does NOT support regex.
 * @param text    The text to search & replace in.
 * @param find    The string to search for.
 * @param replace The text to replace the string with.
 * @return The text, where every match has been replaced.
 */
public static Text replace(Text text,String find,Text replace){
  if (replace.toPlain().contains(find)) {
    replace=replace(replace,find,Text.of());
  }
  int index=text.toPlain().indexOf(find);
  while (index != -1) {
    Text charr=getChar(text,index);
    Text replacenew=merge(replace,charr);
    Text front=subtext(text,0,index);
    Text after=subtext(text,index + find.length(),text.toPlain().length());
    text=Text.of(front,replacenew,after);
    index=indexOf(text,find,true);
  }
  return text;
}
Program: 141542
Project: 141542
Buggy source:
default void checkPermission(CommandSource commander,Permission permission) throws CommandException {
  if (!commander.hasPermission(permission.get())) {
    throw new CommandPermissionException();
  }
}

Fixed version (ground truth):
default void checkPermission(CommandSource sender,Permission permission) throws CommandException {
  if (!sender.hasPermission(permission.get())) {
    throw new CommandPermissionException();
  }
}
Program: 141543
Project: 141543
Buggy source:
default CommandElement[] getArguments(){
  return new CommandElement[]{};
}

Fixed version (ground truth):
CommandElement[] getArguments();
Program: 141544
Project: 141544
Buggy source:
@Override default CommandResult run(CommandSource sender,String[] rawargs){
  InputTokenizer argumentParser=InputTokenizer.quotedStrings(false);
  String args=StringUtil.join("String_Node_Str",rawargs);
  try {
    CommandArgs cargs=new CommandArgs(StringUtil.join("String_Node_Str",rawargs),argumentParser.tokenize(args,false));
    CommandContext context=new CommandContext();
    GenericArguments.seq(getArguments()).parse(sender,cargs,context);
    return execute(sender,context);
  }
 catch (  CommandPermissionException ex) {
    sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str"));
    return CommandResult.empty();
  }
catch (  CommandException ex) {
    if (ex.getText() != null) {
      sender.sendMessage(ex.getText());
    }
    return CommandResult.empty();
  }
}

Fixed version (ground truth):
@Override default CommandResult run(CommandSource sender,String[] rawargs){
  InputTokenizer argumentParser=InputTokenizer.quotedStrings(false);
  String args=StringUtil.join("String_Node_Str",rawargs);
  try {
    CommandArgs cargs=new CommandArgs(StringUtil.join("String_Node_Str",rawargs),argumentParser.tokenize(args,false));
    CommandContext context=new CommandContext();
    GenericArguments.seq(getArguments()).parse(sender,cargs,context);
    return execute(sender,context);
  }
 catch (  CommandPermissionException ex) {
    sender.sendMessage(Messages.getFormatted(sender,"String_Node_Str"));
    return CommandResult.empty();
  }
catch (  CommandException ex) {
    if (ex.getText() != null) {
      sender.sendMessage(Text.of(TextColors.RED,ex.getText()));
      if (ex.shouldIncludeUsage()) {
        sender.sendMessage(Text.of(TextColors.RED,getUsage(sender)));
      }
    }
    return CommandResult.empty();
  }
}
Program: 141545
Project: 141545
Buggy source:
@Override default List<String> onTabComplete(CommandSource sender,String[] rawargs,String curs,Integer curn){
  InputTokenizer argumentParser=InputTokenizer.quotedStrings(false);
  String args=StringUtil.join("String_Node_Str",rawargs);
  try {
    CommandArgs cargs=new CommandArgs(StringUtil.join("String_Node_Str",rawargs),argumentParser.tokenize(args,false));
    CommandContext context=new CommandContext();
    GenericArguments.seq(getArguments()).parse(sender,cargs,context);
    if (sender instanceof Player) {
      BlockRay<World> blockRay=BlockRay.from((Player)sender).stopFilter(BlockRay.continueAfterFilter(BlockRay.onlyAirFilter(),1)).build();
      if (blockRay.hasNext()) {
        Location<World> loc=blockRay.next().getLocation();
        context.putArg(CommandContext.TARGET_BLOCK_ARG,loc);
      }
    }
    List<String> ret=GenericArguments.seq(getArguments()).complete(sender,cargs,context);
    return ret == null ? ImmutableList.of() : ImmutableList.copyOf(ret);
  }
 catch (  CommandException ex) {
    if (ex.getText() != null) {
      sender.sendMessage(ex.getText());
    }
    return new ArrayList<>();
  }
}

Fixed version (ground truth):
@Override default List<String> onTabComplete(CommandSource sender,String[] rawargs,String curs,Integer curn){
  InputTokenizer argumentParser=InputTokenizer.quotedStrings(false);
  String args=StringUtil.join("String_Node_Str",rawargs);
  try {
    CommandArgs cargs=new CommandArgs(StringUtil.join("String_Node_Str",rawargs),argumentParser.tokenize(args,false));
    CommandContext context=new CommandContext();
    if (sender instanceof Player) {
      BlockRay<World> blockRay=BlockRay.from((Player)sender).stopFilter(BlockRay.continueAfterFilter(BlockRay.onlyAirFilter(),1)).build();
      if (blockRay.hasNext()) {
        Location<World> loc=blockRay.next().getLocation();
        context.putArg(CommandContext.TARGET_BLOCK_ARG,loc);
      }
    }
    List<String> ret=GenericArguments.seq(getArguments()).complete(sender,cargs,context);
    return ret == null ? ImmutableList.of() : ImmutableList.copyOf(ret);
  }
 catch (  CommandException ex) {
    if (ex.getText() != null) {
      sender.sendMessage(ex.getText());
    }
    return new ArrayList<>();
  }
}
Program: 141546
Project: 141546
Buggy source:
@Nullable @Override protected Object parseValue(CommandSource source,CommandArgs args) throws ArgumentParseException {
  String var=args.next();
switch (var) {
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    return true;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
  return false;
default :
throw args.createError(Messages.getFormatted("String_Node_Str","String_Node_Str",var));
}
}

Fixed version (ground truth):
@Nullable @Override public Boolean parseValue(CommandSource source,CommandArgs args) throws ArgumentParseException {
  String var=args.next();
switch (var.toLowerCase()) {
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    return true;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
  return false;
default :
throw args.createError(Messages.getFormatted("String_Node_Str","String_Node_Str",var));
}
}
Program: 141547
Project: 141547
Buggy source:
@Nullable @Override protected Object parseValue(CommandSource source,CommandArgs args) throws ArgumentParseException {
  String player=args.next();
  return Selector.one(source,player).orElseThrow(() -> args.createError(Messages.getFormatted("String_Node_Str","String_Node_Str",player)));
}

Fixed version (ground truth):
@Nullable @Override public Player parseValue(CommandSource source,CommandArgs args) throws ArgumentParseException {
  String player=args.next();
  Optional<Player> t=Selector.one(source,player);
  if (t.isPresent()) {
    return t.get();
  }
 else {
    throw args.createError(Messages.getFormatted("String_Node_Str","String_Node_Str",player));
  }
}
Program: 141548
Project: 141548
Buggy source:
@Nullable @Override public Boolean parseValue(CommandSource source,CommandArgs args) throws ArgumentParseException {
  String var=args.next();
switch (var.toLowerCase()) {
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    return true;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
  return false;
default :
throw args.createError(Messages.getFormatted("String_Node_Str","String_Node_Str",var));
}
}

Fixed version (ground truth):
@Nullable @Override public Boolean parseValue(CommandSource source,CommandArgs args) throws ArgumentParseException {
  String var=args.next();
switch (var.toLowerCase()) {
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    return true;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
  return false;
default :
throw args.createError(Messages.getFormatted("String_Node_Str","String_Node_Str",var));
}
}
Program: 141549
Project: 141549
Buggy source:
@Override public CommandElement[] getArguments(){
  return new CommandElement[]{Arguments.builder(new PlayerArgument(Text.of("String_Node_Str"))).onlyOne().optionalWeak().build()};
}

Fixed version (ground truth):
@Override public CommandElement[] getArguments(){
  return new CommandElement[]{Arguments.builder(new PlayerArgument(Text.of("String_Node_Str"))).onlyOne().optional().build()};
}