nus-yam/ex-repair huggingface dataset:
Program: 1748
Project: 1748
Buggy source:
/** 
 * Delete album
 * @param id
 */
@Check("String_Node_Str") public static void delete(Long id){
  if (id == null) {
    render();
  }
  Album album=Album.findById(id);
  album.delete();
  Application.list(null);
}

Fixed version (ground truth):
/** 
 * Delete album
 * @param id
 */
@Check("String_Node_Str") public static void delete(Long id){
  Album album=Album.findById(id);
  album.delete();
  Application.list(null);
}
Program: 1749
Project: 1749
Buggy source:
/** 
 * filter by year
 * @param albums
 * @return
 */
public static List<Album> filterByYear(List<Album> albums,String year){
  SimpleDateFormat formatYear=new SimpleDateFormat("String_Node_Str");
  List filteredAlbums=new ArrayList<Album>();
  for (  Album album : albums) {
    if (formatYear.format(album.releaseDate).equals(year)) {
      filteredAlbums.add(album);
    }
  }
  return filteredAlbums;
}

Fixed version (ground truth):
/** 
 * filter by year
 * @param albums
 * @return
 */
public static List<Album> filterByYear(List<Album> albums,String year){
  return select(albums,having(on(Album.class).getReleaseYear(),equalTo(year)));
}
Program: 1750
Project: 1750
Buggy source:
/** 
 * Create or update album
 * @param id
 */
public static void form(Long id){
  if (id == null) {
    render();
  }
  Album album=Album.findById(id);
  Artist artist=album.artist;
  render(album,artist);
}

Fixed version (ground truth):
/** 
 * Create album
 * @param id
 */
public static void form(){
  render();
}
Program: 1751
Project: 1751
Buggy source:
/** 
 * Create or update album
 * @param album
 * @param artist
 */
public static void save(@Valid Album album,Artist artist){
  if (Validation.hasErrors())   render("String_Node_Str",album);
  album.artist=artist;
  album.save();
  for (int i=0; i < 101; i++) {
    Album a=new Album(album.name);
    a.genre=album.genre;
    a.releaseDate=album.releaseDate;
    a.artist=album.artist;
    a.save();
  }
  list(null);
}

Fixed version (ground truth):
/** 
 * Create or update album
 * @param album
 * @param artist
 */
public static void save(@Valid Album album,@Valid Artist artist){
  if (Validation.hasErrors())   render("String_Node_Str",album);
  album.artist=artist;
  album.save();
  for (int i=0; i < 101; i++) {
    Album a=new Album(album.name);
    a.genre=album.genre;
    a.releaseDate=album.releaseDate;
    a.artist=album.artist;
    a.save();
  }
  list(null);
}
Program: 1752
Project: 1752
Buggy source:
/** 
 * @param filter
 * @return
 */
public static List<Album> findAll(String filter){
  List<Album> albums;
  if (filter != null) {
    albums=Album.find("String_Node_Str",filter,filter).fetch(100);
  }
 else   albums=Album.find("String_Node_Str").fetch(100);
  return albums;
}

Fixed version (ground truth):
/** 
 * @param filter
 * @return
 */
public static List<Album> findAll(String filter){
  List<Album> albums;
  if (filter != null) {
    Query query=Album.em().createNamedQuery("String_Node_Str");
    query.setParameter("String_Node_Str","String_Node_Str" + filter + "String_Node_Str");
    query.setMaxResults(100);
    albums=query.getResultList();
  }
 else   albums=Album.find("String_Node_Str").fetch(100);
  return albums;
}
Program: 1754
Project: 1754
Buggy source:
@Override public void incoming(ZMQChannel channel,byte[] arg1){
}

Fixed version (ground truth):
@Override public void incoming(ZMQChannel channel,byte[] bytes){
  StrestZMQChannel c=StrestZMQChannel.get(channel);
  try {
    String json=new String(bytes,"String_Node_Str");
    StrestJsonRequest request=new StrestJsonRequest(DynMap.instance(json));
    c.setLastIncoming();
    request.setConnectionChannel(c);
    this.master.getRouter().incoming(request);
  }
 catch (  UnsupportedEncodingException e) {
    this.error(e);
    c.cleanup();
  }
}
Program: 1755
Project: 1755
Buggy source:
@Override public void stop(){
  server.close();
}

Fixed version (ground truth):
@Override public void stop(){
  server.close();
  this.connectionReaper.cancel();
}
Program: 1756
Project: 1756
Buggy source:
@Override public void start(Executor bossExecutor,Executor workerExecutor){
  this.server=new ZMQServer();
  server.listen(this.config.getInteger("String_Node_Str"),this,true);
}

Fixed version (ground truth):
@Override public void start(Executor bossExecutor,Executor workerExecutor){
  this.server=new ZMQServer();
  int port=this.config.getInteger("String_Node_Str");
  server.listen(port,this,true);
  this.connectionReaper.schedule(new TimerTask(){
    @Override public void run(){
      try {
        StrestZMQChannel.reaper();
      }
 catch (      Exception x) {
        log.error("String_Node_Str",x);
      }
    }
  }
,60 * 1000,60 * 1000);
  System.out.println("String_Node_Str" + port + '.');
}
Program: 1757
Project: 1757
Buggy source:
@Override public void error(Exception arg0){
}

