nus-yam/ex-repair huggingface dataset:
Program: 83908
Project: 83908
Buggy source:
/** 
 * Renames a warp in the system.
 * @param warpName the name of the warp to rename
 * @param newWarpName the new name of the warp
 * @param requestingPlayer the player requesting this action
 * @param persistenceProvider the persistence provider implementation
 * @return true if renamed, false if not
 * @throws InternalPermissionsException if a method required permissions that the requesting player does not have
 */
public boolean renameWarp(String warpName,String newWarpName,Player requestingPlayer,IPersistenceProvider persistenceProvider) throws InternalPermissionsException {
  boolean retVal=false;
  if (warpName != null && newWarpName != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer,persistenceProvider);
    if (!warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()))     newWarpName=newWarpName.substring(newWarpName.indexOf("String_Node_Str") + 1);
    boolean isOwner=warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName());
    boolean hasAdminRename=plugin.hasPermission(requestingPlayer,AppStrings.COMMAND_ADMIN_RENAME_PERMISSION,AppStrings.COMMAND_RENAME,false);
    if (isOwner || hasAdminRename) {
      warp.setName(newWarpName);
      persistenceProvider.update(warp);
      retVal=true;
    }
 else     throw new InternalPermissionsException(AppStrings.WARP_CANNOT_RENAME_OTHERS);
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Renames a warp in the system.
 * @param warpName the name of the warp to rename
 * @param newWarpName the new name of the warp
 * @param requestingPlayer the player requesting this action
 * @param persistenceProvider the persistence provider implementation
 * @return true if renamed, false if not
 * @throws InternalPermissionsException if a method required permissions that the requesting player does not have
 */
public boolean renameWarp(String warpName,String newWarpName,Player requestingPlayer,IPersistenceProvider persistenceProvider) throws InternalPermissionsException {
  boolean retVal=false;
  if (warpName != null && newWarpName != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer,persistenceProvider);
    if (!warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()))     newWarpName=newWarpName.substring(newWarpName.indexOf(AppStrings.FQL_DELIMITER) + 1);
    boolean isOwner=warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName());
    boolean hasAdminRename=plugin.hasPermission(requestingPlayer,AppStrings.COMMAND_ADMIN_RENAME_PERMISSION,AppStrings.COMMAND_RENAME,false);
    if (isOwner || hasAdminRename) {
      warp.setName(newWarpName);
      persistenceProvider.update(warp);
      retVal=true;
    }
 else     throw new InternalPermissionsException(AppStrings.WARP_CANNOT_RENAME_OTHERS);
  }
  return retVal;
}
Program: 83910
Project: 83910
Buggy source:
@Test public void setWarpType() throws Exception {
  Player mockPlayerOne=Mockito.mock(Player.class);
  when(mockPlayerOne.getDisplayName()).thenReturn(PLAYER_ONE_NAME);
  List<Warp> warpList=new ArrayList<Warp>();
  warpList.add(new Warp("String_Node_Str",PLAYER_ONE_NAME,WarpType.LISTED,"String_Node_Str",0,0,0,1f,2f));
  UnitTestPersistenceProvider testPersistenceProvider=new UnitTestPersistenceProvider();
  testPersistenceProvider.setWarpList(warpList);
  Warp warpToModify=warpList.get(0);
  String warpToModifyName=warpToModify.getName();
  WarpType newType=WarpType.PRIVATE;
  WarpManager warpManager=new WarpManager(mockNiftyWarpPlugin);
  warpManager.setWarpType(warpToModifyName,newType,mockPlayerOne,testPersistenceProvider);
  Warp warpAfterMod=testPersistenceProvider.getAllWarps().get(0);
  assertEquals(WarpType.PRIVATE,warpAfterMod.getWarpType());
}

Fixed version (ground truth):
@Test public void setWarpType() throws Exception {
  Player mockPlayerOne=Mockito.mock(Player.class);
  when(mockPlayerOne.getDisplayName()).thenReturn(PLAYER_ONE_NAME);
  List<Warp> warpList=new ArrayList<Warp>();
  warpList.add(new Warp("String_Node_Str",PLAYER_ONE_NAME,WarpType.LISTED,WORLD_NAME,0,0,0,1f,2f));
  UnitTestPersistenceProvider testPersistenceProvider=new UnitTestPersistenceProvider();
  testPersistenceProvider.setWarpList(warpList);
  Warp warpToModify=warpList.get(0);
  String warpToModifyName=warpToModify.getName();
  WarpType newType=WarpType.PRIVATE;
  WarpManager warpManager=new WarpManager(mockNiftyWarpPlugin);
  warpManager.setWarpType(warpToModifyName,newType,mockPlayerOne,testPersistenceProvider);
  Warp warpAfterMod=testPersistenceProvider.getAllWarps().get(0);
  assertEquals(WarpType.PRIVATE,warpAfterMod.getWarpType());
}
Program: 83911
Project: 83911
Buggy source:
/** 
 * Adds a warp to the list using the supplied parameters
 * @param warpName the name of the warp
 * @param owner the player creating this warp
 * @param warpType the warpType for this warp
 * @param location the {@link org.bukkit.Location} object that represents this warp
 * @param persistenceProvider the persistence provider implementation
 * @return the Warp that was created
 */
public Warp addWarp(String warpName,Player owner,WarpType warpType,Location location,IPersistenceProvider persistenceProvider){
  Warp retVal=new Warp();
  retVal.setName(warpName);
  retVal.setOwner(owner.getDisplayName());
  retVal.setWarpType(warpType);
  retVal.setLocation(location);
  persistenceProvider.save(retVal);
  return retVal;
}

Fixed version (ground truth):
/** 
 * Adds a warp to the list using the supplied parameters
 * @param warpName the name of the warp
 * @param owner the player creating this warp
 * @param warpType the warpType for this warp
 * @param location the {@link org.bukkit.Location} object that represents this warp
 * @param persistenceProvider the persistence provider implementation
 * @return the Warp that was created
 */
