nus-yam/ex-repair huggingface dataset:
Program: 93829
Project: 93829
Buggy source:
/** 
 * Used to execute ACCommands
 * @param sender
 * @param cmd
 * @param args
 * @return
 */
public boolean executeCommand(CommandSender sender,CoreCommand cmd,String[] args){
  try {
    if (cmd.permissionCheck(sender) && cmd.argsCheck(args)) {
      ACCommandContainer container=new ACCommandContainer(sender,cmd,args);
      if (cmd.getCmdName().equals("String_Node_Str") || cmd.getCmdName().equals("String_Node_Str") || cmd.getCmdName().equals("String_Node_Str"))       corePlugin.getServer().getScheduler().scheduleSyncDelayedTask(corePlugin,new SyncCommand(container));
 else {
        threads.get(cmdCount).addCommand(container);
        cmdCount++;
        if (cmdCount == MAX_THREADS)         cmdCount=0;
      }
      if (!cmd.getCmdName().equals("String_Node_Str")) {
        if (Utils.isPlayer(sender,false))         ACHelper.getInstance().addValue(Type.REPEAT_CMD,(Player)sender,container);
 else         ACHelper.getInstance().addValue(Type.REPEAT_CMD,"String_Node_Str",container);
      }
      return true;
    }
 else     return false;
  }
 catch (  Throwable t) {
    Logger.getLogger("String_Node_Str").severe("String_Node_Str" + cmd.getCmdName() + "String_Node_Str");
    sender.sendMessage("String_Node_Str" + ChatColor.RED + "String_Node_Str"+ cmd.getCmdName()+ "String_Node_Str");
    t.printStackTrace();
    if (cmdCount == 0)     threads.get(4).start();
 else     threads.get(cmdCount - 1).start();
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Used to execute ACCommands
 * @param sender
 * @param cmd
 * @param args
 * @return
 */
public boolean executeCommand(CommandSender sender,CoreCommand cmd,String[] args){
  try {
    if (cmd.permissionCheck(sender) && cmd.argsCheck(args)) {
      ACCommandContainer container=new ACCommandContainer(sender,cmd,args);
      if (cmd.getCmdName().equals("String_Node_Str") || cmd.getCmdName().equals("String_Node_Str") || cmd.getCmdName().equals("String_Node_Str"))       corePlugin.getServer().getScheduler().scheduleSyncDelayedTask(corePlugin,new SyncCommand(container));
 else {
        threads.get(cmdCount).addCommand(container);
        cmdCount++;
        if (cmdCount == MAX_THREADS)         cmdCount=0;
      }
      if (!cmd.getCmdName().equals("String_Node_Str")) {
        if (Utils.isPlayer(sender,false))         ACPlayer.getPlayer(((Player)sender).getName()).setLastCmd(container);
 else         ACPlayer.getPlayer("String_Node_Str").setLastCmd(container);
      }
      return true;
    }
 else     return false;
  }
 catch (  Throwable t) {
    Logger.getLogger("String_Node_Str").severe("String_Node_Str" + cmd.getCmdName() + "String_Node_Str");
    sender.sendMessage("String_Node_Str" + ChatColor.RED + "String_Node_Str"+ cmd.getCmdName()+ "String_Node_Str");
    t.printStackTrace();
    if (cmdCount == 0)     threads.get(4).start();
 else     threads.get(cmdCount - 1).start();
    return false;
  }
}
Program: 93830
Project: 93830
Buggy source:
@Override public void execute(CommandSender sender,CommandArgs args){
  Object cmd;
  if (Utils.isPlayer(sender,false))   cmd=ACHelper.getInstance().getValue(Type.REPEAT_CMD,(Player)sender);
 else   cmd=ACHelper.getInstance().getValue(Type.REPEAT_CMD,"String_Node_Str");
  if (cmd == null) {
    Utils.sI18n(sender,"String_Node_Str");
    return;
  }
  Utils.sI18n(sender,"String_Node_Str");
  ((ACCommandContainer)cmd).execute();
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,CommandArgs args){
  try {
    if (Utils.isPlayer(sender,false))     ACPlayer.getPlayer(((Player)sender).getName()).executeLastCmd();
 else     ACPlayer.getPlayer("String_Node_Str").executeLastCmd();
    Utils.sI18n(sender,"String_Node_Str");
  }
 catch (  NullPointerException e) {
    Utils.sI18n(sender,"String_Node_Str");
  }
}
Program: 93831
Project: 93831
Buggy source:
@Override public void execute(CommandSender sender,CommandArgs args){
  if (Utils.isPlayer(sender)) {
    Player player=(Player)sender;
    Location loc=ACHelper.getInstance().getLocation("String_Node_Str",player.getName() + "String_Node_Str","String_Node_Str",player.getName());
    if (loc == null) {
      Utils.sI18n(sender,"String_Node_Str");
      return;
    }
    player.teleport(loc);
    Utils.sI18n(sender,"String_Node_Str");
    ACHelper.getInstance().removeLocation("String_Node_Str",player.getName() + "String_Node_Str","String_Node_Str",player.getName());
  }
}

Fixed version (ground truth):
@Override public void execute(CommandSender sender,CommandArgs args){
  if (Utils.isPlayer(sender)) {
    Player player=(Player)sender;
    ACPlayer p=ACPlayer.getPlayer(player.getName());
    Location loc=p.getLastLocation();
    if (loc == null) {
      Utils.sI18n(sender,"String_Node_Str");
      return;
    }
    player.teleport(loc);
    Utils.sI18n(sender,"String_Node_Str");
    p.setLastLocation(null);
  }
}
Program: 93832
Project: 93832
Buggy source:
private Location getLocation(String location) throws WorldNotLoaded {
  ExtendedNode node=datas.getNode(location);
  if (node.getProperty("String_Node_Str") == null) {
    Location loc=parseLocation(location);
    if (loc != null)     setHome(location,loc);
    return loc;
  }
 else {
    World w=ACPluginManager.getServer().getWorld(node.getString("String_Node_Str"));
    if (w != null)     return new Location(w,node.getDouble("String_Node_Str",0),node.getDouble("String_Node_Str",0),node.getDouble("String_Node_Str",0),Float.parseFloat(node.getString("String_Node_Str")),Float.parseFloat(node.getString("String_Node_Str")));
 else     throw new WorldNotLoaded(node.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
private Location getLocation(String location) throws WorldNotLoaded {
  ExtendedNode node=datas.getNode(location);
  if (node == null)   return null;
  if (node.getProperty("String_Node_Str") == null) {
    Location loc=parseLocation(location);
    if (loc != null)     setHome(location,loc);
    return loc;
  }
 else {
    World w=ACPluginManager.getServer().getWorld(node.getString("String_Node_Str"));
    if (w != null)     return new Location(w,node.getDouble("String_Node_Str",0),node.getDouble("String_Node_Str",0),node.getDouble("String_Node_Str",0),Float.parseFloat(node.getString("String_Node_Str")),Float.parseFloat(node.getString("String_Node_Str")));
 else     throw new WorldNotLoaded(node.getString("String_Node_Str"));
  }
}
Program: 93833
Project: 93833
Buggy source:
@Override public void removeAllSuperPower(){
  for (  String power : powers.getKeys()) {
    if (Type.matchType(power).getCategory().equals(Category.SUPER_POWER))     powers.removeProperty(power);
  }
  writeFile();
}

Fixed version (ground truth):
@Override public void removeAllSuperPower(){
  for (  String power : powers.getKeys()) {
    Type matched=Type.matchType(power);
    if (matched != null && matched.getCategory().equals(Category.SUPER_POWER))     powers.removeProperty(power);
  }
  writeFile();
}
Program: 93834
Project: 93834
Buggy source:
public void setLastLocation(Location loc){
  ExtendedNode lastLoc=datas.createNode("String_Node_Str");
  lastLoc.setProperty("String_Node_Str",loc.getWorld().getName());
  lastLoc.setProperty("String_Node_Str",loc.getX());
  lastLoc.setProperty("String_Node_Str",loc.getY());
  lastLoc.setProperty("String_Node_Str",loc.getZ());
  lastLoc.setProperty("String_Node_Str",loc.getYaw());
  lastLoc.setProperty("String_Node_Str",loc.getPitch());
  writeFile();
}

Fixed version (ground truth):
public void setLastLocation(Location loc){
  if (loc == null)   datas.removeProperty("String_Node_Str");
 else {
    ExtendedNode lastLoc=datas.createNode("String_Node_Str");
    lastLoc.setProperty("String_Node_Str",loc.getWorld().getName());
    lastLoc.setProperty("String_Node_Str",loc.getX());
    lastLoc.setProperty("String_Node_Str",loc.getY());
    lastLoc.setProperty("String_Node_Str",loc.getZ());
    lastLoc.setProperty("String_Node_Str",loc.getYaw());
    lastLoc.setProperty("String_Node_Str",loc.getPitch());
  }
  writeFile();
}
Program: 93835
Project: 93835
Buggy source:
/** 
 * Load all the kits
 * @return
 */
public Map<String,List<MaterialContainer>> loadKits(){
  Map<String,List<MaterialContainer>> result=new HashMap<String,List<MaterialContainer>>();
  List<MaterialContainer> items=new ArrayList<MaterialContainer>();
  Configuration conf=getYml("String_Node_Str");
  if (conf.getKeys("String_Node_Str") != null) {
    ConfigurationNode nodes=conf.getNode("String_Node_Str");
    for (    String key : nodes.getKeys()) {
      ConfigurationNode itemsNode=nodes.getNode(key);
      for (      String item : itemsNode.getKeys()) {
        MaterialContainer m=Utils.checkMaterial(item);
        m.setAmount(itemsNode.getInt(item,1));
        if (!m.isNull())         items.add(m);
      }
      result.put(key,items);
      items.clear();
    }
    System.out.print("String_Node_Str" + items.size() + "String_Node_Str");
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Load all the kits
 * @return
 */
public Map<String,List<MaterialContainer>> loadKits(){
  Map<String,List<MaterialContainer>> result=new HashMap<String,List<MaterialContainer>>();
  List<MaterialContainer> items=new ArrayList<MaterialContainer>();
  Configuration conf=getYml("String_Node_Str");
  if (conf.getKeys("String_Node_Str") != null) {
    ConfigurationNode nodes=conf.getNode("String_Node_Str");
    for (    String key : nodes.getKeys()) {
      ConfigurationNode itemsNode=nodes.getNode(key);
      for (      String item : itemsNode.getKeys()) {
        MaterialContainer m=Utils.checkMaterial(item);
        m.setAmount(itemsNode.getInt(item,1));
        if (!m.isNull())         items.add(m);
      }
      result.put(key,new ArrayList<MaterialContainer>(items));
      items.clear();
    }
    System.out.print("String_Node_Str" + items.size() + "String_Node_Str");
  }
  return result;
}
Program: 93836
Project: 93836
Buggy source:
@Override public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  String[] split=event.getMessage().split("String_Node_Str");
  if (split.length == 0)   return;
  String cmdName=split[0].substring(1).toLowerCase();
  ACCommands cmd=CommandManager.getInstance().getCommand(cmdName);
  if (cmd != null) {
    event.setCancelled(true);
    CommandManager.getInstance().executeCommand(event.getPlayer(),cmd,Utils.Arrays_copyOfRange(split,1,split.length));
    event.setMessage("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  String[] split=event.getMessage().split("String_Node_Str");
  if (split.length == 0)   return;
  String cmdName=split[0].substring(1).toLowerCase();
  ACCommands cmd=CommandManager.getInstance().getCommand(cmdName);
  if (cmd != null) {
    event.setCancelled(true);
    System.out.print("String_Node_Str" + cmdName + "String_Node_Str");
    CommandManager.getInstance().executeCommand(event.getPlayer(),cmd,Utils.Arrays_copyOfRange(split,1,split.length));
    event.setMessage("String_Node_Str");
  }
}
Program: 93837
Project: 93837
Buggy source:
/** 
 * Register command
 * @param clazz
 */
public void registerCommand(Class<?> clazz){
  ACCommands command=null;
  try {
    command=(ACCommands)clazz.newInstance();
    command.initializeCommand(plugin);
    for (    String alias : command.getPluginCommand().getAliases())     if (disabledCommands.contains(alias))     throw new CommandDisabled("String_Node_Str" + command.getCmdName() + "String_Node_Str");
    command.registerBukkitPerm();
    command.getPluginCommand().setExecutor(this);
    commands.put(command.getPluginCommand(),command);
  }
 catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  CommandDisabled e) {
    unRegisterBukkitCommand(command.getCmdName());
    Logger.getLogger("String_Node_Str").info("String_Node_Str" + e.getMessage());
  }
catch (  CommandAlreadyExist e) {
    for (    String alias : pluginCommands.get(command.getCmdName()).getAliases())     if (prioritizedCommands.contains(alias)) {
      commandReplacer.put(alias,command);
      command.registerBukkitPerm();
      command.getPluginCommand().setExecutor(this);
      commands.put(command.getPluginCommand(),command);
      return;
    }
    unRegisterBukkitCommand(command.getCmdName());
    Logger.getLogger("String_Node_Str").info("String_Node_Str" + e.getMessage());
  }
catch (  CommandException e) {
    Logger.getLogger("String_Node_Str").info("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Register command
 * @param clazz
 */
public void registerCommand(Class<?> clazz){
  ACCommands command=null;
  try {
    command=(ACCommands)clazz.newInstance();
    command.initializeCommand(plugin);
    for (    String alias : pluginCommands.get(command.getCmdName()).getAliases())     if (disabledCommands.contains(alias))     throw new CommandDisabled("String_Node_Str" + command.getCmdName() + "String_Node_Str");
 else     if (prioritizedCommands.contains(alias))     commandReplacer.put(alias,command);
    command.registerBukkitPerm();
    command.getPluginCommand().setExecutor(this);
    commands.put(command.getPluginCommand(),command);
  }
 catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  CommandDisabled e) {
    unRegisterBukkitCommand(command.getCmdName());
    Logger.getLogger("String_Node_Str").info("String_Node_Str" + e.getMessage());
  }
catch (  CommandAlreadyExist e) {
    for (    String alias : pluginCommands.get(command.getCmdName()).getAliases())     if (prioritizedCommands.contains(alias)) {
      commandReplacer.put(alias,command);
      command.registerBukkitPerm();
      command.getPluginCommand().setExecutor(this);
      commands.put(command.getPluginCommand(),command);
      return;
    }
    unRegisterBukkitCommand(command.getCmdName());
    Logger.getLogger("String_Node_Str").info("String_Node_Str" + e.getMessage());
  }
catch (  CommandException e) {
    Logger.getLogger("String_Node_Str").info("String_Node_Str" + e.getMessage());
  }
}
Program: 93838
Project: 93838
Buggy source:
@Override public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  String[] split=event.getMessage().split("String_Node_Str");
  if (split.length == 0)   return;
  String cmdName=split[0].toLowerCase();
  ACCommands cmd=CommandManager.getInstance().getCommand(cmdName);
  if (cmd != null) {
    event.setCancelled(true);
    CommandManager.getInstance().executeCommand(event.getPlayer(),cmd,Utils.Arrays_copyOfRange(split,1,split.length));
  }
}

Fixed version (ground truth):
@Override public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  String[] split=event.getMessage().split("String_Node_Str");
  if (split.length == 0)   return;
  String cmdName=split[0].substring(1).toLowerCase();
  ACCommands cmd=CommandManager.getInstance().getCommand(cmdName);
  if (cmd != null) {
    event.setCancelled(true);
    CommandManager.getInstance().executeCommand(event.getPlayer(),cmd,Utils.Arrays_copyOfRange(split,1,split.length));
  }
}
Program: 93839
Project: 93839
Buggy source:
@Override public void onSignChange(SignChangeEvent event){
  if (event.isCancelled())   return;
  if (!(Boolean)ACHelper.getInstance().getConfValue("String_Node_Str"))   return;
  String parsed=null;
  for (  String line : event.getLines())   if (line != null && !line.isEmpty()) {
    parsed=Utils.colorParser(line);
    if (parsed != null)     line=parsed;
  }
}

Fixed version (ground truth):
@Override public void onSignChange(SignChangeEvent event){
  if (event.isCancelled())   return;
  if (!(Boolean)ACHelper.getInstance().getConfValue("String_Node_Str"))   return;
  String parsed=null;
  String line;
  for (int i=0; i < 4; i++) {
    line=event.getLine(i);
    if (line != null && !line.isEmpty()) {
      parsed=Utils.colorParser(line);
      if (parsed != null)       event.setLine(i,parsed);
    }
  }
}
Program: 93840
Project: 93840
Buggy source:
public void registerBukkitPerm(){
  AdminCmd.getBukkitServer().getPluginManager().addPermission(new Permission(permName,children));
}

Fixed version (ground truth):
public void registerBukkitPerm(){
  AdminCmd.getBukkitServer().getPluginManager().addPermission(new Permission(permName,PermissionDefault.OP,children));
}
Program: 93842
Project: 93842
Buggy source:
public List<Player> getAllPowerUserOf(String power){
  List<Player> players=new ArrayList<Player>();
  if (storedTypeValues.containsKey(power))   for (  String player : storedTypeValues.get(power).keySet())   players.add(pluginInstance.getServer().getPlayer(player));
  return players;
}

Fixed version (ground truth):
public List<Player> getAllPowerUserOf(Type power){
  List<Player> players=new ArrayList<Player>();
  if (storedTypeValues.containsKey(power))   for (  String player : storedTypeValues.get(power).keySet())   players.add(pluginInstance.getServer().getPlayer(player));
  return players;
}
Program: 93843
Project: 93843
Buggy source:
/** 
 * @param p
 * @return if the player is afk
 */
public boolean isAfk(Player p){
  return playersAfk.containsKey(p);
}

Fixed version (ground truth):
/** 
 * @param p
 * @return if the player is afk
 */
public boolean isAfk(Player p){
  return ACHelper.getInstance().isValueSet(Type.AFK,p);
}
Program: 93844
Project: 93844
Buggy source:
/** 
 * Set the player Online
 * @param p
 */
public void setOnline(Player p){
  if (!InvisibleWorker.getInstance().hasInvisiblePowers(p.getName()))   p.getServer().broadcastMessage(Utils.I18n("String_Node_Str","String_Node_Str",p.getName()));
  p.setDisplayName(playersAfk.get(p));
  p.setSleepingIgnored(false);
  playersAfk.remove(p);
}

Fixed version (ground truth):
/** 
 * Set the player Online
 * @param p
 */
public void setOnline(Player p){
  if (!InvisibleWorker.getInstance().hasInvisiblePowers(p.getName()))   p.getServer().broadcastMessage(Utils.I18n("String_Node_Str","String_Node_Str",p.getName()));
  p.setDisplayName((String)ACHelper.getInstance().getValue(Type.AFK,p));
  p.setSleepingIgnored(false);
  ACHelper.getInstance().removeValue(Type.AFK,p);
}
Program: 93845
Project: 93845
Buggy source:
/** 
 * Set the player AFK
 * @param p
 */
private void setAfk(Player p){
  if (!InvisibleWorker.getInstance().hasInvisiblePowers(p.getName()))   p.getServer().broadcastMessage(Utils.I18n("String_Node_Str","String_Node_Str",p.getName()));
  playersAfk.put(p,p.getDisplayName());
  p.setDisplayName(Utils.I18n("String_Node_Str") + p.getDisplayName());
  p.setSleepingIgnored(true);
}

Fixed version (ground truth):
/** 
 * Set the player AFK
 * @param p
 */
private void setAfk(Player p){
  if (!InvisibleWorker.getInstance().hasInvisiblePowers(p.getName()))   p.getServer().broadcastMessage(Utils.I18n("String_Node_Str","String_Node_Str",p.getName()));
  ACHelper.getInstance().addValue(Type.AFK,p,p.getDisplayName());
  p.setDisplayName(Utils.I18n("String_Node_Str") + p.getDisplayName());
  p.setSleepingIgnored(true);
}
Program: 93846
Project: 93846
Buggy source:
@Override public void run(){
  long now=System.currentTimeMillis();
  for (  Player p : playersAfk.keySet()) {
    if (now - playerTimeStamp.get(p) >= kickTime) {
      p.kickPlayer(Utils.I18n("String_Node_Str"));
      playersAfk.remove(p);
      playerTimeStamp.remove(p);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  long now=System.currentTimeMillis();
  for (  Player p : ACHelper.getInstance().getAllPowerUserOf(Type.AFK)) {
    if (now - playerTimeStamp.get(p) >= kickTime) {
      p.kickPlayer(Utils.I18n("String_Node_Str"));
      removePlayer(p);
    }
  }
}
Program: 93847
Project: 93847
Buggy source:
/** 
 * Remove the player from the check
 * @param player
 */
public void removePlayer(Player player){
  playerTimeStamp.remove(player);
  playersAfk.remove(player);
}

Fixed version (ground truth):
/** 
 * Remove the player from the check
 * @param player
 */
public void removePlayer(Player player){
  playerTimeStamp.remove(player);
  ACHelper.getInstance().removeValue(Type.AFK,player);
}
Program: 93848
Project: 93848
Buggy source:
/** 
 * Set the player Online
 * @param p
 */
public void setOnline(Player p){
  p.getServer().broadcastMessage(Utils.I18n("String_Node_Str","String_Node_Str",p.getName()));
  p.setDisplayName(playersAfk.get(p));
  p.setSleepingIgnored(false);
  playersAfk.remove(p);
  playerTimeStamp.remove(p);
}

Fixed version (ground truth):
/** 
 * Set the player Online
 * @param p
 */
public void setOnline(Player p){
  p.getServer().broadcastMessage(Utils.I18n("String_Node_Str","String_Node_Str",p.getName()));
  p.setDisplayName(playersAfk.get(p));
  p.setSleepingIgnored(false);
  playersAfk.remove(p);
}
Program: 93849
Project: 93849
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
  if (!shouldInstrument(name)) {
    return KernelBundleClassLoader.this.loadClass(name,resolve);
  }
  Class<?> cls=KernelBundleClassLoader.this.findLoadedClass(name);
  if (cls == null) {
    cls=this.loadedClasses.get(name);
    if (cls == null) {
      cls=findClassInternal(name,true);
      if (cls == null) {
        cls=KernelBundleClassLoader.this.loadClass(name,resolve);
      }
    }
  }
  if (cls == null) {
    throw new ClassNotFoundException(name);
  }
  if (resolve) {
    resolveClass(cls);
  }
  return this.loadedClasses.putIfAbsent(name,cls);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
  if (!shouldInstrument(name)) {
    return KernelBundleClassLoader.this.loadClass(name,resolve);
  }
  Class<?> cls=KernelBundleClassLoader.this.findLoadedClass(name);
  if (cls == null) {
    cls=this.loadedClasses.get(name);
    if (cls == null) {
      cls=findClassInternal(name,true);
      if (cls == null) {
        cls=KernelBundleClassLoader.this.loadClass(name,resolve);
      }
    }
  }
  if (cls == null) {
    throw new ClassNotFoundException(name);
  }
  if (resolve) {
    resolveClass(cls);
  }
  this.loadedClasses.putIfAbsent(name,cls);
  return cls;
}
Program: 93850
Project: 93850
Buggy source:
@Before public void setUp() throws Exception {
  BUNDLE_BRIDGE=new BundleBridge(new StubHashGenerator());
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  BUNDLE_BRIDGE=new BundleBridge(new StubHashGenerator());
}
Program: 93851
Project: 93851
Buggy source:
private BundleManifest loadManifest(ArtifactFS compositeArtifactFS) throws DeploymentException {
  ArtifactFSEntry entry=compositeArtifactFS.getEntry(JarFile.MANIFEST_NAME);
  Reader reader=null;
  try {
    reader=new InputStreamReader(entry.getInputStream());
    return BundleManifestFactory.createBundleManifest(reader);
  }
 catch (  IOException ex) {
    throw new DeploymentException("String_Node_Str" + compositeArtifactFS + "String_Node_Str",ex);
  }
 finally {
    IOUtils.closeQuietly(reader);
  }
}

Fixed version (ground truth):
private BundleManifest loadManifest(ArtifactFS compositeArtifactFS) throws DeploymentException {
  ArtifactFSEntry entry=compositeArtifactFS.getEntry(JarFile.MANIFEST_NAME);
  Reader reader=null;
  try {
    reader=new InputStreamReader(entry.getInputStream(),UTF_8);
    return BundleManifestFactory.createBundleManifest(reader);
  }
 catch (  IOException ex) {
    throw new DeploymentException("String_Node_Str" + compositeArtifactFS + "String_Node_Str",ex);
  }
 finally {
    IOUtils.closeQuietly(reader);
  }
}
Program: 93853
Project: 93853
Buggy source:
private static ManifestContents getManifestContents(File file) throws IOException {
  ManifestParser manifestParser=new RecoveringManifestParser();
  Reader reader=null;
  try {
    reader=new FileReader(file);
    return manifestParser.parse(reader);
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
}

Fixed version (ground truth):
private static ManifestContents getManifestContents(File file) throws IOException {
  ManifestParser manifestParser=new RecoveringManifestParser();
  try (Reader reader=new InputStreamReader(new FileInputStream(file),UTF_8)){
    return manifestParser.parse(reader);
  }
 }
Program: 93854
Project: 93854
Buggy source:
private String readRedployData(){
  StringBuffer redeployData=new StringBuffer(INITIAL_REDEPLOY_DATA_SIZE);
  Reader redeployDataReader;
  try {
    redeployDataReader=new BufferedReader(new FileReader(redeployDataset.toFile()));
    try {
      char[] chars=new char[INITIAL_REDEPLOY_DATA_SIZE];
      int numRead;
      while (-1 != (numRead=redeployDataReader.read(chars))) {
        redeployData.append(String.valueOf(chars,0,numRead));
      }
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
 finally {
      try {
        redeployDataReader.close();
      }
 catch (      IOException e) {
        logger.error("String_Node_Str",e);
      }
    }
  }
 catch (  FileNotFoundException e) {
  }
  return redeployData.toString();
}

Fixed version (ground truth):
private String readRedployData(){
  StringBuffer redeployData=new StringBuffer(INITIAL_REDEPLOY_DATA_SIZE);
  Reader redeployDataReader=null;
  try {
    redeployDataReader=new BufferedReader(new InputStreamReader(new FileInputStream(redeployDataset.toFile()),UTF_8));
    try {
      char[] chars=new char[INITIAL_REDEPLOY_DATA_SIZE];
      int numRead;
      while (-1 != (numRead=redeployDataReader.read(chars))) {
        redeployData.append(String.valueOf(chars,0,numRead));
      }
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
 finally {
      try {
        redeployDataReader.close();
      }
 catch (      IOException e) {
        logger.error("String_Node_Str",e);
      }
    }
  }
 catch (  FileNotFoundException e) {
  }
  return redeployData.toString();
}
Program: 93855
Project: 93855
Buggy source:
/** 
 * Write the given set of URIs to the redeploy dataset. To avoid corruption if a crash occurs, write to a redeploy compression file and then switch this for the redeploy dataset.
 * @param redeploySet the URIs to be written
 */
private void rewriteRedeploySet(Map<URI,DeploymentOptions> redeploySet){
  this.redeployCompressionDataset.delete();
  Writer redeployDataWriter;
  try {
    redeployDataWriter=new BufferedWriter(new FileWriter(this.redeployCompressionDataset.toFile()));
    for (    Entry<URI,DeploymentOptions> redeployEntry : redeploySet.entrySet()) {
      recordUriCommand(redeployDataWriter,redeployEntry.getKey(),getCommandString(redeployEntry.getValue()));
    }
    redeployDataWriter.close();
  }
 catch (  IOException e) {
    logger.warn("String_Node_Str",e);
  }
  this.redeployDataset.delete();
  this.redeployCompressionDataset.moveTo(this.redeployDataset);
}

Fixed version (ground truth):
/** 
 * Write the given set of URIs to the redeploy dataset. To avoid corruption if a crash occurs, write to a redeploy compression file and then switch this for the redeploy dataset.
 * @param redeploySet the URIs to be written
 */
private void rewriteRedeploySet(Map<URI,DeploymentOptions> redeploySet){
  this.redeployCompressionDataset.delete();
  try (Writer redeployDataWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.redeployCompressionDataset.toFile()),UTF_8))){
    for (    Entry<URI,DeploymentOptions> redeployEntry : redeploySet.entrySet()) {
      recordUriCommand(redeployDataWriter,redeployEntry.getKey(),getCommandString(redeployEntry.getValue()));
    }
    redeployDataWriter.close();
  }
 catch (  IOException e) {
    logger.warn("String_Node_Str",e);
  }
  this.redeployDataset.delete();
  this.redeployCompressionDataset.moveTo(this.redeployDataset);
}
Program: 93856
Project: 93856
Buggy source:
private static Reader manifestReaderFromFile(File file) throws IOException {
  try {
    StringWriter writer=new StringWriter();
    FileCopyUtils.copy(new InputStreamReader(new FileInputStream(file)),writer);
    return new StringReader(writer.toString());
  }
 catch (  IOException ioe) {
    throw new IOException("String_Node_Str",ioe);
  }
}

Fixed version (ground truth):
private static Reader manifestReaderFromFile(File file) throws IOException {
  try {
    StringWriter writer=new StringWriter();
    FileCopyUtils.copy(new InputStreamReader(new FileInputStream(file),UTF_8),writer);
    return new StringReader(writer.toString());
  }
 catch (  IOException ioe) {
    throw new IOException("String_Node_Str",ioe);
  }
}
Program: 93857
Project: 93857
Buggy source:
private static Reader manifestReaderFromJar(File file) throws IOException, SecurityException {
  if (!file.exists()) {
    throw new IOException("String_Node_Str" + file + "String_Node_Str");
  }
  ArtifactFS fs=new JarFileArtifactFS(file);
  ArtifactFSEntry fsEntry=fs.getEntry(JarFile.MANIFEST_NAME);
  if (fsEntry == null || !fsEntry.exists()) {
    return null;
  }
  StringWriter writer=new StringWriter();
  InputStream inputStream=fsEntry.getInputStream();
  FileCopyUtils.copy(new InputStreamReader(inputStream),writer);
  inputStream.close();
  return new StringReader(writer.toString());
}

Fixed version (ground truth):
private static Reader manifestReaderFromJar(File file) throws IOException, SecurityException {
  if (!file.exists()) {
    throw new IOException("String_Node_Str" + file + "String_Node_Str");
  }
  ArtifactFS fs=new JarFileArtifactFS(file);
  ArtifactFSEntry fsEntry=fs.getEntry(JarFile.MANIFEST_NAME);
  if (fsEntry == null || !fsEntry.exists()) {
    return null;
  }
  StringWriter writer=new StringWriter();
  InputStream inputStream=fsEntry.getInputStream();
  FileCopyUtils.copy(new InputStreamReader(inputStream,UTF_8),writer);
  inputStream.close();
  return new StringReader(writer.toString());
}
Program: 93858
Project: 93858
Buggy source:
public ArtifactDescriptor generateArtifactDescriptor(File artifactFile) throws ArtifactGenerationException {
  if (artifactFile.getName().endsWith(PROPERTIES_SUFFIX)) {
    FileReader reader=null;
    try {
      reader=new FileReader(artifactFile);
      Properties properties=new Properties();
      properties.load(reader);
      return createArtifactDescriptor(artifactFile,properties);
    }
 catch (    IOException e) {
      throw new ArtifactGenerationException("String_Node_Str",ARTIFACT_TYPE,e);
    }
 finally {
      IOUtils.closeQuietly(reader);
    }
  }
  return null;
}

Fixed version (ground truth):
public ArtifactDescriptor generateArtifactDescriptor(File artifactFile) throws ArtifactGenerationException {
  if (artifactFile.getName().endsWith(PROPERTIES_SUFFIX)) {
    Reader reader=null;
    try {
      reader=new InputStreamReader(new FileInputStream(artifactFile),UTF_8);
      Properties properties=new Properties();
      properties.load(reader);
      return createArtifactDescriptor(artifactFile,properties);
    }
 catch (    IOException e) {
      throw new ArtifactGenerationException("String_Node_Str",ARTIFACT_TYPE,e);
    }
 finally {
      IOUtils.closeQuietly(reader);
    }
  }
  return null;
}
Program: 93859
Project: 93859
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getBundleLocation(){
  Bundle bundle=this.getBundle();
  if (bundle == null) {
    return this.bundleDescription.getLocation();
  }
  return this.bundle.getLocation();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String getBundleLocation(){
  Bundle bundle=this.getBundle();
  if (bundle == null) {
    return this.bundleDescription.getLocation();
  }
  return bundle.getLocation();
}
Program: 93860
Project: 93860
Buggy source:
private String getFileName(@NonNull URI location) throws DeploymentException {
  URI normalisedLocation=this.uriNormaliser.normalise(location);
  String path=normalisedLocation.getPath();
  if (path.endsWith(URI_PATH_SEPARATOR)) {
    path=path.substring(0,path.length() - 1);
  }
  int separatorIndex=path.lastIndexOf(URI_PATH_SEPARATOR);
  return separatorIndex != -1 ? path.substring(separatorIndex + 1) : path;
}

Fixed version (ground truth):
private String getFileName(@NonNull URI location) throws DeploymentException {
  URI normalisedLocation=this.uriNormaliser.normalise(location);
  String path=normalisedLocation.getPath();
  String pathSeparator=URI_PATH_SEPARATOR;
  if (SCHEME_FILE.equals(normalisedLocation.getScheme())) {
    pathSeparator=File.separator;
  }
  if (path.endsWith(pathSeparator)) {
    path=path.substring(0,path.length() - 1);
  }
  int separatorIndex=path.lastIndexOf(pathSeparator);
  return separatorIndex != -1 ? path.substring(separatorIndex + 1) : path;
}
Program: 93861
Project: 93861
Buggy source:
/** 
 * Constructs a new   {@link JarFileArtifactFS} for the given file which is assumed to be in JAR format.
 * @param file a JAR file
 */
JarFileArtifactFS(File file){
  super(file);
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@link JarFileArtifactFS} for the given file which is assumed to be in JAR format.
 * @param file a JAR file
 */
public JarFileArtifactFS(File file){
  super(file);
}
Program: 93863
Project: 93863
Buggy source:
private void initializeConsoleConfigurationConvertor(BundleContext context){
  ConsoleConfigurationConvertor consoleConfigurationConvertor=new ConsoleConfigurationConvertor(context);
  consoleConfigurationConvertor.start();
}

Fixed version (ground truth):
private void initializeConsoleConfigurationConvertor(BundleContext context){
  consoleConfigurationConvertor=new ConsoleConfigurationConvertor(context);
  consoleConfigurationConvertor.start();
}
Program: 93864
Project: 93864
Buggy source:
public void start(){
  Dictionary<String,String> consoleProperties=new Hashtable<String,String>();
  consoleProperties.put(Constants.SERVICE_PID,CONSOLE_PID);
  configuratorRegistration=context.registerService(ManagedService.class,new ConsoleConfigurator(),consoleProperties);
}

Fixed version (ground truth):
public void start(){
  Dictionary<String,String> consoleProperties=new Hashtable<String,String>();
  consoleProperties.put(Constants.SERVICE_PID,CONSOLE_PID);
synchronized (ConsoleConfigurationConvertor.monitor) {
    this.configuratorRegistration=this.context.registerService(ManagedService.class,new ConsoleConfigurator(),consoleProperties);
  }
}
Program: 93865
Project: 93865
Buggy source:
private void updateConfiguration(String pid,String host,String port,String enabled){
  try {
    Configuration configuration=configAdmin.getConfiguration(pid,null);
    Properties properties=new Properties();
    properties.put(HOST,host);
    properties.put(PORT,port);
    properties.put(ENABLED,enabled);
    configuration.update(properties);
  }
 catch (  IOException e) {
    String message=String.format("String_Node_Str",pid);
    logger.error(message);
    logger.trace(message,e);
  }
}

Fixed version (ground truth):
private void updateConfiguration(String pid,String host,String port,String enabled){
  try {
    Configuration configuration=this.configAdmin.getConfiguration(pid,null);
    Properties properties=new Properties();
    properties.put(HOST,host);
    properties.put(PORT,port);
    properties.put(ENABLED,enabled);
    configuration.update(properties);
  }
 catch (  IOException e) {
    String message=String.format("String_Node_Str",pid);
    this.logger.error(message);
    this.logger.trace(message,e);
  }
}
Program: 93866
Project: 93866
Buggy source:
@Override public void updated(Dictionary props) throws ConfigurationException {
  if (props != null) {
    this.properties=props;
    properties.put(Constants.SERVICE_PID,CONSOLE_PID);
  }
 else {
    return;
  }
  configuratorRegistration.setProperties(properties);
  String telnetHost=(String)properties.get(TELNET_HOST);
  String telnetPort=(String)properties.get(TELNET_PORT);
  String telnetEnabled=(String)properties.get(TELNET_ENABLED);
  updateConfiguration(TELNET_PID,telnetHost,telnetPort,telnetEnabled);
  String sshHost=(String)properties.get(SSH_HOST);
  String sshPort=(String)properties.get(SSH_PORT);
  String sshEnabled=(String)properties.get(SSH_ENABLED);
  updateConfiguration(SSH_PID,sshHost,sshPort,sshEnabled);
}

Fixed version (ground truth):
@Override public void updated(Dictionary props) throws ConfigurationException {
  if (props != null) {
    this.properties=props;
    this.properties.put(Constants.SERVICE_PID,CONSOLE_PID);
  }
 else {
    return;
  }
synchronized (ConsoleConfigurationConvertor.monitor) {
    ConsoleConfigurationConvertor.this.configuratorRegistration.setProperties(this.properties);
  }
  String telnetHost=(String)this.properties.get(TELNET_HOST);
  String telnetPort=(String)this.properties.get(TELNET_PORT);
  String telnetEnabled=(String)this.properties.get(TELNET_ENABLED);
  updateConfiguration(TELNET_PID,telnetHost,telnetPort,telnetEnabled);
  String sshHost=(String)this.properties.get(SSH_HOST);
  String sshPort=(String)this.properties.get(SSH_PORT);
  String sshEnabled=(String)this.properties.get(SSH_ENABLED);
  updateConfiguration(SSH_PID,sshHost,sshPort,sshEnabled);
}
Program: 93867
Project: 93867
Buggy source:
private void formatMissingFragment(ResolverError resolverError,StringBuilder sb){
  sb.append(this.getTypeDescription(resolverError.getType()));
  sb.append("String_Node_Str").append(resolverError.getBundle());
}

Fixed version (ground truth):
private void formatMissingFragment(ResolverError resolverError,StringBuilder sb){
  sb.append(this.getTypeDescription(resolverError.getType()));
  sb.append("String_Node_Str").append(resolverError.getBundle()).append("String_Node_Str");
  formatResolverErrorData(resolverError,sb);
  formatResolverErrorUnsatisfiedConstraint(resolverError,sb);
}
Program: 93868
Project: 93868
Buggy source:
private void formatBasicResolverError(ResolverError resolverError,StringBuilder sb){
  sb.append(this.getTypeDescription(resolverError.getType()));
  VersionConstraint unsatisfiedConstraint=resolverError.getUnsatisfiedConstraint();
  if (unsatisfiedConstraint != null) {
    formatMissingConstraintWithAttributes(resolverError,sb,unsatisfiedConstraint);
  }
 else {
    sb.append("String_Node_Str").append(resolverError.getBundle()).append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void formatBasicResolverError(ResolverError resolverError,StringBuilder sb){
  sb.append(this.getTypeDescription(resolverError.getType()));
  formatResolverErrorData(resolverError,sb);
  formatResolverErrorUnsatisfiedConstraint(resolverError,sb);
}
Program: 93869
Project: 93869
Buggy source:
@Override public final GraphNode<InstallArtifact> getGraph(){
synchronized (this.monitor) {
    return this.graph;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final GraphNode<InstallArtifact> getGraph(){
synchronized (this.monitor) {
    return this.graph;
  }
}
Program: 93870
Project: 93870
Buggy source:
/** 
 * {@inheritDoc}
 */
public GraphNode<InstallArtifact> constructInstallArtifactGraph(ArtifactIdentity artifactIdentity,ArtifactStorage artifactStorage,Map<String,String> deploymentProperties,String repositoryName) throws DeploymentException {
  if (PROPERTIES_TYPE.equalsIgnoreCase(artifactIdentity.getType())) {
    ConfigurationDeployer configDeployer=obtainConfigurationDeployer();
    ArtifactStateMonitor artifactStateMonitor=new StandardArtifactStateMonitor(this.bundleContext);
    InstallArtifact configInstallArtifact=new StandardConfigInstallArtifact(artifactIdentity,artifactStorage,this.lifecycleEngine,this.lifecycleEngine,this.lifecycleEngine,artifactStateMonitor,repositoryName,eventLogger,configDeployer);
    return constructInstallGraph(configInstallArtifact);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public GraphNode<InstallArtifact> constructInstallArtifactGraph(ArtifactIdentity artifactIdentity,ArtifactStorage artifactStorage,Map<String,String> deploymentProperties,String repositoryName) throws DeploymentException {
  if (PROPERTIES_TYPE.equalsIgnoreCase(artifactIdentity.getType())) {
    ConfigurationDeployer configDeployer=obtainConfigurationDeployer();
    ArtifactStateMonitor artifactStateMonitor=new StandardArtifactStateMonitor(this.bundleContext);
    ConfigInstallArtifact configInstallArtifact=new StandardConfigInstallArtifact(artifactIdentity,artifactStorage,this.lifecycleEngine,this.lifecycleEngine,this.lifecycleEngine,artifactStateMonitor,repositoryName,eventLogger,configDeployer);
    return constructAssociatedGraphNode(configInstallArtifact);
  }
 else {
    return null;
  }
}
Program: 93871
Project: 93871
Buggy source:
private GraphNode<InstallArtifact> createPlanGraph(ArtifactIdentity artifactIdentity,ArtifactStorage artifactStorage,PlanDescriptor planDescriptor,String repositoryName) throws DeploymentException {
  StandardPlanInstallArtifact planInstallArtifact;
  planInstallArtifact=new StandardPlanInstallArtifact(artifactIdentity,planDescriptor.getAtomic(),planDescriptor.getScoped(),artifactStorage,new StandardArtifactStateMonitor(this.bundleContext),this.scopeServiceRepository,this.scopeFactory,this.eventLogger,this.refreshHandler,repositoryName,planDescriptor.getArtifactSpecifications());
  GraphNode<InstallArtifact> graph=constructInstallGraph(planInstallArtifact);
  planInstallArtifact.setGraph(graph);
  return graph;
}

Fixed version (ground truth):
private GraphNode<InstallArtifact> createPlanGraph(ArtifactIdentity artifactIdentity,ArtifactStorage artifactStorage,PlanDescriptor planDescriptor,String repositoryName) throws DeploymentException {
  StandardPlanInstallArtifact planInstallArtifact;
  planInstallArtifact=new StandardPlanInstallArtifact(artifactIdentity,planDescriptor.getAtomic(),planDescriptor.getScoped(),artifactStorage,new StandardArtifactStateMonitor(this.bundleContext),this.scopeServiceRepository,this.scopeFactory,this.eventLogger,this.refreshHandler,repositoryName,planDescriptor.getArtifactSpecifications());
  return constructAssociatedGraphNode(planInstallArtifact);
}
Program: 93872
Project: 93872
Buggy source:
private GraphNode<InstallArtifact> createParGraph(ArtifactIdentity artifactIdentity,ArtifactStorage artifactStorage,String repositoryName) throws DeploymentException {
  ParPlanInstallArtifact parArtifact=this.parFactory.createParPlanInstallArtifact(artifactIdentity,artifactStorage,repositoryName);
  GraphNode<InstallArtifact> graph=constructInstallGraph(parArtifact);
  parArtifact.setGraph(graph);
  return graph;
}

Fixed version (ground truth):
private GraphNode<InstallArtifact> createParGraph(ArtifactIdentity artifactIdentity,ArtifactStorage artifactStorage,String repositoryName) throws DeploymentException {
  ParPlanInstallArtifact parArtifact=this.parFactory.createParPlanInstallArtifact(artifactIdentity,artifactStorage,repositoryName);
  return constructAssociatedGraphNode(parArtifact);
}
Program: 93873
Project: 93873
Buggy source:
/** 
 * {@inheritDoc}
 */
public GraphNode<InstallArtifact> constructInstallArtifactGraph(ArtifactIdentity identity,ArtifactStorage artifactStorage,Map<String,String> deploymentProperties,String repositoryName) throws DeploymentException {
  if (ArtifactIdentityDeterminer.BUNDLE_TYPE.equalsIgnoreCase(identity.getType())) {
    BundleInstallArtifact bundleInstallArtifact=this.bundleArtifactFactory.createBundleInstallArtifact(identity,artifactStorage,repositoryName);
    if (deploymentProperties != null) {
      bundleInstallArtifact.getDeploymentProperties().putAll(deploymentProperties);
    }
    GraphNode<InstallArtifact> graph=constructInstallGraph(bundleInstallArtifact);
    ((StandardBundleInstallArtifact)bundleInstallArtifact).setGraph(graph);
    return graph;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public GraphNode<InstallArtifact> constructInstallArtifactGraph(ArtifactIdentity identity,ArtifactStorage artifactStorage,Map<String,String> deploymentProperties,String repositoryName) throws DeploymentException {
  if (ArtifactIdentityDeterminer.BUNDLE_TYPE.equalsIgnoreCase(identity.getType())) {
    BundleInstallArtifact bundleInstallArtifact=this.bundleArtifactFactory.createBundleInstallArtifact(identity,artifactStorage,repositoryName);
    if (deploymentProperties != null) {
      bundleInstallArtifact.getDeploymentProperties().putAll(deploymentProperties);
    }
    return constructAssociatedGraphNode(bundleInstallArtifact);
  }
 else {
    return null;
  }
}
Program: 93874
Project: 93874
Buggy source:
@Ignore("String_Node_Str") @Test public void testThreadContextClassLoader() throws Throwable {
  File file=new File("String_Node_Str");
  deploy(file);
  Assert.assertNotNull(ApplicationContextUtils.getApplicationContext(this.context,BUNDLE_A_SYMBOLIC_NAME));
}

Fixed version (ground truth):
@Test public void testThreadContextClassLoader() throws Throwable {
  File file=new File("String_Node_Str");
  deploy(file);
  Assert.assertNotNull(ApplicationContextUtils.getApplicationContext(this.context,BUNDLE_A_SYMBOLIC_NAME));
}
Program: 93875
Project: 93875
Buggy source:
private void writePropertiesFile(final Properties hotDeployConfiguration,File target,String comment) throws IOException, FileNotFoundException {
  FileOutputStream stream=new FileOutputStream(target);
  hotDeployConfiguration.store(stream,comment);
  stream.close();
}

Fixed version (ground truth):
private void writePropertiesFile(final Properties hotDeployConfiguration,File target,String comment) throws IOException, FileNotFoundException {
  FileOutputStream stream=new FileOutputStream(target);
  hotDeployConfiguration.store(stream,comment);
  stream.flush();
  stream.close();
}
Program: 93876
Project: 93876
Buggy source:
/** 
 * Lists all bundles that export a class
 */
@Descriptor("String_Node_Str") public void clexport(@Descriptor("String_Node_Str") String className){
  String classPackage=extractPackage(className);
  if (classPackage == null) {
    return;
  }
  Bundle[] bundles=bundleContext.getBundles();
  HashMap<Long,String> foundBundles=new HashMap<Long,String>();
  for (  Bundle bundle : bundles) {
    if (ClassLoadingHelper.isPackageExported(bundleContext,classPackage,bundle)) {
      if (ClassLoadingHelper.tryToLoadClass(className,bundle) != null) {
        foundBundles.put(bundle.getBundleId(),bundle.getSymbolicName());
      }
 else {
        foundBundles.put(bundle.getBundleId(),bundle.getSymbolicName() + "String_Node_Str");
      }
    }
  }
  if (foundBundles.size() == 0) {
    System.out.println("String_Node_Str" + className + "String_Node_Str");
    return;
  }
  System.out.println();
  System.out.println("String_Node_Str" + className + "String_Node_Str");
  for (  Map.Entry<Long,String> entry : foundBundles.entrySet()) {
    System.out.println("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Lists all bundles that export a class
 */
@Descriptor("String_Node_Str") public void clexport(@Descriptor("String_Node_Str") String className){
  String classPackage=extractPackage(className);
  if (classPackage == null) {
    System.out.println("String_Node_Str" + className + "String_Node_Str");
    return;
  }
  Bundle[] bundles=bundleContext.getBundles();
  HashMap<Long,String> foundBundles=new HashMap<Long,String>();
  for (  Bundle bundle : bundles) {
    if (ClassLoadingHelper.isPackageExported(bundleContext,classPackage,bundle)) {
      if (ClassLoadingHelper.tryToLoadClass(className,bundle) != null) {
        foundBundles.put(bundle.getBundleId(),bundle.getSymbolicName());
      }
 else {
        foundBundles.put(bundle.getBundleId(),bundle.getSymbolicName() + "String_Node_Str");
      }
    }
  }
  if (foundBundles.size() == 0) {
    System.out.println("String_Node_Str" + className + "String_Node_Str");
    return;
  }
  System.out.println();
  System.out.println("String_Node_Str" + className + "String_Node_Str");
  for (  Map.Entry<Long,String> entry : foundBundles.entrySet()) {
    System.out.println("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
  }
}