nus-yam/ex-repair huggingface dataset:
Program: 46734
Project: 46734
Buggy source:
/** 
 * Called when player interacts with the world.
 * @param event event occurred itself.
 */
@Override public void onPlayerInteract(PlayerInteractEvent event){
  if (event.isCancelled() || !(event.getClickedBlock().getType().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN))) {
    return;
  }
  Sign clickedSign=(Sign)event.getClickedBlock().getState();
  Session playerSession=plugin.getSessionManager().get(event.getPlayer());
  playerSession.setSelectedSign(clickedSign);
  if (Session.Activator.SELECT_SIGN.equals(playerSession.getTaskActivator())) {
    playerSession.getTask().run();
    playerSession.setTaskActivator(null);
  }
 else   if (clickedSign.getLine(0).equals(plugin.getConfiguration(clickedSign.getWorld()).getSignTitle())) {
    Residence residence=nation.getResidence(clickedSign);
    try {
      nation.sendInformation(event.getPlayer(),residence);
    }
 catch (    MyResidenceException e) {
      Location location=event.getClickedBlock().getLocation();
      plugin.severe("String_Node_Str",location.getWorld().getName(),location.getBlockX(),location.getBlockY(),location.getBlockZ());
      e.printStackTrace();
    }
  }
 else {
    playerSession.setSelectedSign(null);
  }
}

Fixed version (ground truth):
/** 
 * Called when player interacts with the world.
 * @param event event occurred itself.
 */
@Override public void onPlayerInteract(PlayerInteractEvent event){
  if (event.isCancelled() || !(event.getClickedBlock().getType().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN))) {
    return;
  }
  Sign clickedSign=(Sign)event.getClickedBlock().getState();
  Session playerSession=plugin.getSessionManager().get(event.getPlayer());
  playerSession.setSelectedSignBlock(event.getClickedBlock());
  if (Session.Activator.SELECT_SIGN.equals(playerSession.getTaskActivator())) {
    playerSession.getTask().run();
    playerSession.setTaskActivator(null);
  }
 else   if (clickedSign.getLine(0).equals(plugin.getConfiguration(clickedSign.getWorld()).getSignTitle())) {
    Residence residence=nation.getResidence(clickedSign);
    try {
      nation.sendInformation(event.getPlayer(),residence);
    }
 catch (    MyResidenceException e) {
      Location location=event.getClickedBlock().getLocation();
      plugin.severe("String_Node_Str",location.getWorld().getName(),location.getBlockX(),location.getBlockY(),location.getBlockZ());
    }
  }
 else {
    playerSession.setSelectedSignBlock(null);
  }
}
Program: 46735
Project: 46735
Buggy source:
/** 
 * Called when a residence is removed.
 * @param event the event itself.
 */
@Override public void onResidenceRemoved(ResidenceRemovedEvent event){
  try {
    Block signBlock=nation.getResidenceManager(event.getResidence()).getSign();
    Sign sign=(Sign)signBlock.getState();
    for (int index=0; index < 4; ++index) {
      sign.setLine(index,"String_Node_Str");
    }
  }
 catch (  NullPointerException e) {
    plugin.severe("String_Node_Str",event.getResidence().getName());
  }
}

Fixed version (ground truth):
/** 
 * Called when a residence is removed.
 * @param event the event itself.
 */
@Override public void onResidenceRemoved(ResidenceRemovedEvent event){
  try {
    Block signBlock=nation.getResidenceManager(event.getResidence()).getSign();
    Sign sign=(Sign)signBlock.getState();
    for (int index=0; index < 4; ++index) {
      sign.setLine(index,"String_Node_Str");
    }
  }
 catch (  ResidenceSignMissingException e) {
    plugin.severe("String_Node_Str",event.getResidence().getName());
  }
}
Program: 46736
Project: 46736
Buggy source:
/** 
 * Sets the area of the residence.
 * @param selection the area to set.
 */