public Warp addWarp(String warpName,Player owner,WarpType warpType,Location location,IPersistenceProvider persistenceProvider){
  Warp retVal=getWarp(warpName,owner,persistenceProvider);
  if ((retVal != null) && (retVal.getOwner().equalsIgnoreCase(owner.getDisplayName())))   persistenceProvider.delete(retVal);
  retVal=new Warp();
  retVal.setName(warpName);
  retVal.setOwner(owner.getDisplayName());
  retVal.setWarpType(warpType);
  retVal.setLocation(location);
  persistenceProvider.save(retVal);
  return retVal;
}
Program: 83913
Project: 83913
Buggy source:
public void onEnable(){
  setupDatabase();
  warpManager=new WarpManager(getDatabase());
  getCommand(AppStrings.COMMAND_ADD).setExecutor(new AddWarpCommand(this));
  getCommand(AppStrings.COMMAND_ADMIN).setExecutor(new AdminCommand(this));
  getCommand(AppStrings.COMMAND_LIST).setExecutor(new ListWarpsCommand(this));
  getCommand(AppStrings.COMMAND_DELETE).setExecutor(new DeleteWarpCommand(this));
  getCommand(AppStrings.COMMAND_RENAME).setExecutor(new RenameWarpCommand(this));
  getCommand(AppStrings.COMMAND_SET).setExecutor(new SetWarpTypeCommand(this));
  getCommand(AppStrings.COMMAND_WARP).setExecutor(new WarpCommand(this));
  this.setupPermissions();
  log.info(AppStrings.getEnabledMessage(this));
}

Fixed version (ground truth):
public void onEnable(){
  setupDatabase();
  warpManager=new WarpManager(this);
  getCommand(AppStrings.COMMAND_ADD).setExecutor(new AddWarpCommand(this));
  getCommand(AppStrings.COMMAND_LIST).setExecutor(new ListWarpsCommand(this));
  getCommand(AppStrings.COMMAND_DELETE).setExecutor(new DeleteWarpCommand(this));
  getCommand(AppStrings.COMMAND_RENAME).setExecutor(new RenameWarpCommand(this));
  getCommand(AppStrings.COMMAND_SET).setExecutor(new SetWarpTypeCommand(this));
  getCommand(AppStrings.COMMAND_WARP).setExecutor(new WarpCommand(this));
  this.setupPermissions();
  log.info(AppStrings.getEnabledMessage(this));
}
Program: 83914
Project: 83914
Buggy source:
/** 
 * Sets the warp type of an existing named warp
 * @param warpName the name of the warp we're going to modify
 * @param type the type to set that warp to
 * @param requestingPlayer the player requesting this action
 * @return true if type was set, false if not
 */
public boolean setWarpType(String warpName,WarpType type,Player requestingPlayer){
  boolean retVal=false;
  if (warpName != null && type != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer);
    if (warp != null) {
      warp.setWarpType(type);
      database.update(warp);
      retVal=true;
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Sets the warp type of an existing named warp
 * @param warpName the name of the warp we're going to modify
 * @param type the type to set that warp to
 * @param requestingPlayer the player requesting this action
 * @return true if type was set, false if not
 * @throws InternalPermissionsException if a method required permissions that the requesting player does not have
 */
public boolean setWarpType(String warpName,WarpType type,Player requestingPlayer) throws InternalPermissionsException {
  boolean retVal=false;
  if (warpName != null && type != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer);
    if (warp != null) {
      boolean isOwner=warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName());
      boolean hasAdminSetType=plugin.hasPermission(requestingPlayer,AppStrings.COMMAND_ADMIN_SET_PERMISSION,AppStrings.COMMAND_SET);
      if (isOwner || hasAdminSetType && !isOwner) {
        warp.setWarpType(type);
        plugin.getDatabase().update(warp);
        retVal=true;
      }
 else       throw new InternalPermissionsException(AppStrings.WARP_CANNOT_SET_OTHERS);
    }
  }
  return retVal;
}
Program: 83915
Project: 83915
Buggy source:
/** 
 * Adds a warp to the list using the supplied parameters
 * @param warpName the name of the warp
 * @param owner the player creating this warp
 * @param warpType the warpType for this warp
 * @param location the {@link org.bukkit.Location} object that represents this warp
 * @return the Warp that was created
 */
public Warp addWarp(String warpName,Player owner,WarpType warpType,Location location){
  Warp retVal=getWarp(warpName,owner);
  if (retVal == null)   retVal=new Warp();
  retVal.setName(warpName);
  retVal.setOwner(owner.getDisplayName());
  retVal.setWarpType(warpType);
  retVal.setLocation(location);
  database.save(retVal);
  return retVal;
}

Fixed version (ground truth):
/** 
 * Adds a warp to the list using the supplied parameters
 * @param warpName the name of the warp
 * @param owner the player creating this warp
 * @param warpType the warpType for this warp
 * @param location the {@link org.bukkit.Location} object that represents this warp
 * @return the Warp that was created
 */
public Warp addWarp(String warpName,Player owner,WarpType warpType,Location location){
  Warp retVal=getWarp(warpName,owner);
  if (retVal == null)   retVal=new Warp();
  retVal.setName(warpName);
  retVal.setOwner(owner.getDisplayName());
  retVal.setWarpType(warpType);
  retVal.setLocation(location);
  plugin.getDatabase().save(retVal);
  return retVal;
}
Program: 83916
Project: 83916
Buggy source:
/** 
 * Gets the list of warps for the user
 * @param playerName the name of the player whose warps should be listed
 * @param requestingPlayer the name of the player requesting this list
 * @return a list of warps that the player in the playerName parameter can use
 */