Fixed version (ground truth):
@Override public void error(Exception e){
  log.error("String_Node_Str",e);
}
Program: 1760
Project: 1760
Buggy source:
public static <T>T getAnnotationVal(Class annotation,Object obj,Class<T> cls,String name){
  try {
    return TypeCast.cast(cls,obj.getClass().getAnnotation(annotation).getClass().getMethod(name).invoke(obj));
  }
 catch (  IllegalArgumentException e) {
    e.printStackTrace();
  }
catch (  SecurityException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public static <T>T getAnnotationVal(Class annotation,Object obj,Class<T> cls,String name){
  try {
    Object annotationObj=obj.getClass().getAnnotation(annotation);
    return TypeCast.cast(cls,annotationObj.getClass().getMethod(name).invoke(annotationObj));
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
  return null;
}
Program: 1761
Project: 1761
Buggy source:
public ResponseBuilder getResponseAsBuilder(){
  return ResponseBuilder.instance(this.getRequest());
}

Fixed version (ground truth):
public ResponseBuilder getResponseAsBuilder(){
  return ResponseBuilder.instance(this.getResponse());
}
Program: 1762
Project: 1762
Buggy source:
@Override public void before(StrestController controller) throws StrestException {
  if (controller.isStrest()) {
    return;
  }
  String sessionId=null;
  String cookieString=controller.getRequest().getHeader(HttpHeaders.Names.COOKIE);
  if (cookieString != null) {
    CookieDecoder cookieDecoder=new CookieDecoder();
    Set<Cookie> cookies=cookieDecoder.decode(cookieString);
    for (    Cookie cookie : cookies) {
      if (cookie.getName().equals(SESSION)) {
        sessionId=cookie.getValue();
      }
    }
    if (!cookies.isEmpty()) {
      CookieEncoder cookieEncoder=new CookieEncoder(true);
      for (      Cookie cookie : cookies) {
        cookieEncoder.addCookie(cookie);
      }
    }
  }
  if (sessionId != null) {
    Map<String,Object> vals=this.getSessionPersistence(controller).loadSession(sessionId);
    Date expires=TypeCast.cast(Date.class,"String_Node_Str",new Date());
    if (new Date().before(expires)) {
      log.info("String_Node_Str");
      return;
    }
    if (vals != null) {
      controller.getSessionStorage().putAll(vals);
    }
    controller.getConnectionStorage().put(SESSION,sessionId);
  }
}

Fixed version (ground truth):
@Override public void before(StrestController controller) throws StrestException {
  if (controller.isStrest()) {
    return;
  }
  String sessionId=null;
  String cookieString=controller.getRequest().getHeader(HttpHeaders.Names.COOKIE);
  if (cookieString != null) {
    CookieDecoder cookieDecoder=new CookieDecoder();
    Set<Cookie> cookies=cookieDecoder.decode(cookieString);
    for (    Cookie cookie : cookies) {
      if (cookie.getName().equals(SESSION)) {
        sessionId=cookie.getValue();
      }
    }
    if (!cookies.isEmpty()) {
      CookieEncoder cookieEncoder=new CookieEncoder(true);
      for (      Cookie cookie : cookies) {
        cookieEncoder.addCookie(cookie);
      }
    }
  }
  if ("String_Node_Str".equals(sessionId)) {
    sessionId=null;
  }
  if (sessionId != null) {
    Map<String,Object> vals=this.getSessionPersistence(controller).loadSession(sessionId);
    Date expires=TypeCast.cast(Date.class,"String_Node_Str");
    if (expires != null && expires.before(new Date())) {
      log.info("String_Node_Str");
      return;
    }
    if (vals != null) {
      controller.getSessionStorage().putAll(vals);
    }
    controller.getConnectionStorage().put(SESSION,sessionId);
  }
}
Program: 1763
Project: 1763
Buggy source:
@Override public void after(StrestController controller) throws StrestException {
  if (controller.isStrest()) {
    return;
  }
  String sessionId=(String)controller.getConnectionStorage().get(SESSION);
  if (sessionId == null && !controller.getSessionStorage().isEmpty()) {
    CookieEncoder cookieEncoder=new CookieEncoder(true);
    sessionId=UUID.randomUUID().toString();
    Cookie cookie=new DefaultCookie(SESSION,sessionId);
    cookie.setMaxAge(this.maxAge);
    cookieEncoder.addCookie(cookie);
    controller.getResponse().setHeader(HttpHeaders.Names.COOKIE,cookieEncoder.encode());
    controller.getSessionStorage().put("String_Node_Str",IsoDateUtil.getIsoDate(new Date(new Date().getTime() + (1000 * this.maxAge))));
  }
  if (sessionId != null) {
    this.getSessionPersistence(controller).saveSession(sessionId,controller.getSessionStorage());
  }
}

Fixed version (ground truth):
@Override public void after(StrestController controller) throws StrestException {
  if (controller.isStrest()) {
    return;
  }
  String sessionId=(String)controller.getConnectionStorage().get(SESSION);
  if (TypeCast.cast(Boolean.class,controller.getConnectionStorage().get("String_Node_Str"),false)) {
    log.info("String_Node_Str");
    if (sessionId == null) {
      return;
    }
    CookieEncoder cookieEncoder=new CookieEncoder(true);
    Cookie cookie=new DefaultCookie(SESSION,"String_Node_Str");
    cookie.setMaxAge(0);
    cookieEncoder.addCookie(cookie);
    controller.getResponse().setHeader(HttpHeaders.Names.SET_COOKIE,cookieEncoder.encode());
    this.getSessionPersistence(controller).deleteSession(sessionId);
    return;
  }
  if (sessionId == null && !controller.getSessionStorage().isEmpty()) {
    CookieEncoder cookieEncoder=new CookieEncoder(true);
    sessionId=UUID.randomUUID().toString();
    Cookie cookie=new DefaultCookie(SESSION,sessionId);
    cookie.setMaxAge(this.maxAge);
    cookieEncoder.addCookie(cookie);
    controller.getResponse().setHeader(HttpHeaders.Names.SET_COOKIE,cookieEncoder.encode());
  }
  controller.getSessionStorage().put("String_Node_Str",IsoDateUtil.getIsoDate(new Date(new Date().getTime() + (1000 * this.maxAge))));
  if (sessionId != null) {
    this.getSessionPersistence(controller).saveSession(sessionId,controller.getSessionStorage());
  }
}
Program: 1766
Project: 1766
Buggy source:
@Test public void keywordMatching(){
}

Fixed version (ground truth):
@Test public void keywordMatching(){
  highlight("String_Node_Str",1);
  highlight("String_Node_Str",2);
  highlight("String_Node_Str",1);
  highlight("String_Node_Str",2);
}
Program: 1767
Project: 1767
Buggy source:
@Before public void setup(){
}

Fixed version (ground truth):
@Before public void setup(){
  keywords("String_Node_Str");
}
Program: 1768
Project: 1768
Buggy source:
public Configuration(String name,String keywords,List<Mapping> mappings){
}

Fixed version (ground truth):
public Configuration(String name,List<Mapping> mappings){
  this.name=name;
  this.mappings=mappings;
}
Program: 1769
Project: 1769
Buggy source:
protected void highlight(Content content,String id){
  ICompositeNode node=NodeModelUtils.getNode(content);
  if (node == null) {
    return;
  }
  int offset=node.getOffset() + content.getIntend().size();
  int length=node.getLength();
  acceptor.addPosition(offset,length,id);
}

Fixed version (ground truth):
protected void highlight(Content content,String id){
  ICompositeNode node=NodeModelUtils.getNode(content);
  if (node == null) {
    return;
  }
  int offset=node.getOffset();
  int length=node.getLength();
  acceptor.addPosition(offset,length,id);
}
Program: 1770
Project: 1770
Buggy source:
@Override public String getLang(){
  if (lang == null) {
    lang=Strings2.firstWord(getValue());
  }
  return lang;
}

Fixed version (ground truth):
@Override public String getLang(){
  if (lang == null) {
    lang=Strings2.firstWord(getText().substring(PREFIX.length()));
  }
  return lang;
}
Program: 1771
Project: 1771
Buggy source:
@Override protected void internalCustomizeDocumentCommand(IDocument document,DocumentCommand command) throws BadLocationException {
  if (!isIntend(document,command)) {
    return;
  }
  IRegion region=document.getLineInformationOfOffset(command.offset);
  document.replace(region.getOffset(),0,"String_Node_Str");
  command.text="String_Node_Str";
}

Fixed version (ground truth):
@Override protected void internalCustomizeDocumentCommand(IDocument document,DocumentCommand command) throws BadLocationException {
  if (!isIntend(document,command)) {
    return;
  }
  IRegion region=document.getLineInformationOfOffset(command.offset);
  String line=document.get(region.getOffset(),region.getLength());
  if (line.trim().length() == 0) {
    return;
  }
  document.replace(region.getOffset(),0,"String_Node_Str");
  command.text="String_Node_Str";
}
Program: 1772
Project: 1772
Buggy source:
@Override public Properties getProperties(){
  return new AlchemistProperties();
}

Fixed version (ground truth):
@Override public Properties getProperties(){
  return AlchemistProperties.INSTANCE;
}
Program: 1773
Project: 1773
Buggy source:
@Override public CommandHandler getCommands(){
  return new AlchemistCommands();
}

Fixed version (ground truth):
@Override public CommandHandler getCommands(){
  return AlchemistCommands.INSTANCE;
}
Program: 1774
Project: 1774
Buggy source:
@Override public Properties getProperties(){
  return new BlacksmithProperties();
}

Fixed version (ground truth):
@Override public Properties getProperties(){
  return BlacksmithProperties.INSTANCE;
}
Program: 1775
Project: 1775
Buggy source:
@Override public CommandHandler getCommands(){
  return new BlacksmithCommands();
}

Fixed version (ground truth):
@Override public CommandHandler getCommands(){
  return BlacksmithCommands.INSTANCE;
}
Program: 1776
Project: 1776
Buggy source:
/** 
 * Get the current version of Citizens
 * @return
 */
public static String getVersion(){
  return version;
}

Fixed version (ground truth):
public static String getVersion(){
  return version;
}
Program: 1777
Project: 1777
Buggy source:
/** 
 * A method used for iConomy support.
 * @param iConomy plugin
 * @return
 */
public static boolean setMethod(Method method){
  if (economy == null) {
    economy=method;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean setMethod(Method method){
  if (economy == null) {
    economy=method;
    return true;
  }
  return false;
}
Program: 1778
Project: 1778
Buggy source:
/** 
 * Returns whether the given item ID is usable as a tool.
 * @param key
 * @param type
 * @param sneaking
 * @return Whether the ID is used for a tool.
 */
public static boolean validateTool(String key,int type,boolean sneaking){
  String[] items=UtilityProperties.getSettings().getString(key).split("String_Node_Str");
  List<String> item=Arrays.asList(items);
  if (item.contains("String_Node_Str")) {
    return true;
  }
  boolean isShift;
  for (  String s : item) {
    isShift=false;
    if (s.contains("String_Node_Str")) {
      s=s.replace("String_Node_Str","String_Node_Str");
      isShift=true;
    }
    if (Integer.parseInt(s) == type && isShift == sneaking) {
      return true;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean validateTool(String key,int type,boolean sneaking){
  String[] items=UtilityProperties.getSettings().getString(key).split("String_Node_Str");
  List<String> item=Arrays.asList(items);
  if (item.contains("String_Node_Str")) {
    return true;
  }
  boolean isShift;
  for (  String s : item) {
    isShift=false;
    if (s.contains("String_Node_Str")) {
      s=s.replace("String_Node_Str","String_Node_Str");
      isShift=true;
    }
    if (Integer.parseInt(s) == type && isShift == sneaking) {
      return true;
    }
  }
  return false;
}
Program: 1779
Project: 1779
Buggy source:
/** 
 * Set whether a guard NPC is a bodyguard
 * @param state
 */
public boolean isBouncer(){
  return guardType == GuardType.BOUNCER;
}

Fixed version (ground truth):
public boolean isBouncer(){
  return guardType == GuardType.BOUNCER;
}
Program: 1780
Project: 1780
Buggy source:
/** 
 * Set whether a bodyguard kills on sight
 * @param state
 */
public void setAggressive(boolean state){
  this.isAggressive=state;
}

Fixed version (ground truth):
public void setAggressive(boolean state){
  this.isAggressive=state;
}
Program: 1781
Project: 1781
Buggy source:
/** 
 * Get whether a bodyguard NPC kills on sight
 * @return
 */
public boolean isAggressive(){
  return isAggressive;
}

Fixed version (ground truth):
public boolean isAggressive(){
  return isAggressive;
}
Program: 1782
Project: 1782
Buggy source:
/** 
 * Get the type of guard that a guard NPC is
 * @return
 */
public GuardType getGuardType(){
  return guardType;
}

Fixed version (ground truth):
public GuardType getGuardType(){
  return guardType;
}
Program: 1783
Project: 1783
Buggy source:
/** 
 * Get the halved protection radius for a bouncer
 * @return
 */
public double getHalvedProtectionRadius(){
  return this.radius / 2;
}

Fixed version (ground truth):
public double getHalvedProtectionRadius(){
  return this.radius / 2;
}
Program: 1784
Project: 1784
Buggy source:
/** 
 * Set the protection radius for a bouncer
 * @param radius
 */
public void setProtectionRadius(double radius){
  this.radius=radius;
}

Fixed version (ground truth):
public void setProtectionRadius(double radius){
  this.radius=radius;
}
Program: 1785
Project: 1785
Buggy source:
/** 
 * Set whether a guard NPC is a bouncer
 * @param state
 */
public void setBouncer(){
  guardType=GuardType.BOUNCER;
}

Fixed version (ground truth):
public void setBouncer(){
  guardType=GuardType.BOUNCER;
}
Program: 1786
Project: 1786
Buggy source:
/** 
 * Get the protection radius for a bouncer
 * @return
 */
public double getProtectionRadius(){
  return radius;
}

Fixed version (ground truth):
public double getProtectionRadius(){
  return radius;
}
Program: 1787
Project: 1787
Buggy source:
@Override public CommandHandler getCommands(){
  return new GuardCommands();
}

Fixed version (ground truth):
@Override public CommandHandler getCommands(){
  return GuardCommands.INSTANCE;
}
Program: 1788
Project: 1788
Buggy source:
/** 
 * Set the type of a guard that a guard NPC is
 * @param guardType
 */
public void setGuardType(GuardType guardType){
  this.guardType=guardType;
}

Fixed version (ground truth):
public void setGuardType(GuardType guardType){
  this.guardType=guardType;
}
Program: 1789
Project: 1789
Buggy source:
/** 
 * Set whether a guard NPC is a bodyguard
 * @param state
 */
public void setBodyguard(){
  guardType=GuardType.BODYGUARD;
}

Fixed version (ground truth):
public void setBodyguard(){
  guardType=GuardType.BODYGUARD;
}
Program: 1790
Project: 1790
Buggy source:
/** 
 * Get whether a guard NPC is a bodyguard
 * @return
 */
public boolean isBodyguard(){
  return guardType == GuardType.BODYGUARD;
}

Fixed version (ground truth):
public boolean isBodyguard(){
  return guardType == GuardType.BODYGUARD;
}
Program: 1791
Project: 1791
Buggy source:
@Override public Properties getProperties(){
  return new GuardProperties();
}

Fixed version (ground truth):
@Override public Properties getProperties(){
  return GuardProperties.INSTANCE;
}
Program: 1792
Project: 1792
Buggy source:
/** 
 * Get a guard's blacklist
 * @return
 */
public FlagList getFlags(){
  return flags;
}

Fixed version (ground truth):
public FlagList getFlags(){
  return flags;
}
Program: 1793
Project: 1793
Buggy source:
/** 
 * Return a bouncer to its original position
 * @param guard
 * @param npc
 */
public static void returnToBase(Guard guard,HumanNPC npc){
  Location loc;
  if (guard.isBodyguard()) {
    Player owner=Bukkit.getServer().getPlayer(npc.getOwner());
    if (owner != null) {
      loc=owner.getLocation();
    }
 else {
      return;
    }
  }
 else {
    if (npc.getWaypoints().size() > 0) {
      loc=npc.getWaypoints().current().getLocation();
    }
 else {
      loc=npc.getNPCData().getLocation();
    }
  }
  if (npc.getLocation().distance(loc) > SettingsManager.getDouble("String_Node_Str"))   npc.teleport(loc);
  PathUtils.createPath(npc,loc,-1,-1,SettingsManager.getDouble("String_Node_Str"));
}

Fixed version (ground truth):
public static void returnToBase(Guard guard,HumanNPC npc){
  Location loc;
  if (guard.isBodyguard()) {
    Player owner=Bukkit.getServer().getPlayer(npc.getOwner());
    if (owner != null) {
      loc=owner.getLocation();
    }
 else {
      return;
    }
  }
 else {
    if (npc.getWaypoints().size() > 0) {
      loc=npc.getWaypoints().current().getLocation();
    }
 else {
      loc=npc.getNPCData().getLocation();
    }
  }
  if (npc.getLocation().distance(loc) > SettingsManager.getDouble("String_Node_Str")) {
    npc.teleport(loc);
  }
  PathUtils.createPath(npc,loc,-1,-1,SettingsManager.getDouble("String_Node_Str"));
}
Program: 1794
Project: 1794
Buggy source:
public static FlagType fromCharacter(char character){
  for (  FlagType type : FlagType.values()) {
    if (type.getCharacter() == character)     return type;
  }
  return null;
}

Fixed version (ground truth):
public static FlagType fromCharacter(char character){
  for (  FlagType type : FlagType.values()) {
    if (type.getCharacter() == character) {
      return type;
    }
  }
  return null;
}
Program: 1795
Project: 1795
Buggy source:
public void addToAll(Set<Character> set,FlagInfo info){
  List<FlagType> toAdd=Lists.newArrayList();
  if (set.size() == 1) {
    for (    FlagType type : FlagType.values())     toAdd.add(type);
  }
 else {
    for (    FlagType type : FlagType.values()) {
      if (type.isWithin(set))       toAdd.add(type);
    }
  }
  for (  FlagType type : toAdd) {
    addFlag(type,info);
  }
}

Fixed version (ground truth):
public void addToAll(Set<Character> set,FlagInfo info){
  List<FlagType> toAdd=Lists.newArrayList();
  if (set.size() == 1) {
    for (    FlagType type : FlagType.values()) {
      toAdd.add(type);
    }
  }
 else {
    for (    FlagType type : FlagType.values()) {
      if (type.isWithin(set)) {
        toAdd.add(type);
      }
    }
  }
  for (  FlagType type : toAdd) {
    addFlag(type,info);
  }
}
Program: 1796
Project: 1796
Buggy source:
@Command(aliases="String_Node_Str",usage="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",min=0,max=0) @CommandPermissions("String_Node_Str") public static void questStatus(CommandContext args,Player player,HumanNPC npc){
  PlayerProfile profile=PlayerProfile.getProfile(player.getName());
  if (!profile.hasQuest()) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
  }
 else {
    player.sendMessage(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap(profile.getProgress().getQuestName())+ "String_Node_Str"+ TimeUnit.HOURS.convert(System.currentTimeMillis() - profile.getProgress().getStartTime(),TimeUnit.MILLISECONDS)+ "String_Node_Str");
    player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.AQUA+ "String_Node_Str"+ ChatColor.GREEN+ "String_Node_Str");
    for (    ObjectiveProgress progress : profile.getProgress().getProgress()) {
      Messaging.send(player,progress.getQuestUpdater().getStatus(progress));
    }
  }
}

Fixed version (ground truth):
@Command(aliases="String_Node_Str",usage="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",min=1,max=1) @CommandPermissions("String_Node_Str") public static void questStatus(CommandContext args,Player player,HumanNPC npc){
  PlayerProfile profile=PlayerProfile.getProfile(player.getName());
  if (!profile.hasQuest()) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
  }
 else {
    player.sendMessage(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap(profile.getProgress().getQuestName())+ "String_Node_Str"+ TimeUnit.HOURS.convert(System.currentTimeMillis() - profile.getProgress().getStartTime(),TimeUnit.MILLISECONDS)+ "String_Node_Str");
    player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.AQUA+ "String_Node_Str"+ ChatColor.GREEN+ "String_Node_Str");
    for (    ObjectiveProgress progress : profile.getProgress().getProgress()) {
      Messaging.send(player,progress.getQuestUpdater().getStatus(progress));
    }
  }
}
Program: 1797
Project: 1797
Buggy source:
@Override public void onRightClick(Player player,HumanNPC npc){
  if (!PermissionManager.generic(player,"String_Node_Str")) {
    Messaging.sendError(player,MessageUtils.noPermissionsMessage);
    return;
  }
  if (!AlchemistManager.hasClickedOnce(player.getName())) {
    if (recipes.size() == 0) {
      Messaging.sendError(player,npc.getStrippedName() + "String_Node_Str");
      return;
    }
    AlchemistManager.sendRecipeMessage(player,npc,1);
    player.sendMessage(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap("String_Node_Str")+ "String_Node_Str");
    player.sendMessage(ChatColor.GREEN + "String_Node_Str");
    AlchemistManager.setClickedOnce(player.getName(),true);
    return;
  }
  AlchemistTask task=new AlchemistTask(npc);
  task.addID(Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Citizens.plugin,task,2,1));
  InventoryUtils.showInventory(npc,player);
  AlchemistManager.setClickedOnce(player.getName(),false);
}

Fixed version (ground truth):
@Override public void onRightClick(Player player,HumanNPC npc){
  if (!PermissionManager.generic(player,"String_Node_Str")) {
    Messaging.sendError(player,MessageUtils.noPermissionsMessage);
    return;
  }
  if (!AlchemistManager.hasClickedOnce(player.getName())) {
    if (recipes.size() == 0) {
      Messaging.sendError(player,npc.getStrippedName() + "String_Node_Str");
      return;
    }
    if (AlchemistManager.sendRecipeMessage(player,npc,1)) {
      player.sendMessage(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap("String_Node_Str")+ "String_Node_Str");
      player.sendMessage(ChatColor.GREEN + "String_Node_Str");
    }
    AlchemistManager.setClickedOnce(player.getName(),true);
    return;
  }
  AlchemistTask task=new AlchemistTask(npc);
  task.addID(Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Citizens.plugin,task,2,1));
  InventoryUtils.showInventory(npc,player);
  AlchemistManager.setClickedOnce(player.getName(),false);
}
Program: 1798
Project: 1798
Buggy source:
@Command(aliases={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",min=3,max=3) @CommandPermissions("String_Node_Str") public static void add(CommandContext args,Player player,HumanNPC npc){
  if (!AlchemistManager.checkValidID(player,args.getString(1))) {
    return;
  }
  int itemID=args.getInteger(1);
  Alchemist alchemist=npc.getType("String_Node_Str");
  String recipe=args.getString(2);
  String[] items=recipe.split("String_Node_Str");
  for (  String item : items) {
    String[] split=item.split("String_Node_Str");
switch (split.length) {
case 1:
      if (Material.getMaterial(StringUtils.parse(split[0])) == null) {
        Messaging.sendError(player,MessageUtils.invalidItemIDMessage);
      }
    break;
case 2:
  if (!StringUtils.isNumber(split[1])) {
    Messaging.sendError(player,"String_Node_Str");
  }
break;
}
}
alchemist.addRecipe(itemID,recipe);
player.sendMessage(StringUtils.wrap(npc.getStrippedName()) + "String_Node_Str" + StringUtils.wrap(MessageUtils.getMaterialName(itemID))+ "String_Node_Str");
}

Fixed version (ground truth):
@Command(aliases={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",min=3,max=3) @CommandPermissions("String_Node_Str") public static void add(CommandContext args,Player player,HumanNPC npc){
  if (!AlchemistManager.checkValidID(player,args.getString(1))) {
    return;
  }
  int itemID=args.getInteger(1);
  Alchemist alchemist=npc.getType("String_Node_Str");
  String recipe=args.getString(2);
  String[] items=recipe.split("String_Node_Str");
  for (  String item : items) {
    String[] split=item.split("String_Node_Str");
switch (split.length) {
case 1:
      if (Material.getMaterial(StringUtils.parse(split[0])) == null) {
        Messaging.sendError(player,MessageUtils.invalidItemIDMessage);
      }
    break;
case 2:
  if (!StringUtils.isNumber(split[1])) {
    Messaging.sendError(player,"String_Node_Str");
  }
break;
}
}
alchemist.addRecipe(itemID,recipe);
alchemist.setCurrentRecipeID(itemID);
player.sendMessage(StringUtils.wrap(npc.getStrippedName()) + "String_Node_Str" + StringUtils.wrap(MessageUtils.getMaterialName(itemID))+ "String_Node_Str");
}
Program: 1799
Project: 1799
Buggy source:
@CommandRequirements(requireSelected=true,requiredType="String_Node_Str") @Command(aliases={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",min=1,max=2) @CommandPermissions("String_Node_Str") public static void recipes(CommandContext args,Player player,HumanNPC npc){
  HashMap<Integer,String> recipes=((Alchemist)npc.getType("String_Node_Str")).getRecipes();
  if (recipes.size() == 0) {
    Messaging.sendError(player,npc.getStrippedName() + "String_Node_Str");
    return;
  }
  PageInstance instance=PageUtils.newInstance(player);
  int page=1;
  if (args.argsLength() == 2) {
    if (!StringUtils.isNumber(args.getString(1))) {
      Messaging.sendError(player,"String_Node_Str");
      return;
    }
    page=args.getInteger(1);
  }
  instance.header(ChatColor.GREEN + StringUtils.listify(StringUtils.wrap(npc.getStrippedName() + "String_Node_Str" + ChatColor.GREEN+ "String_Node_Str")));
  for (  Entry<Integer,String> entry : recipes.entrySet()) {
    instance.push("String_Node_Str" + StringUtils.wrap(MessageUtils.getMaterialName(entry.getKey())) + "String_Node_Str"+ entry.getKey()+ "String_Node_Str");
  }
  instance.push(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap("String_Node_Str")+ "String_Node_Str");
  instance.push(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap("String_Node_Str")+ "String_Node_Str");
  instance.process(page);
}

Fixed version (ground truth):
@CommandRequirements(requireSelected=true,requiredType="String_Node_Str") @Command(aliases={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",min=1,max=2) @CommandPermissions("String_Node_Str") public static void recipes(CommandContext args,Player player,HumanNPC npc){
  HashMap<Integer,String> recipes=((Alchemist)npc.getType("String_Node_Str")).getRecipes();
  if (recipes.size() == 0) {
    Messaging.sendError(player,npc.getStrippedName() + "String_Node_Str");
    return;
  }
  PageInstance instance=PageUtils.newInstance(player);
  int page=1;
  if (args.argsLength() == 2) {
    if (!StringUtils.isNumber(args.getString(1))) {
      Messaging.sendError(player,"String_Node_Str");
      return;
    }
    page=args.getInteger(1);
  }
  instance.header(ChatColor.GREEN + StringUtils.listify(StringUtils.wrap(npc.getStrippedName() + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str")));
  for (  Entry<Integer,String> entry : recipes.entrySet()) {
    instance.push("String_Node_Str" + StringUtils.wrap(MessageUtils.getMaterialName(entry.getKey())) + "String_Node_Str"+ entry.getKey()+ "String_Node_Str");
  }
  instance.push(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap("String_Node_Str")+ "String_Node_Str");
  instance.push(ChatColor.GREEN + "String_Node_Str" + StringUtils.wrap("String_Node_Str")+ "String_Node_Str");
  instance.process(page);
}
Program: 1800
Project: 1800
Buggy source:
public static boolean hasClickedOnce(String name){
  return hasClickedOnce.get(name) == null ? false : hasClickedOnce.get(name);
}

Fixed version (ground truth):
public static boolean hasClickedOnce(String name){
  return hasClickedOnce.contains(name);
}
Program: 1801
Project: 1801
Buggy source:
public static void sendRecipeMessage(Player player,HumanNPC npc,int page){
  Alchemist alchemist=npc.getType("String_Node_Str");
  int currentRecipe=alchemist.getCurrentRecipeID();
  PageInstance instance=PageUtils.newInstance(player);
  instance.header(ChatColor.GREEN + StringUtils.listify(StringUtils.wrap("String_Node_Str" + MessageUtils.getMaterialName(currentRecipe) + ChatColor.WHITE+ "String_Node_Str")));
  if (alchemist.getRecipe(currentRecipe) == null) {
    Messaging.sendError(player,npc.getStrippedName() + "String_Node_Str");
    return;
  }
  for (  String item : alchemist.getRecipe(currentRecipe).split("String_Node_Str")) {
    instance.push("String_Node_Str" + ChatColor.GREEN + MessageUtils.getStackString(getStackByString(item)));
  }
  instance.process(page);
}

Fixed version (ground truth):
public static boolean sendRecipeMessage(Player player,HumanNPC npc,int page){
  Alchemist alchemist=npc.getType("String_Node_Str");
  int currentRecipe=alchemist.getCurrentRecipeID();
  PageInstance instance=PageUtils.newInstance(player);
  instance.header(ChatColor.GREEN + StringUtils.listify(StringUtils.wrap("String_Node_Str" + MessageUtils.getMaterialName(currentRecipe) + ChatColor.WHITE+ "String_Node_Str")));
  if (alchemist.getRecipe(currentRecipe) == null) {
    Messaging.log("String_Node_Str" + currentRecipe + "String_Node_Str");
    return false;
  }
  for (  String item : alchemist.getRecipe(currentRecipe).split("String_Node_Str")) {
    instance.push("String_Node_Str" + ChatColor.GREEN + MessageUtils.getStackString(getStackByString(item)));
  }
  instance.process(page);
  return true;
}
Program: 1802
Project: 1802
Buggy source:
public static void setClickedOnce(String name,boolean clickedOnce){
  hasClickedOnce.put(name,clickedOnce);
}

Fixed version (ground truth):
public static void setClickedOnce(String name,boolean clicked){
  if (clicked) {
    hasClickedOnce.add(name);
  }
 else {
    hasClickedOnce.remove(name);
  }
}
Program: 1803
Project: 1803
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  Alchemist alchemist=npc.getType("String_Node_Str");
  ArrayList<ItemStack> required=new ArrayList<ItemStack>();
  for (  String item : alchemist.getRecipe(alchemist.getCurrentRecipeID()).split("String_Node_Str")) {
    required.add(AlchemistManager.getStackByString(item));
  }
  ArrayList<ItemStack> npcInvContents=new ArrayList<ItemStack>();
  PlayerInventory npcInv=npc.getInventory();
  for (  ItemStack i : npcInv.getContents()) {
    npcInvContents.add(i);
  }
  if (npcInvContents.containsAll(required)) {
    npcInv.clear();
    if (new Random().nextInt(100) <= SettingsManager.getInt("String_Node_Str")) {
      npcInv.addItem(new ItemStack(alchemist.getCurrentRecipeID()));
    }
 else {
      npcInv.addItem(new ItemStack(SettingsManager.getInt("String_Node_Str")));
    }
    npc.getPlayer().updateInventory();
    kill();
  }
  required.clear();
  npcInv.clear();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  Alchemist alchemist=npc.getType("String_Node_Str");
  ArrayList<ItemStack> required=new ArrayList<ItemStack>();
  for (  String item : alchemist.getRecipe(alchemist.getCurrentRecipeID()).split("String_Node_Str")) {
    required.add(AlchemistManager.getStackByString(item));
  }
  PlayerInventory npcInv=npc.getInventory();
  for (  ItemStack i : required) {
    if (!npcInv.contains(i)) {
      return;
    }
  }
  npcInv.clear();
  required.clear();
  if (new Random().nextInt(100) <= SettingsManager.getInt("String_Node_Str")) {
    npcInv.addItem(new ItemStack(alchemist.getCurrentRecipeID(),1));
  }
 else {
    npcInv.addItem(new ItemStack(SettingsManager.getInt("String_Node_Str"),1));
  }
  npc.getPlayer().updateInventory();
  kill();
}
Program: 1804
Project: 1804
Buggy source:
@Override public void onCustomEvent(Event event){
  if (event instanceof NPCCreatureSpawnEvent) {
    onNPCCreatureSpawn((NPCCreatureSpawnEvent)event);
  }
 else   if (event instanceof NPCDisplayTextEvent) {
    onNPCDisplayText((NPCDisplayTextEvent)event);
  }
 else   if (event instanceof NPCInventoryOpenEvent) {
    onNPCInventoryOpen((NPCInventoryOpenEvent)event);
  }
 else   if (event instanceof NPCRightClickEvent) {
    onNPCRightClick((NPCRightClickEvent)event);
  }
 else   if (event instanceof NPCSpawnEvent) {
    onNPCSpawn((NPCSpawnEvent)event);
  }
 else   if (event instanceof NPCTargetEvent) {
    onNPCTarget((NPCTargetEvent)event);
  }
}

Fixed version (ground truth):
@Override public void onCustomEvent(Event event){
  if (event instanceof NPCCreatureSpawnEvent) {
    onNPCCreatureSpawn((NPCCreatureSpawnEvent)event);
  }
 else   if (event instanceof NPCTalkEvent) {
    onNPCDisplayText((NPCTalkEvent)event);
  }
 else   if (event instanceof NPCInventoryOpenEvent) {
    onNPCInventoryOpen((NPCInventoryOpenEvent)event);
  }
 else   if (event instanceof NPCRightClickEvent) {
    onNPCRightClick((NPCRightClickEvent)event);
  }
 else   if (event instanceof NPCSpawnEvent) {
    onNPCSpawn((NPCSpawnEvent)event);
  }
 else   if (event instanceof NPCTargetEvent) {
    onNPCTarget((NPCTargetEvent)event);
  }
}
Program: 1805
Project: 1805
Buggy source:
public void onNPCDisplayText(NPCDisplayTextEvent event){
}

Fixed version (ground truth):
public void onNPCDisplayText(NPCTalkEvent event){
}
Program: 1807
Project: 1807
Buggy source:
public CommandContext(String[] args){
  int i=1, flagCount=1;
  for (; i < args.length; i++) {
    if (args[i].length() == 0) {
    }
 else     if (args[i].charAt(0) == '-' && args[i].matches("String_Node_Str")) {
      for (int k=1; k < args[i].length(); k++) {
        flags.add(args[i].charAt(k));
        ++flagCount;
      }
      args[i]="String_Node_Str";
    }
 else {
      continue;
    }
  }
  String[] newArgs=new String[args.length - flagCount + 1];
  System.arraycopy(args,flagCount,newArgs,1,args.length - flagCount);
  newArgs[0]=args[0];
  this.args=newArgs;
}

Fixed version (ground truth):
public CommandContext(String[] args){
  int i=1, flagCount=1;
  for (; i < args.length; i++) {
    if (args[i].length() == 0) {
    }
 else     if (args[i].charAt(0) == '-' && args[i].matches("String_Node_Str")) {
      for (int k=1; k < args[i].length(); k++) {
        flags.add(args[i].charAt(k));
        ++flagCount;
      }
      args[i]="String_Node_Str";
    }
 else {
      continue;
    }
  }
  this.args=Iterables.toArray(Splitter.on("String_Node_Str").omitEmptyStrings().split(Joiner.on("String_Node_Str").skipNulls().join(args)),String.class);
}
Program: 1810
Project: 1810
Buggy source:
@Command(aliases="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",max=0) @ServerCommand() @CommandPermissions("String_Node_Str") @CommandRequirements() public static void cleanUp(CommandContext args,CommandSender sender,HumanNPC npc){
  sender.sendMessage(ChatColor.GRAY + "String_Node_Str");
  for (  World world : Bukkit.getServer().getWorlds()) {
    for (    LivingEntity entity : world.getLivingEntities()) {
      net.minecraft.server.Entity mcEntity=((CraftLivingEntity)entity).getHandle();
      if (mcEntity instanceof CraftNPC && !(mcEntity instanceof CreatureNPC)) {
        HumanNPC found=((CraftNPC)mcEntity).npc;
        if (NPCManager.getList().get(found.getUID()) != found)         found.getPlayer().remove();
      }
    }
  }
  sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}

Fixed version (ground truth):
@Command(aliases="String_Node_Str",desc="String_Node_Str",modifiers="String_Node_Str",max=1) @ServerCommand() @CommandPermissions("String_Node_Str") @CommandRequirements() public static void cleanUp(CommandContext args,CommandSender sender,HumanNPC npc){
  sender.sendMessage(ChatColor.GRAY + "String_Node_Str");
  for (  World world : Bukkit.getServer().getWorlds()) {
    for (    LivingEntity entity : world.getLivingEntities()) {
      net.minecraft.server.Entity mcEntity=((CraftLivingEntity)entity).getHandle();
      if (mcEntity instanceof CraftNPC && !(mcEntity instanceof CreatureNPC)) {
        HumanNPC found=((CraftNPC)mcEntity).npc;
        if (NPCManager.getList().get(found.getUID()) != found)         found.getPlayer().remove();
      }
    }
  }
  sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
Program: 1811
Project: 1811
Buggy source:
public CommandContext(String[] args){
  int i=1;
  for (; i < args.length; i++) {
    if (args[i].length() == 0) {
    }
 else     if (args[i].charAt(0) == '-' && args[i].matches("String_Node_Str")) {
      for (int k=1; k < args[i].length(); k++) {
        flags.add(args[i].charAt(k));
      }
    }
 else {
      break;
    }
  }
  String[] newArgs=new String[args.length - i + 1];
  System.arraycopy(args,i,newArgs,1,args.length - i);
  newArgs[0]=args[0];
  this.args=newArgs;
}

Fixed version (ground truth):
public CommandContext(String[] args){
  int i=1, flagCount=1;
  for (; i < args.length; i++) {
    if (args[i].length() == 0) {
    }
 else     if (args[i].charAt(0) == '-' && args[i].matches("String_Node_Str")) {
      for (int k=1; k < args[i].length(); k++) {
        flags.add(args[i].charAt(k));
        ++flagCount;
      }
      args[i]="String_Node_Str";
    }
 else {
      continue;
    }
  }
  String[] newArgs=new String[args.length - flagCount + 1];
  System.arraycopy(args,flagCount,newArgs,1,args.length - flagCount);
  newArgs[0]=args[0];
  this.args=newArgs;
}
Program: 1812
Project: 1812
Buggy source:
/** 
 * Get the usage string for a command.
 * @param args
 * @param level
 * @param cmd
 * @return
 */
protected String getUsage(String[] args,int level,Command cmd){
  StringBuilder command=new StringBuilder();
  command.append("String_Node_Str");
  for (int i=0; i <= level; i++) {
    command.append(args[i] + "String_Node_Str");
  }
  command.append(cmd.flags().length() > 0 ? "String_Node_Str" + cmd.flags() + "String_Node_Str" : "String_Node_Str");
  command.append(cmd.usage());
  return command.toString();
}

Fixed version (ground truth):
/** 
 * Get the usage string for a command.
 * @param args
 * @param level
 * @param cmd
 * @return
 */
protected String getUsage(String[] args,int level,Command cmd){
  StringBuilder command=new StringBuilder();
  command.append("String_Node_Str");
  for (int i=0; i <= level; i++) {
    command.append(args[i] + "String_Node_Str");
  }
  command.append(cmd.usage());
  return command.toString();
}
Program: 1813
Project: 1813
Buggy source:
@Command(aliases="String_Node_Str",usage="String_Node_Str",desc="String_Node_Str",modifiers={"String_Node_Str","String_Node_Str"},flags="String_Node_Str",min=1) @CommandPermissions("String_Node_Str") public static void deleteFlag(CommandContext args,Player player,HumanNPC npc){
  if (!args.hasFlag('a') && !args.hasFlag('g') && !args.hasFlag('m')) {
    player.sendMessage("String_Node_Str");
    return;
  }
  Guard guard=npc.getType("String_Node_Str");
  Set<Character> flags=args.getFlags();
  if (flags.contains('a') && flags.size() == 1) {
    guard.getFlags().clear();
    player.sendMessage(ChatColor.GREEN + "String_Node_Str");
    return;
  }
 else   if (flags.contains('a')) {
    for (    Character character : flags) {
      guard.getFlags().getFlags(FlagType.fromCharacter(character)).clear();
    }
    player.sendMessage(ChatColor.GREEN + "String_Node_Str");
    return;
  }
  if (args.argsLength() == 1) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
    return;
  }
  FlagType type=flags.contains('g') ? FlagType.GROUP : flags.contains('m') ? FlagType.MOB : FlagType.PLAYER;
  if (!guard.getFlags().contains(type,args.getJoinedStrings(1))) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
    return;
  }
  guard.getFlags().getFlags(type).remove(args.getJoinedStrings(1));
  player.sendMessage(StringUtils.wrap(args.getJoinedStrings(1)) + "String_Node_Str");
}

Fixed version (ground truth):
@Command(aliases="String_Node_Str",usage="String_Node_Str",desc="String_Node_Str",modifiers={"String_Node_Str","String_Node_Str"},flags="String_Node_Str",min=1) @CommandPermissions("String_Node_Str") public static void deleteFlag(CommandContext args,Player player,HumanNPC npc){
  if (!args.hasFlag('a') && !args.hasFlag('g') && !args.hasFlag('m')&& !args.hasFlag('p')) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
    return;
  }
  Guard guard=npc.getType("String_Node_Str");
  Set<Character> flags=args.getFlags();
  if (flags.contains('a') && flags.size() == 1) {
    guard.getFlags().clear();
    player.sendMessage(ChatColor.GREEN + "String_Node_Str");
    return;
  }
 else   if (flags.contains('a')) {
    for (    Character character : flags) {
      guard.getFlags().getFlags(FlagType.fromCharacter(character)).clear();
    }
    player.sendMessage(ChatColor.GREEN + "String_Node_Str");
    return;
  }
  if (args.argsLength() == 1) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
    return;
  }
  FlagType type=flags.contains('g') ? FlagType.GROUP : flags.contains('m') ? FlagType.MOB : FlagType.PLAYER;
  if (!guard.getFlags().contains(type,args.getJoinedStrings(1))) {
    player.sendMessage(ChatColor.GRAY + "String_Node_Str");
    return;
  }
  guard.getFlags().getFlags(type).remove(args.getJoinedStrings(1));
  player.sendMessage(StringUtils.wrap(args.getJoinedStrings(1)) + "String_Node_Str");
}
Program: 1815
Project: 1815
Buggy source:
public static boolean validType(String name,boolean both){
  String formatted=name.toUpperCase().replace("String_Node_Str","String_Node_Str");
  return CreatureType.fromName(formatted) != null || (both && CreatureNPCType.fromName(formatted) != null);
}

Fixed version (ground truth):
public static boolean validType(String name,boolean both){
  String formatted=StringUtils.capitalise(name.toLowerCase()).replace("String_Node_Str","String_Node_Str");
  if (formatted.equals("String_Node_Str"))   formatted="String_Node_Str";
  return CreatureType.fromName(formatted) != null || (both && CreatureNPCType.fromName(formatted) != null);
}
Program: 1817
Project: 1817
Buggy source:
private void jump(boolean inWater,boolean inLava){
  if (inWater || inLava) {
    this.motY+=0.03999999910593033D;
  }
 else   if (this.onGround) {
    this.motY=0.41999998688697815D + jumpFactor;
  }
}

Fixed version (ground truth):
private void jump(boolean inWater,boolean inLava){
  if (inWater || inLava) {
    this.motY+=0.03999999910593033D;
  }
 else   if (this.onGround) {
    this.motY=0.41999998688697815D + JUMP_FACTOR;
  }
}
Program: 1818
Project: 1818
Buggy source:
private void updateTarget(){
  if (!this.hasAttacked && this.targetEntity != null) {
    this.path=this.world.findPath(this,this.targetEntity,pathingRange);
  }
  if (targetEntity != null) {
    if (this.targetEntity.dead) {
      resetTarget();
    }
    if (targetEntity != null && targetAggro) {
      if (this.e(this.targetEntity)) {
        if (isWithinAttackRange(this.targetEntity,this.bukkitEntity.getLocation().distance(this.targetEntity.getBukkitEntity().getLocation()))) {
          this.attackEntity(this.targetEntity);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateTarget(){
  if (!this.hasAttacked && this.targetEntity != null && autoPathToTarget) {
    this.path=this.world.findPath(this,this.targetEntity,pathingRange);
  }
  if (targetEntity != null) {
    if (this.targetEntity.dead) {
      resetTarget();
    }
    if (targetEntity != null && targetAggro) {
      if (this.e(this.targetEntity)) {
        if (isWithinAttackRange(this.targetEntity,this.bukkitEntity.getLocation().distance(this.targetEntity.getBukkitEntity().getLocation()))) {
          this.attackEntity(this.targetEntity);
        }
      }
    }
  }
}
Program: 1819
Project: 1819
Buggy source:
private boolean isWithinAttackRange(Entity entity,double distanceToEntity){
  return (isHoldingBow() && distanceToEntity < 10) || (this.attackTicks <= 0 && distanceToEntity < 1.5F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e);
}

Fixed version (ground truth):
private boolean isWithinAttackRange(Entity entity,double distanceToEntity){
  return this.attackTicks <= 0 && ((isHoldingBow() && distanceToEntity < 10) || (distanceToEntity < 1.5F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e));
}