public void setArea(Selection selection){
  ResidenceArea area=nation.getDatabase().find(ResidenceArea.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  if (area == null) {
    area=new ResidenceArea();
    area.setResidenceId(residence.getId());
  }
  area.setWorld(selection.getWorld().getName());
  area.setHighX(selection.getMaximumPoint().getBlockX());
  area.setHighY(selection.getMaximumPoint().getBlockY());
  area.setHighZ(selection.getMaximumPoint().getBlockZ());
  area.setLowX(selection.getMinimumPoint().getBlockX());
  area.setLowY(selection.getMinimumPoint().getBlockY());
  area.setLowZ(selection.getMinimumPoint().getBlockZ());
  nation.save(selection);
}

Fixed version (ground truth):
/** 
 * Sets the area of the residence.
 * @param selection the area to set.
 */
public void setArea(Selection selection){
  ResidenceArea area=nation.getDatabase().find(ResidenceArea.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  if (area == null) {
    area=new ResidenceArea();
    area.setResidenceId(residence.getId());
  }
  area.setWorld(selection.getWorld().getName());
  area.setHighX(selection.getMaximumPoint().getBlockX());
  area.setHighY(selection.getMaximumPoint().getBlockY());
  area.setHighZ(selection.getMaximumPoint().getBlockZ());
  area.setLowX(selection.getMinimumPoint().getBlockX());
  area.setLowY(selection.getMinimumPoint().getBlockY());
  area.setLowZ(selection.getMinimumPoint().getBlockZ());
  nation.save(area);
}
Program: 46737
Project: 46737
Buggy source:
/** 
 * @return the sign of the residence. 
 */
public Block getSign(){
  ResidenceSign residenceSign=nation.getDatabase().find(ResidenceSign.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  if (residenceSign != null) {
    World world=plugin.getServer().getWorld(residenceSign.getWorld());
    Block block=world.getBlockAt(new Location(world,residenceSign.getX(),residenceSign.getY(),residenceSign.getZ()));
    if (block != null && block.getState() instanceof Sign) {
      return block;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @return the sign of the residence. 
 */
public Block getSign() throws ResidenceSignMissingException {
  ResidenceSign residenceSign=nation.getDatabase().find(ResidenceSign.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  if (residenceSign != null) {
    World world=Bukkit.getServer().getWorld(residenceSign.getWorld());
    Block block=world.getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
    if (block != null && block.getState() instanceof Sign) {
      return block;
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  throw new ResidenceSignMissingException(residence);
}
Program: 46738
Project: 46738
Buggy source:
@Command(aliases={"String_Node_Str"},desc="String_Node_Str",max=0) public static void home(final CommandContext args,final MyResidence plugin,final Nation nation,final Player player,final Session session) throws MyResidenceException {
}

Fixed version (ground truth):
@Command(aliases={"String_Node_Str"},desc="String_Node_Str") public static void home(final CommandContext args,final MyResidence plugin,final Nation nation,final Player player,final Session session) throws MyResidenceException {
  Residence residence=nation.getResidence(session.getLastHomeResidenceId());
  if (args.argsLength() > 0) {
    List<Residence> residences=nation.findResidence(nation.getInhabitant(session.getPlayerId()),args.getJoinedStrings(0));
    if (residences.size() != 1) {
      throw new MyResidenceException("String_Node_Str");
    }
    residence=residences.get(0);
  }
  session.setLastHomeResidenceId(residence.getId());
  player.teleport(nation.getResidenceManager(residence).getHome());
  Chat.sendMessage(player,"String_Node_Str");
}
Program: 46739
Project: 46739
Buggy source:
@Command(aliases={"String_Node_Str","String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",min=1,max=1) @CommandPermissions({"String_Node_Str"}) public static void sell(final CommandContext args,final MyResidence plugin,final Nation nation,final Player player,final Session session) throws MyResidenceException {
  Residence residence=session.getSelectedResidence();
  if (!session.hasResidenceOwnerRights(residence)) {
    throw new NotOwnException();
  }
  double price=args.getDouble(0,residence.getValue());
  residence.setForSale(true);
  residence.setPrice(price);
  if (residence.getValue() <= 0.0) {
    residence.setValue(price);
  }
  nation.getDatabase().save(residence);
  Chat.sendMessage(player,"String_Node_Str");
  plugin.getEventManager().callEvent(new ResidenceChangedEvent(session,residence));
}

Fixed version (ground truth):
@Command(aliases={"String_Node_Str","String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",min=0,max=1) @CommandPermissions({"String_Node_Str"}) public static void sell(final CommandContext args,final MyResidence plugin,final Nation nation,final Player player,final Session session) throws MyResidenceException {
  Residence residence=session.getSelectedResidence();
  if (!session.hasResidenceOwnerRights(residence)) {
    throw new NotOwnException();
  }
  double price=args.getDouble(0,residence.getValue());
  residence.setForSale(true);
  residence.setPrice(price);
  residence.setOwnerId(session.getPlayerId());
  if (residence.getValue() <= 0.0) {
    residence.setValue(price);
  }
  nation.getDatabase().save(residence);
  Chat.sendMessage(player,"String_Node_Str");
  plugin.getEventManager().callEvent(new ResidenceChangedEvent(session,residence));
}
Program: 46742
Project: 46742
Buggy source:
/** 
 * Calls a new event.
 * @param o the event to call.
 */
public void callEvent(final Object o){
  Runnable eventRunnable=new Runnable(){
    public void run(){
      for (      EventListener listener : eventListeners) {
        if (listener.canHandle(o)) {
          try {
            listener.handle(o);
          }
 catch (          Throwable e) {
            plugin.severe("String_Node_Str",e.getClass().getName());
            e.printStackTrace();
          }
        }
      }
    }
  }
;
  plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,eventRunnable);
}

Fixed version (ground truth):
/** 
 * Calls a new event.
 * @param o the event to call.
 */
public void callEvent(final Object o){
  Runnable eventRunnable=new Runnable(){
    public void run(){
      for (      EventListener listener : eventListeners) {
        if (listener.canHandle(o)) {
          try {
            listener.handle(o);
          }
 catch (          Throwable e) {
            plugin.severe("String_Node_Str",e.getClass().getName(),listener.getClass().getName());
            e.printStackTrace();
          }
        }
      }
    }
  }
;
  plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,eventRunnable);
}
Program: 46743
Project: 46743
Buggy source:
public void run(){
  for (  EventListener listener : eventListeners) {
    if (listener.canHandle(o)) {
      try {
        listener.handle(o);
      }
 catch (      Throwable e) {
        plugin.severe("String_Node_Str",e.getClass().getName());
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  for (  EventListener listener : eventListeners) {
    if (listener.canHandle(o)) {
      try {
        listener.handle(o);
      }
 catch (      Throwable e) {
        plugin.severe("String_Node_Str",e.getClass().getName(),listener.getClass().getName());
        e.printStackTrace();
      }
    }
  }
}
Program: 46744
Project: 46744
Buggy source:
/** 
 * Creates a new ResidenceSignMissingException for the passed Residence.
 * @param residence the Residence which should own the sign.
 */
public ResidenceSignMissingException(Residence residence){
  super("String_Node_Str" + residence.getName() + "String_Node_Str");
  this.residence=residence;
}

Fixed version (ground truth):
/** 
 * Creates a new ResidenceSignMissingException for the passed Residence.
 * @param residence the residence to create.
 * @param message   the message to send.
 */
public ResidenceSignMissingException(Residence residence,String message){
  super(message);
  this.residence=residence;
}
Program: 46745
Project: 46745
Buggy source:
/** 
 * Called when an api gets enabled.
 * @param event the occurred event.
 */
@Override public void onPluginEnable(PluginEnableEvent event){
  if (plugin.getWorldEdit() == null && "String_Node_Str".equals(event.getPlugin().getDescription().getName())) {
    plugin.setWorldEdit((WorldEditPlugin)event.getPlugin());
    plugin.info("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Called when an api gets enabled.
 * @param event the occurred event.
 */
@Override public void onPluginEnable(PluginEnableEvent event){
  if (!plugin.hasWorldEdit() && "String_Node_Str".equals(event.getPlugin().getDescription().getName())) {
    plugin.setWorldEdit((WorldEditPlugin)event.getPlugin());
    plugin.info("String_Node_Str");
  }
}
Program: 46746
Project: 46746
Buggy source:
/** 
 * Called when an api gets disabled.
 * @param event the occurred event.
 */
@Override public void onPluginDisable(PluginDisableEvent event){
  if (plugin.getWorldEdit() != null && "String_Node_Str".equals(event.getPlugin().getDescription().getName())) {
    plugin.setWorldEdit(null);
    plugin.info("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Called when an api gets disabled.
 * @param event the occurred event.
 */
@Override public void onPluginDisable(PluginDisableEvent event){
  if (plugin.hasWorldEdit() && "String_Node_Str".equals(event.getPlugin().getDescription().getName())) {
    plugin.setWorldEdit(null);
    plugin.info("String_Node_Str");
  }
}
Program: 46747
Project: 46747
Buggy source:
/** 
 * Creates a new WorldEditPluginListener.
 * @param plugin the api which holds the instance.
 */
public WorldEditPluginListener(final MyResidencePlugin residencePlugin){
  this.plugin=residencePlugin;
  for (  Plugin plugin : Bukkit.getServer().getPluginManager().getPlugins()) {
    if (plugin.isEnabled()) {
      onPluginEnable(new PluginEnableEvent(plugin));
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new WorldEditPluginListener.
 * @param residencePlugin the api which holds the instance.
 */
public WorldEditPluginListener(final MyResidencePlugin residencePlugin){
  this.plugin=residencePlugin;
  for (  Plugin plugin : Bukkit.getServer().getPluginManager().getPlugins()) {
    if (plugin.isEnabled()) {
      onPluginEnable(new PluginEnableEvent(plugin));
    }
  }
}
Program: 46748
Project: 46748
Buggy source:
/** 
 * Removes a residence.
 * @param residence residence to remove.
 */
public void remove(Residence residence){
  final ResidenceArea residenceArea=getDatabase().find(ResidenceArea.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  final ResidenceSign residenceSign=getDatabase().find(ResidenceSign.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  final HomePoint residenceHomes=getDatabase().find(HomePoint.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  final List<ResidenceFlag> residenceFlags=getDatabase().find(ResidenceFlag.class).where().eq("String_Node_Str",residence.getId()).findList();
  final List<ResidenceMember> residenceMembers=getDatabase().find(ResidenceMember.class).where().eq("String_Node_Str",residence.getId()).findList();
  final List<Like> residenceLikes=getDatabase().find(Like.class).where().eq("String_Node_Str",residence.getId()).findList();
  World signWorld=Bukkit.getServer().getWorld(residenceSign.getWorld());
  final Sign sign=(Sign)signWorld.getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ()).getState();
  getDatabase().delete(residence);
  getDatabase().delete(residenceArea);
  getDatabase().delete(residenceSign);
  getDatabase().delete(residenceHomes);
  getDatabase().delete(residenceMembers);
  getDatabase().delete(residenceFlags);
  getDatabase().delete(residenceLikes);
}

Fixed version (ground truth):
/** 
 * Removes a residence.
 * @param residence residence to remove.
 */
public void remove(Residence residence){
  if (residence == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final ResidenceArea residenceArea=getDatabase().find(ResidenceArea.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  final ResidenceSign residenceSign=getDatabase().find(ResidenceSign.class).where().eq("String_Node_Str",residence.getId()).findUnique();
  final List<HomePoint> residenceHomes=getDatabase().find(HomePoint.class).where().eq("String_Node_Str",residence.getId()).findList();
  final List<ResidenceFlag> residenceFlags=getDatabase().find(ResidenceFlag.class).where().eq("String_Node_Str",residence.getId()).findList();
  final List<ResidenceMember> residenceMembers=getDatabase().find(ResidenceMember.class).where().eq("String_Node_Str",residence.getId()).findList();
  final List<Like> residenceLikes=getDatabase().find(Like.class).where().eq("String_Node_Str",residence.getId()).findList();
  World signWorld=Bukkit.getServer().getWorld(residenceSign.getWorld());
  final Sign sign=(Sign)signWorld.getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ()).getState();
  getDatabase().delete(residence);
  if (residenceArea != null) {
    getDatabase().delete(residenceArea);
  }
 else {
    plugin.warning("String_Node_Str");
  }
  getDatabase().delete(residenceSign);
  getDatabase().delete(residenceHomes);
  getDatabase().delete(residenceMembers);
  getDatabase().delete(residenceFlags);
  getDatabase().delete(residenceLikes);
}
Program: 46750
Project: 46750
Buggy source:
/** 
 * Updates the sign linked to passed Residence.
 * @param residence Residence to update.
 */
void updateResidenceSign(Residence residence) throws ResidenceSignMissingException ;

Fixed version (ground truth):
/** 
 * Updates the sign linked to passed Residence.
 * @param residence Residence to update.
 * @throws ResidenceSignMissingException the sign of the Residence is missing!
 */
void updateResidenceSign(Residence residence) throws ResidenceSignMissingException ;
Program: 46751
Project: 46751
Buggy source:
/** 
 * Returns the major of the passed Town.
 * @param town the Town.
 * @return PlayerData of the major.
 */
PlayerData getMajor(Town town);

Fixed version (ground truth):
/** 
 * Returns the major of the passed Town.
 * @param town the Town.
 * @return PlayerData of the major.
 */
Inhabitant getMajor(Town town);
Program: 46752
Project: 46752
Buggy source:
/** 
 * Returns the PlayerData of the owner of the passed Residence.
 * @param residence the Residence.
 * @return PlayerData of the owner.
 */
PlayerData getOwner(Residence residence);

Fixed version (ground truth):
/** 
 * Returns the Inhabitant of the owner of the passed Residence.
 * @param residence the Residence.
 * @return PlayerData of the owner.
 */
Inhabitant getOwner(Residence residence);
Program: 46754
Project: 46754
Buggy source:
private void updateView(){
  CircleLayout<Person,Trust> layout=new CircleLayout<Person,Trust>(currentGraph);
  layout.setSize(getSize());
  VisualizationViewer<Person,Trust> vv=new VisualizationViewer<Person,Trust>(layout);
  vv.setPreferredSize(getSize());
  DefaultModalGraphMouse<Person,Trust> gm=new DefaultModalGraphMouse<Person,Trust>();
  gm.setMode(Mode.TRANSFORMING);
  vv.setGraphMouse(gm);
  vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<Person>(){
    @Override public String transform(    Person v){
      return v.getName();
    }
  }
);
  add(vv);
  repaint();
}

Fixed version (ground truth):
private void updateView(){
  CircleLayout<Person,Trust> layout=new CircleLayout<Person,Trust>(currentGraph);
  layout.setSize(getSize());
  VisualizationViewer<Person,Trust> vv=new VisualizationViewer<Person,Trust>(layout);
  vv.setPreferredSize(getSize());
  DefaultModalGraphMouse<Person,Trust> gm=new DefaultModalGraphMouse<Person,Trust>();
  gm.setMode(Mode.TRANSFORMING);
  vv.setGraphMouse(gm);
  vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<Person>(){
    @Override public String transform(    Person v){
      return v.getName();
    }
  }
);
  add(vv);
  invalidate();
  repaint();
}
Program: 46755
Project: 46755
Buggy source:
public ChainOfTrustFrame(){
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setSize(500,500);
  setJMenuBar(createMenubar());
  setLayout(new BorderLayout());
}

Fixed version (ground truth):
public ChainOfTrustFrame(){
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setSize(500,500);
  setJMenuBar(createMenubar());
  setLayout(new BorderLayout());
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosed(    WindowEvent e){
      System.exit(0);
    }
  }
);
  Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
  setLocation((d.width - getWidth()) / 2,(d.height - getHeight()) / 2);
}
Program: 46756
Project: 46756
Buggy source:
private void init(){
  lblKeys=new javax.swing.JLabel();
  scrollPane1=new javax.swing.JScrollPane();
  txtKeys=new javax.swing.JTextArea();
  lblRecur=new javax.swing.JLabel();
  sliRecur=new javax.swing.JSlider();
  lblKeyserver=new javax.swing.JLabel();
  txtKeyserver=new javax.swing.JTextField();
  sliRecur.setMinimum(1);
  sliRecur.setMaximum(1000);
  btnOk.addActionListener(this);
  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  setLayout(new javax.swing.BoxLayout(getContentPane(),javax.swing.BoxLayout.PAGE_AXIS));
  lblKeys.setText("String_Node_Str");
  add(lblKeys);
  txtKeys.setRows(5);
  scrollPane1.setViewportView(txtKeys);
  add(scrollPane1);
  add(new JSeparator());
  lblRecur.setText("String_Node_Str");
  add(lblRecur);
  add(sliRecur);
  add(new JSeparator());
  lblKeyserver.setText("String_Node_Str");
  add(lblKeyserver);
  add(txtKeyserver);
  add(new JSeparator());
  add(btnOk);
  txtKeys.setText("String_Node_Str");
  txtKeyserver.setText("String_Node_Str");
  sliRecur.setValue(10);
  pack();
}

Fixed version (ground truth):
private void init(){
  lblKeys=new javax.swing.JLabel();
  scrollPane1=new javax.swing.JScrollPane();
  txtKeys=new javax.swing.JTextArea();
  lblRecur=new javax.swing.JLabel();
  sliRecur=new javax.swing.JSlider();
  lblKeyserver=new javax.swing.JLabel();
  txtKeyserver=new javax.swing.JTextField();
  sliRecur.setMinimum(1);
  sliRecur.setMaximum(1000);
  btnOk.addActionListener(this);
  btnCancel.addActionListener(this);
  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  setLayout(new javax.swing.BoxLayout(getContentPane(),javax.swing.BoxLayout.PAGE_AXIS));
  lblKeys.setText("String_Node_Str");
  add(lblKeys);
  txtKeys.setRows(5);
  scrollPane1.setViewportView(txtKeys);
  add(scrollPane1);
  add(new JSeparator());
  lblRecur.setText("String_Node_Str");
  add(lblRecur);
  add(sliRecur);
  add(new JSeparator());
  lblKeyserver.setText("String_Node_Str");
  add(lblKeyserver);
  add(txtKeyserver);
  add(new JSeparator());
  JPanel p=new JPanel();
  p.add(btnCancel);
  p.add(btnOk);
  add(p);
  txtKeys.setText("String_Node_Str");
  txtKeyserver.setText("String_Node_Str");
  sliRecur.setValue(10);
  pack();
}
Program: 46757
Project: 46757
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  setVisible(false);
  accepted=true;
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  setVisible(false);
  if (e.getSource() == btnOk)   accepted=true;
}
Program: 46758
Project: 46758
Buggy source:
public FetchDialog(Frame owner){
  super(owner);
  setModal(true);
  setTitle("String_Node_Str");
  setSize(500,500);
  setResizable(false);
  init();
}

Fixed version (ground truth):
public FetchDialog(Frame owner){
  super(owner);
  setModal(true);
  setTitle("String_Node_Str");
  setSize(500,500);
  setResizable(false);
  init();
  Dimension d=owner.getSize();
  setLocation(owner.getX() + (d.width - getWidth()) / 2,owner.getY());
}
Program: 46759
Project: 46759
Buggy source:
/** 
 * TODO: Document relativePath(File, File)
 * @param base
 * @param target
 * @return
 */
public static String realtivePath(File base,File target){
  final String[] fromPath=explodedPath(base.isDirectory() ? base.getParentFile() : base);
  final String[] toPath=explodedPath(target);
  final int common;
  int i;
  for (i=0; i < Math.min(fromPath.length,toPath.length); i++) {
    if (!fromPath[i].equals(toPath[i])) {
      break;
    }
  }
  common=i;
  if (i == 0) {
    return target.getPath();
  }
  StringBuilder ret=new StringBuilder();
  for (i=common; i < fromPath.length; i++) {
    ret.append("String_Node_Str");
    ret.append(File.separatorChar);
  }
  for (i=common; i < toPath.length; i++) {
    ret.append(toPath[i]);
    ret.append(File.separatorChar);
  }
  ret.deleteCharAt(ret.length() - 1);
  return ret.toString();
}

Fixed version (ground truth):
/** 
 * TODO: Document relativePath(File, File)
 * @param base
 * @param target
 * @return
 */
public static String realtivePath(File base,File target){
  final String[] fromPath=explodedPath(base.isDirectory() ? base.getParentFile() : base);
  final String[] toPath=explodedPath(target);
  final int common;
  int i;
  for (i=0; i < Math.min(fromPath.length,toPath.length); i++) {
    if (!fromPath[i].equals(toPath[i])) {
      break;
    }
  }
  common=i;
  if (i == 0) {
    return target.getPath();
  }
  StringBuilder ret=new StringBuilder();
  for (i=common; i < fromPath.length - 1; ++i) {
    ret.append("String_Node_Str");
    ret.append(File.separatorChar);
  }
  for (i=common; i < toPath.length; ++i) {
    ret.append(toPath[i]);
    ret.append(File.separatorChar);
  }
  ret.deleteCharAt(ret.length() - 1);
  return ret.toString();
}
Program: 46760
Project: 46760
Buggy source:
/** 
 * Determine whether the parameter list from the parsed java source matches that of a web service method.
 * @param methodParameters parameters of method from java source
 * @param parameters parameters from web service method
 * @return <code>true</code> when the parameters match by type or the givenlist of method parameters is <code>null</code> and the web service parameters are empty, <code>false</code> otherwise.
 */
private boolean parametersMatch(final List<japa.parser.ast.body.Parameter> methodParameters,final Collection<Parameter> parameters){
  if (methodParameters == null && parameters.isEmpty()) {
    return true;
  }
  boolean matches=methodParameters.size() == parameters.size();
  if (matches) {
    final Iterator<japa.parser.ast.body.Parameter> params=methodParameters.iterator();
    japa.parser.ast.body.Parameter parameter;
    for (    final Parameter param : parameters) {
      parameter=params.next();
      final String className=classNameResolver.resolveClassName(parameter);
      final org.arachna.netweaver.nwdi.documenter.facets.webservices.Type type=param.getType();
      if (!type.getName().equals(className)) {
        matches=false;
        break;
      }
    }
  }
  return matches;
}

Fixed version (ground truth):
/** 
 * Determine whether the parameter list from the parsed java source matches that of a web service method.
 * @param methodParameters parameters of method from java source
 * @param parameters parameters from web service method
 * @return <code>true</code> when the parameters match by type or the givenlist of method parameters is <code>null</code> and the web service parameters are empty, <code>false</code> otherwise.
 */
private boolean parametersMatch(final List<japa.parser.ast.body.Parameter> methodParameters,final Collection<Parameter> parameters){
  if (methodParameters == null && parameters.isEmpty()) {
    return true;
  }
  boolean matches=methodParameters != null && methodParameters.size() == parameters.size();
  if (matches) {
    final Iterator<japa.parser.ast.body.Parameter> params=methodParameters.iterator();
    japa.parser.ast.body.Parameter parameter;
    for (    final Parameter param : parameters) {
      parameter=params.next();
      final String className=classNameResolver.resolveClassName(parameter);
      final org.arachna.netweaver.nwdi.documenter.facets.webservices.Type type=param.getType();
      if (!type.getName().equals(className)) {
        matches=false;
        break;
      }
    }
  }
  return matches;
}
Program: 46761
Project: 46761
Buggy source:
public static void main(final String[] args) throws IOException, SAXException {
  final DevelopmentComponentFactory dcFactory=new DevelopmentComponentFactory();
  final DevelopmentConfigurationReader reader=new DevelopmentConfigurationReader(dcFactory);
  new XmlReaderHelper(reader).parse(new FileReader("String_Node_Str"));
  dcFactory.updateUsingDCs();
  for (  final DevelopmentComponent component : dcFactory.getAll()) {
    if (!"String_Node_Str".equals(component.getCompartment().getVendor())) {
      component.setNeedsRebuild(true);
    }
  }
  String dot="String_Node_Str";
  PrintStream s=new PrintStream(new File("String_Node_Str"));
  new ReportGenerator(s,reader.getDevelopmentConfiguration(),dcFactory,"String_Node_Str",dot,Pattern.compile("String_Node_Str")).execute();
  s.close();
}

Fixed version (ground truth):
public static void main(final String[] args) throws IOException, SAXException {
  final DevelopmentComponentFactory dcFactory=new DevelopmentComponentFactory();
  final DevelopmentConfigurationReader reader=new DevelopmentConfigurationReader(dcFactory);
  new XmlReaderHelper(reader).parse(new FileReader("String_Node_Str"));
  dcFactory.updateUsingDCs();
  for (  final DevelopmentComponent component : dcFactory.getAll()) {
    if (!"String_Node_Str".equals(component.getCompartment().getVendor())) {
      component.setNeedsRebuild(true);
    }
  }
  String dot="String_Node_Str";
  PrintStream s=new PrintStream(new File("String_Node_Str"));
  new ReportGenerator(System.err,reader.getDevelopmentConfiguration(),dcFactory,"String_Node_Str",dot,Pattern.compile("String_Node_Str")).execute();
  s.close();
}
Program: 46762
Project: 46762
Buggy source:
/** 
 * @param writer
 * @param component
 * @throws IOException
 * @throws ResourceNotFoundException
 * @throws MethodInvocationException
 * @throws ParseErrorException
 */
public void execute(final Writer writer,final DevelopmentComponent component) throws ParseErrorException, MethodInvocationException, ResourceNotFoundException, IOException {
  final Context context=new VelocityContext();
  context.put("String_Node_Str",component);
  context.put("String_Node_Str",bundle);
  context.put("String_Node_Str",component.getUsedDevelopmentComponents());
  context.put("String_Node_Str",new Formatter(locale));
  context.put("String_Node_Str",dcFactory);
  context.put("String_Node_Str","String_Node_Str");
  velocityEngine.evaluate(context,writer,"String_Node_Str",getTemplateReader());
  writer.flush();
}

Fixed version (ground truth):
/** 
 * @param writer
 * @param component
 * @throws IOException
 * @throws ResourceNotFoundException
 * @throws MethodInvocationException
 * @throws ParseErrorException
 */
public void execute(final Writer writer,final DevelopmentComponent component) throws ParseErrorException, MethodInvocationException, ResourceNotFoundException, IOException {
  final Context context=new VelocityContext();
  context.put("String_Node_Str",component);
  context.put("String_Node_Str",bundle);
  context.put("String_Node_Str",component.getUsedDevelopmentComponents());
  context.put("String_Node_Str",new BundleHelper(bundle,locale));
  context.put("String_Node_Str",dcFactory);
  velocityEngine.evaluate(context,writer,"String_Node_Str",getTemplateReader());
  writer.flush();
}
Program: 46763
Project: 46763
Buggy source:
@Test public void testGetById() throws Exception {
  testSave();
  listAll=dao.getAll();
  int size=listAll.size();
  Assert.assertEquals(2,size,DB_MUST_BE_NOT_EMPTY);
  for (  Persistent p : listAll) {
    dao.delete(dao.get(p.getId()));
  }
  testDBEmpty();
}

Fixed version (ground truth):
@Test public void testGetById() throws Exception {
  testSave();
  listAll=dao.getAll();
  int size=listAll.size();
  Assert.assertEquals(1,size,DB_MUST_BE_NOT_EMPTY);
  for (  Persistent p : listAll) {
    dao.delete(dao.get(p.getId()));
  }
  testDBEmpty();
}
Program: 46764
Project: 46764
Buggy source:
@Test public void testGetTopicWithPosts() throws Exception {
  User user=new User();
  user.setNickName("String_Node_Str");
  getUserDao().saveOrUpdate(user);
  Post post1=new Post();
  post1.setPostContent("String_Node_Str");
  Post post2=new Post();
  post2.setPostContent("String_Node_Str");
  getPostDao().saveOrUpdate(post1);
  getPostDao().saveOrUpdate(post2);
  entity.addPost(post1);
  entity.addPost(post2);
  Collection allPosts=entity.getPosts();
  entity.setTopicStarter(user);
  dao.saveOrUpdate(entity);
  Long topicId=entity.getId();
  Topic loadedTopic=dao.getTopicWithPosts(topicId);
  Assert.assertEquals(allPosts,loadedTopic.getPosts(),TOPIC_POSTS_ERROR);
}

Fixed version (ground truth):
@Test public void testGetTopicWithPosts() throws Exception {
  testSave();
  Topic topic=dao.getTopicWithPosts(entity.getId());
  List postst=topic.getPosts();
  Assert.assertEquals(postst.size(),1);
}
Program: 46765
Project: 46765
Buggy source:
@Test public void testSave() throws Exception {
  dao.saveOrUpdate(entity);
  dao.saveOrUpdate(new Topic());
  int size=dao.getAll().size();
  Assert.assertEquals(2,size,ENTITIES_IS_NOT_INCREASED_BY_2);
}

Fixed version (ground truth):
@Test public void testSave() throws Exception {
  dao.saveOrUpdate(entity);
  int size=dao.getAll().size();
  Assert.assertEquals(1,size,ENTITIES_IS_NOT_INCREASED_BY_2);
}
Program: 46766
Project: 46766
Buggy source:
@Test public void testEntityState() throws Exception {
  testSave();
  listAll=dao.getAll();
  Assert.assertTrue(entity.equals(listAll.get(0)),PERSISTENCE_ERROR);
  Assert.assertFalse(entity.equals(listAll.get(1)),PERSISTENCE_ERROR);
}

Fixed version (ground truth):
@Test public void testEntityState() throws Exception {
  testSave();
  listAll=dao.getAll();
  Assert.assertTrue(entity.equals(listAll.get(0)),PERSISTENCE_ERROR);
}
Program: 46767
Project: 46767
Buggy source:
@BeforeMethod public void setUp() throws Exception {
  dao=new TopicHibernateDao();
  dao.setSessionFactory(sessionFactory);
  Assert.assertNotNull(sessionFactory,SESSION_FACTORY_IS_NULL);
  entity=new Topic();
  entity.setTitle("String_Node_Str");
  entity.setTopicStarter(null);
  clearDbTable(entity,sessionFactory);
}

Fixed version (ground truth):
@BeforeMethod public void setUp() throws Exception {
  entity=Topic.createNewTopic();
  clearDbTable(entity,sessionFactory);
  initUser();
  initPost();
  Assert.assertNotNull(testPost);
  entity.setTitle("String_Node_Str");
  entity.addPost(testPost);
  entity.setTopicStarter(testUser);
}
Program: 46768
Project: 46768
Buggy source:
@Test public void testDeleteById() throws Exception {
  testSave();
  listAll=dao.getAll();
  int size=listAll.size();
  Assert.assertEquals(2,size,DB_MUST_BE_NOT_EMPTY);
  for (  Persistent p : listAll) {
    dao.delete(p.getId());
  }
  testDBEmpty();
}

Fixed version (ground truth):
@Test public void testDeleteById() throws Exception {
  testSave();
  listAll=dao.getAll();
  int size=listAll.size();
  Assert.assertEquals(1,size,DB_MUST_BE_NOT_EMPTY);
  for (  Persistent p : listAll) {
    dao.delete(p.getId());
  }
  testDBEmpty();
}
Program: 46769
Project: 46769
Buggy source:
private String resolvePath(Folder parent) throws Exception {
  StoredItem item=Storage.getInstance().findById(parent.getId());
  String path=File.separator + parent.getName();
  while (item == null) {
    Folder ancestor=parent.getFolderParent();
    if (ancestor == null) {
      return null;
    }
    item=Storage.getInstance().findById(ancestor.getId());
    if (item == null) {
      path=File.separator + ancestor.getName() + path;
    }
 else {
      path=item.getPath() + path;
    }
  }
  return Config.getInstance().getWatchParent() + path;
}

Fixed version (ground truth):
private String resolvePath(Folder parent) throws Exception {
  StoredItem item=Storage.getInstance().findById(parent.getId());
  String path=File.separator + parent.getName();
  Folder ancestor=parent.getFolderParent();
  while (item == null) {
    if (ancestor == null) {
      return null;
    }
    item=Storage.getInstance().findById(ancestor.getId());
    if (item == null) {
      path=File.separator + ancestor.getName() + path;
    }
 else {
      path=item.getPath() + path;
    }
    ancestor=ancestor.getFolderParent();
  }
  return Config.getInstance().getWatchParent() + path;
}
Program: 46770
Project: 46770
Buggy source:
private void exit(){
  serviceInterface.logout();
  WindowSaver.saveSettings();
  System.exit(0);
}

Fixed version (ground truth):
private void exit(){
  try {
    serviceInterface.logout();
  }
 catch (  Exception e) {
    myLogger.error(e);
  }
  WindowSaver.saveSettings();
  System.exit(0);
}
Program: 46771
Project: 46771
Buggy source:
public void closeAllFileSystems(){
  for (  DefaultFileSystemManager fsm : allFileSystems) {
    fsm.close();
  }
}

Fixed version (ground truth):
public void closeAllFileSystems(){
  for (  FileSystem fs : allFileSystems) {
    fs.getFileSystemManager().closeFileSystem(fs);
  }
}
Program: 46772
Project: 46772
Buggy source:
/** 
 * Connects to the filesystem where the file lives on.
 * @param file the file you want to access (in a later step)
 * @param cred
 * @return
 * @throws FileSystemException
 * @throws VomsException
 */
private synchronized FileSystem createFilesystem(final String rootUrl,final String fqan) throws FileSystemException {
  ProxyCredential credToUse=null;
  if (fqan != null) {
    credToUse=cachedCredentials.get(fqan);
    if (credToUse == null || !credToUse.isValid()) {
      VO vo=VOManagement.getVO(getFqans().get(fqan));
      credToUse=CertHelpers.getVOProxyCredential(vo,fqan,getCred());
      cachedCredentials.put(fqan,credToUse);
    }
 else {
      credToUse=cachedCredentials.get(fqan);
    }
  }
 else {
    credToUse=getCred();
  }
  FileSystemOptions opts=new FileSystemOptions();
  getFsManager();
  if (rootUrl.startsWith("String_Node_Str")) {
    GridFtpFileSystemConfigBuilder builder=GridFtpFileSystemConfigBuilder.getInstance();
    builder.setGSSCredential(opts,credToUse.getGssCredential());
  }
  FileObject fileRoot=getFsManager().resolveFile(rootUrl,opts);
  FileSystem fileBase=fileRoot.getFileSystem();
  return fileBase;
}

Fixed version (ground truth):
/** 
 * Connects to the filesystem where the file lives on.
 * @param file the file you want to access (in a later step)
 * @param cred
 * @return
 * @throws FileSystemException
 * @throws VomsException
 */
private synchronized FileSystem createFilesystem(final String rootUrl,final String fqan) throws FileSystemException {
  ProxyCredential credToUse=null;
  if (fqan != null) {
    credToUse=cachedCredentials.get(fqan);
    if (credToUse == null || !credToUse.isValid()) {
      VO vo=VOManagement.getVO(getFqans().get(fqan));
      credToUse=CertHelpers.getVOProxyCredential(vo,fqan,getCred());
      cachedCredentials.put(fqan,credToUse);
    }
 else {
      credToUse=cachedCredentials.get(fqan);
    }
  }
 else {
    credToUse=getCred();
  }
  FileSystemOptions opts=new FileSystemOptions();
  if (rootUrl.startsWith("String_Node_Str")) {
    myLogger.debug("String_Node_Str" + rootUrl + "String_Node_Str");
    GridFtpFileSystemConfigBuilder builder=GridFtpFileSystemConfigBuilder.getInstance();
    builder.setGSSCredential(opts,credToUse.getGssCredential());
  }
  FileObject fileRoot=getFsManager().resolveFile(rootUrl,opts);
  FileSystem fileBase=fileRoot.getFileSystem();
  allFileSystems.add(fileBase);
  return fileBase;
}
Program: 46773
Project: 46773
Buggy source:
public Object initialValue(){
  try {
    myLogger.debug("String_Node_Str");
    DefaultFileSystemManager temp=VFSUtil.createNewFsManager(false,false,true,true,true,true,true,null);
    allFileSystems.add(temp);
    return temp;
  }
 catch (  FileSystemException e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public Object initialValue(){
  try {
    myLogger.debug("String_Node_Str");
    DefaultFileSystemManager temp=VFSUtil.createNewFsManager(false,false,true,true,true,true,true,null);
    return temp;
  }
 catch (  FileSystemException e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}
Program: 46774
Project: 46774
Buggy source:
/** 
 * Connects to the filesystem where the file lives on.
 * @param file the file you want to access (in a later step)
 * @param cred
 * @return
 * @throws FileSystemException
 * @throws VomsException
 */
private synchronized FileSystem createFilesystem(final String rootUrl,final String fqan) throws FileSystemException {
  ProxyCredential credToUse=null;
  if (fqan != null) {
    credToUse=cachedCredentials.get(fqan);
    if (credToUse == null || !credToUse.isValid()) {
      VO vo=VOManagement.getVO(getFqans().get(fqan));
      credToUse=CertHelpers.getVOProxyCredential(vo,fqan,getCred());
      cachedCredentials.put(fqan,credToUse);
    }
 else {
      credToUse=cachedCredentials.get(fqan);
    }
  }
 else {
    credToUse=getCred();
  }
  FileSystemOptions opts=new FileSystemOptions();
  if (rootUrl.startsWith("String_Node_Str")) {
    GridFtpFileSystemConfigBuilder builder=GridFtpFileSystemConfigBuilder.getInstance();
    builder.setGSSCredential(opts,credToUse.getGssCredential());
  }
  FileObject fileRoot=getFsManager().resolveFile(rootUrl,opts);
  FileSystem fileBase=fileRoot.getFileSystem();
  return fileBase;
}

Fixed version (ground truth):
/** 
 * Connects to the filesystem where the file lives on.
 * @param file the file you want to access (in a later step)
 * @param cred
 * @return
 * @throws FileSystemException
 * @throws VomsException
 */
private synchronized FileSystem createFilesystem(final String rootUrl,final String fqan) throws FileSystemException {
  ProxyCredential credToUse=null;
  if (fqan != null) {
    credToUse=cachedCredentials.get(fqan);
    if (credToUse == null || !credToUse.isValid()) {
      VO vo=VOManagement.getVO(getFqans().get(fqan));
      credToUse=CertHelpers.getVOProxyCredential(vo,fqan,getCred());
      cachedCredentials.put(fqan,credToUse);
    }
 else {
      credToUse=cachedCredentials.get(fqan);
    }
  }
 else {
    credToUse=getCred();
  }
  FileSystemOptions opts=new FileSystemOptions();
  getFsManager();
  if (rootUrl.startsWith("String_Node_Str")) {
    GridFtpFileSystemConfigBuilder builder=GridFtpFileSystemConfigBuilder.getInstance();
    builder.setGSSCredential(opts,credToUse.getGssCredential());
  }
  FileObject fileRoot=getFsManager().resolveFile(rootUrl,opts);
  FileSystem fileBase=fileRoot.getFileSystem();
  return fileBase;
}
Program: 46776
Project: 46776
Buggy source:
public String logout(){
  myLogger.debug("String_Node_Str");
  this.credential.destroy();
  return null;
}

Fixed version (ground truth):
public String logout(){
  try {
    myLogger.debug("String_Node_Str");
    this.credential.destroy();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 46777
Project: 46777
Buggy source:
protected void setDefaultValue(){
  if (useLastInput) {
    String lastUserInput=holder.getExternalSetValue();
    if (lastUserInput != null && !"String_Node_Str".equals(lastUserInput))     historyManager.addHistoryEntry(historyManagerKeyForThisNode + "String_Node_Str" + TemplateNode.LAST_USED_PARAMETER,lastUserInput,new Date(),1);
  }
  String defaultValue=getDefaultValue();
  if (defaultValue != null) {
    holder.setComponentField(defaultValue);
  }
}

Fixed version (ground truth):
protected void setDefaultValue(){
  if (useLastInput) {
    String lastUserInput=holder.getExternalSetValue();
    if (lastUserInput != null && !"String_Node_Str".equals(lastUserInput))     historyManager.addHistoryEntry(historyManagerKeyForThisNode + "String_Node_Str" + TemplateNode.LAST_USED_PARAMETER,lastUserInput,new Date(),1);
  }
  String defaultValue=getDefaultValue();
  if (defaultValue != null) {
    holder.setComponentField(defaultValue);
  }
 else {
    holder.setComponentField(null);
  }
}
Program: 46778
Project: 46778
Buggy source:
public void startTransfer(boolean join) throws FileTransferException {
  if (transferThread != null) {
    throw new FileTransferException("String_Node_Str");
  }
  transferThread=new Thread(){
    public void run(){
      try {
        myLogger.debug("String_Node_Str" + targetDirectory.getName());
        status=TRANSFERRING_STATUS;
        addStatusMessage("String_Node_Str");
        fireFileTransferEvent(new FileTransferEvent(FileTransfer.this,FileTransferEvent.TRANSFER_STARTED));
        if (isDownload) {
          download(false,sources);
        }
 else {
          transferFiles();
        }
        myLogger.debug("String_Node_Str" + targetDirectory.getName());
        status=FINISHED_STATUS;
        addStatusMessage("String_Node_Str");
        fireFileTransferEvent(new FileTransferEvent(FileTransfer.this,FileTransferEvent.TRANSFER_FINISHED));
      }
 catch (      Exception e) {
        e.printStackTrace();
        myLogger.debug("String_Node_Str");
        if (status == CANCELLED_STATUS) {
        }
 else {
          status=FAILED_STATUS;
          myLogger.debug("String_Node_Str" + targetDirectory.getName());
          addStatusMessage("String_Node_Str" + e.getLocalizedMessage());
          possibleException=e;
          fireFileTransferEvent(new FileTransferEvent(FileTransfer.this,e));
        }
      }
    }
  }
;
  transferThread.start();
  if (join) {
    try {
      transferThread.join();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void startTransfer(boolean join) throws FileTransferException {
  if (transferThread != null) {
    throw new FileTransferException("String_Node_Str");
  }
  transferThread=new Thread(){
    public void run(){
      try {
        myLogger.debug("String_Node_Str" + targetDirectory.getName());
        status=TRANSFERRING_STATUS;
        addStatusMessage("String_Node_Str");
        fireFileTransferEvent(new FileTransferEvent(FileTransfer.this,FileTransferEvent.TRANSFER_STARTED));
        if (isDownload) {
          download(false,sources);
        }
 else {
          transferFiles();
        }
        myLogger.debug("String_Node_Str" + targetDirectory.getName());
        status=FINISHED_STATUS;
        addStatusMessage("String_Node_Str");
        fireFileTransferEvent(new FileTransferEvent(FileTransfer.this,FileTransferEvent.TRANSFER_FINISHED));
      }
 catch (      Exception e) {
        e.printStackTrace();
        myLogger.debug("String_Node_Str");
        if (status == CANCELLED_STATUS) {
        }
 else {
          status=FAILED_STATUS;
          myLogger.debug("String_Node_Str" + targetDirectory.getName());
          addStatusMessage("String_Node_Str" + e.getLocalizedMessage());
          possibleException=e;
          fireFileTransferEvent(new FileTransferEvent(FileTransfer.this,e));
        }
      }
    }
  }
;
  transferThread.start();
  if (join) {
    try {
      transferThread.join();
    }
 catch (    InterruptedException e) {
      throw new FileTransferException("String_Node_Str");
    }
  }
}
Program: 46779
Project: 46779
Buggy source:
protected void setDefaultValue(){
  if (useLastInput) {
    String lastUserInput=holder.getExternalSetValue();
    if (lastUserInput != null && !"String_Node_Str".equals(lastUserInput))     historyManager.addHistoryEntry(historyManagerKeyForThisNode + "String_Node_Str" + TemplateNode.LAST_USED_PARAMETER,lastUserInput,new Date(),1);
  }
  String defaultValue=getDefaultValue();
  if (defaultValue != null) {
    holder.setComponentField(defaultValue);
  }
}

Fixed version (ground truth):
protected void setDefaultValue(){
  if (useLastInput) {
    String lastUserInput=holder.getExternalSetValue();
    if (lastUserInput != null && !"String_Node_Str".equals(lastUserInput))     historyManager.addHistoryEntry(historyManagerKeyForThisNode + "String_Node_Str" + TemplateNode.LAST_USED_PARAMETER,lastUserInput,new Date(),1);
  }
  String defaultValue=getDefaultValue();
  if (defaultValue != null) {
    holder.setComponentField(defaultValue);
  }
 else {
    holder.setComponentField(null);
  }
}