public List<Warp> getWarpsForUser(String playerName,Player requestingPlayer){
  List<Warp> retVal=new ArrayList<Warp>();
  List<Warp> warpsFromDB=database.find(Warp.class).findList();
  for (  Warp warp : warpsFromDB) {
    if (warp.getWarpType() == WarpType.PUBLIC_LISTED) {
      retVal.add(warp);
    }
 else {
      if (warp.getOwner().equals(playerName)) {
        retVal.add(warp);
      }
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Gets the list of warps for the user
 * @param playerName the name of the player whose warps should be listed
 * @param requestingPlayer the name of the player requesting this list
 * @return a list of warps that the player in the playerName parameter can use
 */
public List<Warp> getWarpsForUser(String playerName,Player requestingPlayer){
  List<Warp> retVal=new ArrayList<Warp>();
  List<Warp> warpsFromDB=plugin.getDatabase().find(Warp.class).findList();
  for (  Warp warp : warpsFromDB) {
    if (warp.getWarpType() == WarpType.PUBLIC_LISTED) {
      retVal.add(warp);
    }
 else {
      if (warp.getOwner().equals(playerName)) {
        retVal.add(warp);
      }
    }
  }
  return retVal;
}
Program: 83917
Project: 83917
Buggy source:
/** 
 * Gets a named warp object from persistence
 * @param warpName the name of the warp to get
 * @param requestingPlayer the player who is requesting this warp
 * @return a warp object
 */
public Warp getWarp(String warpName,Player requestingPlayer){
  Warp retVal=null;
  if (warpName != null && requestingPlayer != null) {
    String fullyQualifiedName;
    if (warpName.contains("String_Node_Str")) {
      retVal=database.find(Warp.class).where().ieq("String_Node_Str",warpName).findUnique();
      if (!retVal.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()) && retVal.getWarpType() == WarpType.PRIVATE) {
        retVal=null;
      }
    }
 else {
      fullyQualifiedName=Warp.buildFullyQualifiedName(requestingPlayer.getDisplayName(),warpName);
      retVal=database.find(Warp.class).where().ieq("String_Node_Str",fullyQualifiedName).findUnique();
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Gets a named warp object from persistence
 * @param warpName the name of the warp to get
 * @param requestingPlayer the player who is requesting this warp
 * @return a warp object
 */
public Warp getWarp(String warpName,Player requestingPlayer){
  Warp retVal=null;
  if (warpName != null && requestingPlayer != null) {
    String fullyQualifiedName;
    if (warpName.contains("String_Node_Str")) {
      retVal=plugin.getDatabase().find(Warp.class).where().ieq("String_Node_Str",warpName).findUnique();
      if (!retVal.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()) && retVal.getWarpType() == WarpType.PRIVATE) {
        retVal=null;
      }
    }
 else {
      fullyQualifiedName=Warp.buildFullyQualifiedName(requestingPlayer.getDisplayName(),warpName);
      retVal=plugin.getDatabase().find(Warp.class).where().ieq("String_Node_Str",fullyQualifiedName).findUnique();
    }
  }
  return retVal;
}
Program: 83918
Project: 83918
Buggy source:
/** 
 * Renames a warp in the system.
 * @param warpName the name of the warp to rename
 * @param newWarpName the new name of the warp
 * @param requestingPlayer the player requesting this action
 * @return true if renamed, false if not
 */
public boolean renameWarp(String warpName,String newWarpName,Player requestingPlayer){
  boolean retVal=false;
  if (warpName != null && newWarpName != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer);
    if (!warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()))     newWarpName=newWarpName.substring(newWarpName.indexOf("String_Node_Str") + 1);
    warp.setName(newWarpName);
    database.update(warp);
    retVal=true;
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Renames a warp in the system.
 * @param warpName the name of the warp to rename
 * @param newWarpName the new name of the warp
 * @param requestingPlayer the player requesting this action
 * @return true if renamed, false if not
 * @throws InternalPermissionsException if a method required permissions that the requesting player does not have
 */
public boolean renameWarp(String warpName,String newWarpName,Player requestingPlayer) throws InternalPermissionsException {
  boolean retVal=false;
  if (warpName != null && newWarpName != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer);
    if (!warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()))     newWarpName=newWarpName.substring(newWarpName.indexOf("String_Node_Str") + 1);
    boolean isOwner=warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName());
    boolean hasAdminRename=plugin.hasPermission(requestingPlayer,AppStrings.COMMAND_ADMIN_RENAME_PERMISSION,AppStrings.COMMAND_RENAME);
    if (isOwner || hasAdminRename && !isOwner) {
      warp.setName(newWarpName);
      plugin.getDatabase().update(warp);
      retVal=true;
    }
 else     throw new InternalPermissionsException(AppStrings.WARP_CANNOT_RENAME_OTHERS);
  }
  return retVal;
}
Program: 83919
Project: 83919
Buggy source:
/** 
 * Deletes a warp from the list
 * @param warpName the name of the warp
 * @param requestingPlayer the player requesting this action
 * @return true if deleted, false if not
 */
public boolean deleteWarp(String warpName,Player requestingPlayer){
  boolean retVal=false;
  if (warpName != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer);
    if (warp != null) {
      database.delete(warp);
      retVal=true;
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Deletes a warp from the list
 * @param warpName the name of the warp
 * @param requestingPlayer the player requesting this action
 * @return true if deleted, false if not
 * @throws InternalPermissionsException if a method required permissions that the requesting player does not have
 */
public boolean deleteWarp(String warpName,Player requestingPlayer) throws InternalPermissionsException {
  boolean retVal=false;
  if (warpName != null && requestingPlayer != null) {
    Warp warp=getWarp(warpName,requestingPlayer);
    if (warp != null) {
      boolean isOwner=warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName());
      boolean hasAdminDelete=plugin.hasPermission(requestingPlayer,AppStrings.COMMAND_ADMIN_DELETE_PERMISSION,AppStrings.COMMAND_DELETE);
      if (isOwner || hasAdminDelete && !isOwner) {
        plugin.getDatabase().delete(warp);
        retVal=true;
      }
 else       throw new InternalPermissionsException(AppStrings.WARP_CANNOT_REMOVE_OTHERS);
    }
  }
  return retVal;
}
Program: 83920
Project: 83920
Buggy source:
public WarpManager(EbeanServer database){
  this.database=database;
}

Fixed version (ground truth):
public WarpManager(NiftyWarp niftyWarp){
  this.plugin=niftyWarp;
}
Program: 83921
Project: 83921
Buggy source:
/** 
 * Called when a command is sent
 * @param sender  The sender (aka player)
 * @param command The command
 * @param label   The label
 * @param args    The arguments used
 * @return Whether the command succeeded or not
 */
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  boolean retVal=false;
  Player player=(Player)sender;
  if (this.plugin.hasPermission(player,AppStrings.COMMAND_ADD_PERMISSION,label)) {
    if (args.length > 0) {
      String warpName=args[0];
      WarpType warpType=WarpType.getDefaultWarpType();
      if (args.length == 2) {
        String warpTypeStr=args[1];
        WarpType warpParamType=WarpType.getTypeForString(warpTypeStr);
        if (warpParamType != null)         warpType=warpParamType;
      }
      Warp warp=plugin.getWarpManager().addWarp(warpName,player,warpType,player.getLocation());
      String addonMsgPrefix=AppStrings.getAddonMsgPrefix(plugin);
      player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.GREEN+ AppStrings.WARP_ADDED_PREFIX+ warp.getWarpType().getTypeColor()+ warpName);
      retVal=true;
    }
  }
 else   retVal=true;
  return retVal;
}

Fixed version (ground truth):
/** 
 * Called when a command is sent
 * @param sender  The sender (aka player)
 * @param command The command
 * @param label   The label
 * @param args    The arguments used
 * @return Whether the command succeeded or not
 */
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  boolean retVal=false;
  Player player=(Player)sender;
  if (this.plugin.hasPermission(player,AppStrings.COMMAND_ADD_PERMISSION,AppStrings.COMMAND_ADD)) {
    if (args.length > 0) {
      String warpName=args[0];
      WarpType warpType=WarpType.getDefaultWarpType();
      if (args.length == 2) {
        String warpTypeStr=args[1];
        WarpType warpParamType=WarpType.getTypeForString(warpTypeStr);
        if (warpParamType != null)         warpType=warpParamType;
      }
      Warp warp=plugin.getWarpManager().addWarp(warpName,player,warpType,player.getLocation());
      String addonMsgPrefix=AppStrings.getAddonMsgPrefix(plugin);
      player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.GREEN+ AppStrings.WARP_ADDED_PREFIX+ warp.getWarpType().getTypeColor()+ warpName);
      retVal=true;
    }
  }
 else   retVal=true;
  return retVal;
}
Program: 83922
Project: 83922
Buggy source:
/** 
 * Called when a command is sent
 * @param sender  The sender (aka player)
 * @param command The command
 * @param label   The label
 * @param args    The arguments used
 * @return Whether the command succeeded or not
 */
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  boolean retVal=false;
  Player player=(Player)sender;
  if (this.plugin.hasPermission(player,AppStrings.COMMAND_DELETE_PERMISSION,label)) {
    if (args.length == 1) {
      String warpName=args[0];
      String addonMsgPrefix=AppStrings.getAddonMsgPrefix(plugin);
      boolean removed=plugin.getWarpManager().deleteWarp(warpName,player);
      if (removed) {
        player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.GREEN+ AppStrings.WARP_REMOVED_PREFIX+ ChatColor.WHITE+ warpName);
      }
 else {
        player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.RED+ AppStrings.WARP_NOT_FOUND_PREFIX+ ChatColor.WHITE+ warpName);
      }
      retVal=true;
    }
  }
 else   retVal=true;
  return retVal;
}

Fixed version (ground truth):
/** 
 * Called when a command is sent
 * @param sender  The sender (aka player)
 * @param command The command
 * @param label   The label
 * @param args    The arguments used
 * @return Whether the command succeeded or not
 */
public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  boolean retVal=false;
  Player player=(Player)sender;
  if (this.plugin.hasPermission(player,AppStrings.COMMAND_DELETE_PERMISSION,AppStrings.COMMAND_DELETE)) {
    if (args.length == 1) {
      String warpName=args[0];
      String addonMsgPrefix=AppStrings.getAddonMsgPrefix(plugin);
      try {
        boolean removed=plugin.getWarpManager().deleteWarp(warpName,player);
        if (removed) {
          player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.GREEN+ AppStrings.WARP_REMOVED_PREFIX+ ChatColor.WHITE+ warpName);
        }
 else {
          player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.RED+ AppStrings.WARP_NOT_FOUND_PREFIX+ ChatColor.WHITE+ warpName);
        }
      }
 catch (      InternalPermissionsException e) {
        player.sendMessage(ChatColor.AQUA + addonMsgPrefix + ChatColor.RED+ e.getMessage());
      }
      retVal=true;
    }
  }
 else   retVal=true;
  return retVal;
}
Program: 83924
Project: 83924
Buggy source:
public ExtensionPointsExtractor(MavenArtifact hpi){
  this.hpi=hpi;
}

Fixed version (ground truth):
public ExtensionPointsExtractor(MavenArtifact artifact){
  this.artifact=artifact;
}
Program: 83925
Project: 83925
Buggy source:
private void checkIfExtension(TreePath pathToRoot,TypeElement root,TypeElement e){
  for (  TypeMirror i : e.getInterfaces()) {
    if (types.asElement(i).equals(extensionPoint))     r.add(new Extension(hpi,javac,trees,root,pathToRoot,e));
    checkIfExtension(pathToRoot,root,(TypeElement)types.asElement(i));
  }
  TypeMirror s=e.getSuperclass();
  if (!(s instanceof NoType))   checkIfExtension(pathToRoot,root,(TypeElement)types.asElement(s));
}

Fixed version (ground truth):
private void checkIfExtension(TreePath pathToRoot,TypeElement root,TypeElement e){
  for (  TypeMirror i : e.getInterfaces()) {
    if (types.asElement(i).equals(extensionPoint))     r.add(new Extension(artifact,javac,trees,root,pathToRoot,e));
    checkIfExtension(pathToRoot,root,(TypeElement)types.asElement(i));
  }
  TypeMirror s=e.getSuperclass();
  if (!(s instanceof NoType))   checkIfExtension(pathToRoot,root,(TypeElement)types.asElement(s));
}
Program: 83927
Project: 83927
Buggy source:
/** 
 * Computes an AppendSpecification for adding a version. Has the side effect of placing the cursor at the end.
 */
public AppendSpecification add(Iterator<Version> versions_to_add) throws IOException {
  set_cursor_at_end();
  ExtByteArrayOutputStream baos=new ExtByteArrayOutputStream();
  if (current_pos == 0)   baos.writeBigEndianInteger(DELTAZIP_MAGIC_HEADER | VERSION_11,4);
  Version prev_version=getVersion();
  while (versions_to_add.hasNext()) {
    Version cur=versions_to_add.next();
    if (prev_version != null) {
      pack_delta(prev_version,DZUtil.allToByteArray(cur.getContents()),baos);
    }
    prev_version=cur;
  }
  pack_snapshot(prev_version,baos);
  return new AppendSpecification(current_pos,baos.toByteArray());
}

Fixed version (ground truth):
/** 
 * Computes an AppendSpecification for adding a version. Has the side effect of placing the cursor at the end.
 */
public AppendSpecification add(Iterator<Version> versions_to_add) throws IOException {
  set_cursor_at_end();
  ExtByteArrayOutputStream baos=new ExtByteArrayOutputStream();
  if (current_pos == 0)   baos.writeBigEndianInteger(DELTAZIP_MAGIC_HEADER | VERSION_11,4);
  if (!versions_to_add.hasNext()) {
    return new AppendSpecification(access.getSize(),baos.toByteArray());
  }
  Version prev_version=getVersion();
  while (versions_to_add.hasNext()) {
    Version cur=versions_to_add.next();
    if (prev_version != null) {
      pack_delta(prev_version,DZUtil.allToByteArray(cur.getContents()),baos);
    }
    prev_version=cur;
  }
  pack_snapshot(prev_version,baos);
  return new AppendSpecification(current_pos,baos.toByteArray());
}
Program: 83928
Project: 83928
Buggy source:
public void test_add_get_with(byte[] file0,Version rev1,Version rev2) throws IOException {
  ByteArrayAccess access0=new ByteArrayAccess(file0);
  DeltaZip dz0=new DeltaZip(access0);
  AppendSpecification app1=dz0.add(rev1);
  byte[] file1=access0.applyAppendSpec(app1);
  dump("String_Node_Str",file1);
  ByteArrayAccess access1=new ByteArrayAccess(file1);
  DeltaZip dz1=new DeltaZip(access1);
  AppendSpecification app2=dz1.add(rev2);
  byte[] file2=access1.applyAppendSpec(app2);
  dump("String_Node_Str",file2);
  ByteArrayAccess access2=new ByteArrayAccess(file2);
  DeltaZip dz2=new DeltaZip(access2);
  assertEquals(dz1.getVersion(),rev1);
  assertEquals(dz2.getVersion(),rev2);
  dz2.previous();
  assertEquals(dz2.getVersion(),rev1);
  dz2.resetCursor();
  assertEquals(dz2.getVersion(),rev2);
  dz2.resetCursor();
  assertEquals(dz2.getVersion(),rev2);
  DeltaZip dz2c=dz2.clone();
  assertEquals(dz2c.getVersion(),rev2);
  dz2c.previous();
  assertEquals(dz2c.getVersion(),rev1);
  assertEquals(dz2.getVersion(),rev2);
  dz2c.resetCursor();
  dz2.previous();
  assertEquals(dz2c.getVersion(),rev2);
  try {
    dz1.previous();
    throw new RuntimeException("String_Node_Str");
  }
 catch (  Exception e) {
  }
  try {
    dz2.previous();
    throw new RuntimeException("String_Node_Str");
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
private void test_add_get_with(byte[] file0,Version rev1,Version rev2) throws IOException {
  ByteArrayAccess access0=new ByteArrayAccess(file0);
  DeltaZip dz0=new DeltaZip(access0);
  AppendSpecification app1=dz0.add(rev1);
  byte[] file1=access0.applyAppendSpec(app1);
  dump("String_Node_Str",file1);
  ByteArrayAccess access1=new ByteArrayAccess(file1);
  DeltaZip dz1=new DeltaZip(access1);
  AppendSpecification app2=dz1.add(rev2);
  byte[] file2=access1.applyAppendSpec(app2);
  dump("String_Node_Str",file2);
  ByteArrayAccess access2=new ByteArrayAccess(file2);
  DeltaZip dz2=new DeltaZip(access2);
  assertEquals(dz1.getVersion(),rev1);
  assertEquals(dz2.getVersion(),rev2);
  dz2.previous();
  assertEquals(dz2.getVersion(),rev1);
  dz2.resetCursor();
  assertEquals(dz2.getVersion(),rev2);
  dz2.resetCursor();
  assertEquals(dz2.getVersion(),rev2);
  DeltaZip dz2c=dz2.clone();
  assertEquals(dz2c.getVersion(),rev2);
  dz2c.previous();
  assertEquals(dz2c.getVersion(),rev1);
  assertEquals(dz2.getVersion(),rev2);
  dz2c.resetCursor();
  dz2.previous();
  assertEquals(dz2c.getVersion(),rev2);
  try {
    dz1.previous();
    throw new RuntimeException("String_Node_Str");
  }
 catch (  Exception e) {
  }
  try {
    dz2.previous();
    throw new RuntimeException("String_Node_Str");
  }
 catch (  Exception e) {
  }
}
Program: 83930
Project: 83930
Buggy source:
/** 
 * Computes an AppendSpecification for adding a version. Has the side effect of placing the cursor at the end.
 */
public AppendSpecification add(ByteBuffer new_version) throws IOException {
  int save_pos=new_version.position();
  set_cursor_at_end();
  ExtByteArrayOutputStream baos=new ExtByteArrayOutputStream();
  ByteBuffer last_version=get();
  if (last_version != null) {
    pack_compressed(last_version,toByteArray(new_version),baos);
  }
  pack_uncompressed(new_version,baos);
  new_version.position(save_pos);
  return new AppendSpecification(current_pos,baos.toByteArray());
}

Fixed version (ground truth):
/** 
 * Computes an AppendSpecification for adding a version. Has the side effect of placing the cursor at the end.
 */
public AppendSpecification add(ByteBuffer new_version) throws IOException {
  int save_pos=new_version.position();
  set_cursor_at_end();
  ExtByteArrayOutputStream baos=new ExtByteArrayOutputStream();
  ByteBuffer last_version=get();
  if (last_version != null) {
    pack_compressed(last_version,allToByteArray(new_version),baos);
  }
  pack_uncompressed(new_version,baos);
  new_version.position(save_pos);
  return new AppendSpecification(current_pos,baos.toByteArray());
}
Program: 83931
Project: 83931
Buggy source:
public byte[] uncompress(ByteBuffer org,byte[] ref_data,Inflater inflater){
  return DeltaZip.toByteArray(org);
}

Fixed version (ground truth):
public byte[] uncompress(ByteBuffer org,byte[] ref_data,Inflater inflater){
  return DeltaZip.remainingToByteArray(org);
}
Program: 83932
Project: 83932
Buggy source:
public static void varlen_encode(int value,OutputStream out) throws IOException {
  int shift=0;
  while ((value >>> shift) >= 0x80)   shift+=7;
  for (; shift >= 0; shift-=7) {
    byte b=(byte)(value >>> shift);
    if (shift > 0)     b|=0x80;
    out.write(b);
  }
}

Fixed version (ground truth):
public static void varlen_encode(int value,OutputStream out) throws IOException {
  int shift=0;
  while ((value >>> shift) >= 0x80)   shift+=7;
  for (; shift >= 0; shift-=7) {
    byte b=(byte)((value >>> shift) & 0x7F);
    if (shift > 0)     b|=0x80;
    out.write(b);
  }
}
Program: 83933
Project: 83933
Buggy source:
public static DeflateChunkOption create(ByteBuffer data,byte[] ref_data,int ref_data_offset,int rskip_spec,int dsize_spec,Deflater deflater){
  int remaining_data=data.remaining();
  int remaining_ref=ref_data.length - ref_data_offset;
  boolean all_is_visible=remaining_data <= WINDOW_SIZE && remaining_ref <= WINDOW_SIZE;
  if (all_is_visible && dsize_spec != -1)   return null;
  int uncomp_size=spec_to_dsize(dsize_spec,data.remaining());
  int rskip=Math.min(spec_to_rskip(rskip_spec),remaining_ref);
  ref_data_offset+=rskip;
  int dict_size=Math.min(WINDOW_SIZE,ref_data.length - ref_data_offset);
  Dictionary dict=new Dictionary(ref_data,ref_data_offset,dict_size);
  byte[] comp_data=DZUtil.deflate(deflater,data,uncomp_size,dict);
  return new DeflateChunkOption(rskip_spec,comp_data,uncomp_size);
}

Fixed version (ground truth):
public static DeflateChunkOption create(ByteBuffer data,byte[] ref_data,int ref_data_offset,int rskip_spec,int dsize_spec,Deflater deflater){
  int remaining_data=data.remaining();
  int remaining_ref=ref_data.length - ref_data_offset;
  boolean all_is_visible=remaining_data <= WINDOW_SIZE && remaining_ref <= WINDOW_SIZE;
  if (all_is_visible && dsize_spec != -1)   return null;
  int uncomp_size=spec_to_dsize(dsize_spec,data.remaining());
  if (uncomp_size > LIMIT_SO_DEFLATED_FITS_IN_64KB)   return null;
  int rskip=Math.min(spec_to_rskip(rskip_spec),remaining_ref);
  ref_data_offset+=rskip;
  int dict_size=Math.min(WINDOW_SIZE,ref_data.length - ref_data_offset);
  Dictionary dict=new Dictionary(ref_data,ref_data_offset,dict_size);
  byte[] comp_data=DZUtil.deflate(deflater,data,uncomp_size,dict);
  return new DeflateChunkOption(rskip_spec,comp_data,uncomp_size);
}
Program: 83934
Project: 83934
Buggy source:
public final void write(DataOutputStream dos) throws IOException {
  dos.write(chunkMethod());
  dos.writeChar(comp_size);
  writeCompData(dos);
}

Fixed version (ground truth):
public final void write(DataOutputStream dos) throws IOException {
  if (comp_size != (char)comp_size)   throw new RuntimeException("String_Node_Str");
  dos.write(chunkMethod());
  dos.writeChar(comp_size);
  writeCompData(dos);
}
Program: 83935
Project: 83935
Buggy source:
/** 
 * Tells whether there are older revisions. 
 */
public boolean hasPrevious(){
  return current_pos > 0;
}

Fixed version (ground truth):
/** 
 * Tells whether there are older revisions. 
 */
public boolean hasPrevious(){
  return current_pos > FILE_HEADER_LENGTH;
}
Program: 83936
Project: 83936
Buggy source:
public static int spec_to_dsize(int dsize_spec,int total_dsize){
  if (dsize_spec == -1)   return total_dsize;
 else   return (2 + dsize_spec) * (CHUNK_SIZE / 2);
}

Fixed version (ground truth):
public static int spec_to_dsize(int dsize_spec,int total_dsize){
  if (dsize_spec == -1)   return total_dsize;
 else   return Math.min((2 + dsize_spec) * (CHUNK_SIZE / 2),total_dsize);
}
Program: 83937
Project: 83937
Buggy source:
@Test public void somewhat_related_test() throws IOException {
  final Random rnd=new Random();
{
    ByteBuffer[] versions=new ByteBuffer[40];
    versions[0]=createRandomBinary(100000,rnd);
    for (int i=1; i < versions.length; i++) {
      byte[] tmp=DeltaZip.allToByteArray(versions[i - 1]);
      int nMutations=rnd.nextInt(20);
      for (int j=0; j < nMutations; j++)       tmp[rnd.nextInt(tmp.length)]=(byte)rnd.nextInt(256);
      versions[i]=ByteBuffer.wrap(tmp);
      int nRuns=rnd.nextInt(10);
      for (int j=0; j < nRuns; j++) {
        int start=0, end=tmp.length;
        int iters=rnd.nextInt(10);
        for (int k=0; k < iters; k++) {
          int mid=start + rnd.nextInt(end - start);
          if (rnd.nextBoolean())           start=mid;
 else           end=mid;
        }
        for (int k=start; k < end; k++)         tmp[k]=(byte)rnd.nextInt(256);
      }
      int nSwaps=rnd.nextInt(10);
      for (int j=0; j < nSwaps; j++) {
      }
      versions[i]=ByteBuffer.wrap(tmp);
    }
    series_test_with(versions);
  }
}

Fixed version (ground truth):
@Test public void somewhat_related_test() throws IOException {
  final Random rnd=new Random();
{
    ByteBuffer[] versions=new ByteBuffer[40];
    versions[0]=createRandomBinary(100000,rnd);
    for (int i=1; i < versions.length; i++) {
      byte[] tmp=DeltaZip.allToByteArray(versions[i - 1]);
      int nMutations=rnd.nextInt(20);
      for (int j=0; j < nMutations; j++)       tmp[rnd.nextInt(tmp.length)]=(byte)rnd.nextInt(256);
      versions[i]=ByteBuffer.wrap(tmp);
      int nRuns=rnd.nextInt(10);
      for (int j=0; j < nRuns; j++) {
        int start=0, end=tmp.length;
        int iters=rnd.nextInt(10);
        for (int k=0; k < iters && start < end; k++) {
          int mid=start + rnd.nextInt(end - start);
          if (rnd.nextBoolean())           start=mid;
 else           end=mid;
        }
        for (int k=start; k < end; k++)         tmp[k]=(byte)rnd.nextInt(256);
      }
      int nSwaps=rnd.nextInt(10);
      for (int j=0; j < nSwaps; j++) {
      }
      versions[i]=ByteBuffer.wrap(tmp);
    }
    series_test_with(versions);
  }
}
Program: 83938
Project: 83938
Buggy source:
public static Resource getResource(String path){
  if (path == null)   return null;
  logger.info("String_Node_Str" + path);
  return resourceTree.get(path);
}

Fixed version (ground truth):
public static Resource getResource(String path){
  if (path == null)   return null;
  logger.info("String_Node_Str" + path);
  return longestPrefixMatch(path);
}
Program: 83939
Project: 83939
Buggy source:
public void run(){
  logger.info("String_Node_Str");
  try {
    String path=ResourceUtils.cleanPath(request.getPath().getPath());
    logger.info("String_Node_Str" + path);
    Query query=request.getQuery();
    logger.info("String_Node_Str" + query.toString().length());
    Resource r=longestPrefixMatch(path);
    if (r == null) {
      Resource root=resourceTree.get(rootPath);
      root.handle(request,response);
    }
 else {
      logger.info("String_Node_Str" + r.getURI());
      r.handle(request,response);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    Resource.sendResponse(request,response,500,null,false,null);
  }
}

Fixed version (ground truth):
public void run(){
  logger.info("String_Node_Str");
  try {
    String path=ResourceUtils.cleanPath(request.getPath().getPath());
    logger.info("String_Node_Str" + path);
    Query query=request.getQuery();
    logger.info("String_Node_Str" + query.toString().length());
    Resource r=longestPrefixMatch(path);
    if (r == null) {
      logger.info("String_Node_Str");
      Resource root=resourceTree.get(rootPath);
      root.handle(request,response);
    }
 else {
      logger.info("String_Node_Str" + r.getURI());
      r.handle(request,response);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    Resource.sendResponse(request,response,500,null,false,null);
  }
}
Program: 83940
Project: 83940
Buggy source:
public void handle(Request request,Response response){
  logger.info("String_Node_Str");
  AsyncTask t=new AsyncTask(request,response);
  System.out.println("String_Node_Str");
  executor.execute(t);
}

Fixed version (ground truth):
public void handle(Request request,Response response){
  logger.info("String_Node_Str");
  AsyncTask t=new AsyncTask(request,response);
  System.out.println("String_Node_Str");
  executor.submit(t);
}
Program: 83941
Project: 83941
Buggy source:
private Resource longestPrefixMatch(String path){
  Resource matchRes=null;
  if (path != null) {
    StringTokenizer tokenizer=new StringTokenizer(path,"String_Node_Str");
    Vector<String> tokens=new Vector<String>();
    Vector<String> paths=new Vector<String>();
    while (tokenizer.hasMoreTokens())     tokens.add(tokenizer.nextToken());
    StringBuffer s=new StringBuffer("String_Node_Str");
    paths.add(s.toString());
    for (int i=0; i < tokens.size(); i++) {
      if (i == 0)       paths.add(s.append(tokens.get(i)).toString());
 else       paths.add(s.append("String_Node_Str").append(tokens.get(i)).toString());
    }
    for (int j=paths.size() - 1; j >= 0; j--) {
      Resource thisResource=resourceTree.get(paths.get(j));
      if (thisResource != null) {
        matchRes=thisResource;
        break;
      }
    }
  }
  return matchRes;
}

Fixed version (ground truth):
private static Resource longestPrefixMatch(String path){
  Resource matchRes=null;
  if (path != null) {
    StringTokenizer tokenizer=new StringTokenizer(path,"String_Node_Str");
    Vector<String> tokens=new Vector<String>();
    Vector<String> paths=new Vector<String>();
    while (tokenizer.hasMoreTokens())     tokens.add(tokenizer.nextToken());
    StringBuffer s=new StringBuffer("String_Node_Str");
    paths.add(s.toString());
    for (int i=0; i < tokens.size(); i++) {
      if (i == 0)       paths.add(s.append(tokens.get(i)).toString());
 else       paths.add(s.append("String_Node_Str").append(tokens.get(i)).toString());
    }
    for (int j=paths.size() - 1; j >= 0; j--) {
      Resource thisResource=resourceTree.get(paths.get(j));
      if (thisResource != null) {
        matchRes=thisResource;
        break;
      }
    }
  }
  return matchRes;
}
Program: 83942
Project: 83942
Buggy source:
public void get(Request m_request,Response m_response,String path,boolean internalCall,JSONObject internalResp){
  Query query=m_request.getQuery();
  if (query.containsKey("String_Node_Str")) {
    super.get(m_request,m_response,path,internalCall,internalResp);
    return;
  }
  String links_to=database.getSymlinkAlias(URI);
  links_to=cleanPath(links_to);
  logger.info("String_Node_Str" + links_to);
  if (links_to.startsWith("String_Node_Str")) {
    logger.info("String_Node_Str" + query.toString());
    String requestPath=path;
    String tail=query.toString();
    requestPath=cleanPath(requestPath);
    String translation=requestPath.replace(URI,links_to);
    logger.info("String_Node_Str" + requestPath + "String_Node_Str"+ URI+ "String_Node_Str"+ links_to);
    logger.info("String_Node_Str" + translation);
    Resource r=null;
    if (!database.isSymlink(links_to))     r=RESTServer.getResource(translation);
 else     r=RESTServer.getResource(links_to);
    if (r != null) {
      if (tail != null) {
        logger.fine("String_Node_Str" + translation + tail);
      }
 else {
        logger.fine("String_Node_Str" + translation);
      }
      r.get(m_request,m_response,path,internalCall,internalResp);
      return;
    }
  }
  sendResponse(m_request,m_response,404,null,internalCall,internalResp);
}

Fixed version (ground truth):
public void get(Request m_request,Response m_response,String path,boolean internalCall,JSONObject internalResp){
  Query query=m_request.getQuery();
  if (query.containsKey("String_Node_Str")) {
    super.get(m_request,m_response,path,internalCall,internalResp);
    return;
  }
  String links_to=database.getSymlinkAlias(URI);
  links_to=cleanPath(links_to);
  logger.info("String_Node_Str" + links_to);
  if (links_to.startsWith("String_Node_Str")) {
    logger.info("String_Node_Str" + query.toString());
    String requestPath=path;
    String tail=query.toString();
    requestPath=cleanPath(requestPath);
    logger.info("String_Node_Str" + requestPath + "String_Node_Str"+ URI+ "String_Node_Str"+ links_to);
    String translation=requestPath.replace(URI,links_to);
    logger.info("String_Node_Str" + translation);
    Resource r=RESTServer.getResource(translation);
    String cp1=null;
    String cp2=null;
    if (r != null) {
      cp1=cleanPath(r.getURI());
      cp2=cleanPath(translation);
    }
    if (r != null && r.TYPE != ResourceUtils.SYMLINK_RSRC && !cp1.equals(cp2)) {
      logger.info(cp2 + "String_Node_Str" + cp1+ "String_Node_Str"+ links_to);
      sendResponse(m_request,m_response,404,null,internalCall,internalResp);
      return;
    }
 else     if (r != null) {
      logger.info(translation + "String_Node_Str" + r.getURI()+ "String_Node_Str"+ links_to);
      r.get(m_request,m_response,translation,internalCall,internalResp);
      return;
    }
  }
  sendResponse(m_request,m_response,404,null,internalCall,internalResp);
}
Program: 83943
Project: 83943
Buggy source:
public static void main(String[] args){
  RESTServer restServer=null;
  IS4DataStore is4DataStore=new IS4DataStore();
  DBAbstractionLayer dbLayer=new DBAbstractionLayer();
  registrar=Registrar.registrarInstance();
  subscriptionManager=SubMngr.getSubMngrInstance();
  if (args.length == 2) {
    Integer port=new Integer(args[1]);
    thisHost=args[0];
    thisPort=port.intValue();
    IS4DataStore.logger.info("String_Node_Str");
    restServer=new RESTServer(args[0],port.intValue());
  }
 else {
    IS4DataStore.logger.info("String_Node_Str");
    restServer=new RESTServer();
  }
  restServer.start();
}

Fixed version (ground truth):
public static void main(String[] args){
  RESTServer restServer=null;
  IS4DataStore is4DataStore=new IS4DataStore();
  DBAbstractionLayer dbLayer=new DBAbstractionLayer();
  registrar=Registrar.registrarInstance();
  subscriptionManager=SubMngr.getSubMngrInstance();
  if (args.length == 2) {
    Integer port=new Integer(args[1]);
    thisHost=args[0];
    thisPort=port.intValue();
    IS4DataStore.logger.info("String_Node_Str");
    restServer=new RESTServer(args[0],port.intValue());
  }
 else {
    IS4DataStore.logger.info("String_Node_Str");
    restServer=new RESTServer();
  }
  restServer.executor=Executors.newCachedThreadPool();
  restServer.start();
}
Program: 83945
Project: 83945
Buggy source:
public void run(){
  try {
    logger.info("String_Node_Str");
    String path=ResourceUtils.cleanPath(request.getPath().getPath());
    logger.info("String_Node_Str" + path);
    Query query=request.getQuery();
    logger.info("String_Node_Str" + query.toString().length());
    Resource r=resourceTree.get(path);
    if (path.contains("String_Node_Str")) {
      Resource root=resourceTree.get(rootPath);
      root.handle(request,response);
    }
 else     if (r != null) {
      r.handle(request,response);
    }
 else {
      Resource.sendResponse(request,response,404,null,false,null);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    Resource.sendResponse(request,response,404,null,false,null);
  }
}

Fixed version (ground truth):
public void run(){
  logger.info("String_Node_Str");
  try {
    String path=ResourceUtils.cleanPath(request.getPath().getPath());
    logger.info("String_Node_Str" + path);
    Query query=request.getQuery();
    logger.info("String_Node_Str" + query.toString().length());
    Resource r=resourceTree.get(path);
    if (path.contains("String_Node_Str")) {
      Resource root=resourceTree.get(rootPath);
      root.handle(request,response);
    }
 else     if (r != null) {
      logger.info("String_Node_Str" + r.getURI());
      r.handle(request,response);
    }
 else {
      Resource.sendResponse(request,response,404,null,false,null);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    Resource.sendResponse(request,response,500,null,false,null);
  }
}
Program: 83946
Project: 83946
Buggy source:
public static void addResource(Resource resource){
  if (resource != null && !baseResources.contains(resource.getURI()) && !resource.getURI().equals("String_Node_Str")) {
    resourceTree.put(resource.getURI(),resource);
    logger.info("String_Node_Str" + resource.getURI().toString());
    String otherUrl=null;
    if (resource.getURI().endsWith("String_Node_Str") && !resource.getURI().equals("String_Node_Str")) {
      otherUrl=resource.getURI().substring(0,resource.getURI().length() - 1);
      resourceTree.put(otherUrl,resource);
      logger.info("String_Node_Str" + otherUrl);
    }
 else     if (!resource.getURI().endsWith("String_Node_Str")) {
      otherUrl=resource.getURI() + "String_Node_Str";
      resourceTree.put(otherUrl,resource);
      logger.info("String_Node_Str" + otherUrl);
    }
  }
}

Fixed version (ground truth):
public static void addResource(Resource resource){
  if (resource != null && !baseResources.containsKey(resource.getURI()) && !resource.getURI().equals("String_Node_Str")) {
    resourceTree.put(resource.getURI(),resource);
    logger.info("String_Node_Str" + resource.getURI().toString());
    String otherUrl=null;
    if (resource.getURI().endsWith("String_Node_Str") && !resource.getURI().equals("String_Node_Str")) {
      otherUrl=resource.getURI().substring(0,resource.getURI().length() - 1);
      resourceTree.put(otherUrl,resource);
      logger.info("String_Node_Str" + otherUrl);
    }
 else     if (!resource.getURI().endsWith("String_Node_Str")) {
      otherUrl=resource.getURI() + "String_Node_Str";
      resourceTree.put(otherUrl,resource);
      logger.info("String_Node_Str" + otherUrl);
    }
  }
}
Program: 83948
Project: 83948
Buggy source:
public AsyncTask(Request req,Response resp){
  request=req;
  response=resp;
}

Fixed version (ground truth):
public AsyncTask(Request req,Response resp){
  request=req;
  response=resp;
  logger.info("String_Node_Str" + request.getPath().getPath());
}
Program: 83949
Project: 83949
Buggy source:
public void handle(Request request,Response response){
  logger.info("String_Node_Str");
  routeToResource(request,response);
}

Fixed version (ground truth):
public void handle(Request request,Response response){
  logger.info("String_Node_Str");
  AsyncTask t=new AsyncTask(request,response);
  System.out.println("String_Node_Str");
  executor.execute(t);
}