nus-yam/ex-repair huggingface dataset:
Program: 46067
Project: 46067
Buggy source:
/** 
 * Move the client to the given location
 * @param serverURL the url of the server to go to, or null to stayon the current server
 * @param location the location to go to, or null to go to the defaultlocation on the given server
 * @param look the direction to look in, or null to look in the defaultdirection
 * @throws IOException if there is an error going to the new location
 */
public void gotoLocation(String serverURL,Vector3f translation,Quaternion look) throws IOException {
  if (serverURL == null) {
    if (curSession == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    serverURL=curSession.getSessionManager().getServerURL();
  }
  if (curSession != null && serverURL.equals(curSession.getSessionManager().getServerURL())) {
    curSession.getLocalAvatar().localMoveRequest(translation,look);
  }
 else {
    loadServer(serverURL,translation,look);
  }
}

Fixed version (ground truth):
/** 
 * Move the client to the given location
 * @param serverURL the url of the server to go to, or null to stayon the current server
 * @param location the location to go to, or null to go to the defaultlocation on the given server
 * @param look the direction to look in, or null to look in the defaultdirection
 * @throws IOException if there is an error going to the new location
 */
public void gotoLocation(String serverURL,Vector3f translation,Quaternion look) throws IOException {
  if (serverURL == null) {
    if (curSession == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    serverURL=curSession.getSessionManager().getServerURL();
  }
  if (curSession != null && serverURL.equals(curSession.getSessionManager().getServerURL())) {
    ViewCell vc=curSession.getLocalAvatar().getViewCell();
    if (vc instanceof AvatarCell) {
      ((AvatarCell)vc).triggerGoto(translation,look);
    }
  }
 else {
    loadServer(serverURL,translation,look);
  }
}
Program: 46068
Project: 46068
Buggy source:
public void actionPerformed(ActionEvent e){
  String url=placemark.getUrl();
  float x=placemark.getX();
  float y=placemark.getY();
  float z=placemark.getZ();
  float angle=placemark.getAngle();
  Vector3f location=new Vector3f(x,y,z);
  Quaternion look=new Quaternion(0.0f,1.0f,0.0f,angle);
  JFrame frame=JmeClientMain.getFrame().getFrame();
  JOptionPane.showMessageDialog(frame,"String_Node_Str");
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  String url=placemark.getUrl();
  float x=placemark.getX();
  float y=placemark.getY();
  float z=placemark.getZ();
  float angle=placemark.getAngle();
  Vector3f location=new Vector3f(x,y,z);
  Quaternion look=new Quaternion();
  Vector3f axis=new Vector3f(Vector3f.UNIT_Y);
  look.fromAngleAxis((float)Math.toRadians(angle),axis);
  try {
    ClientContextJME.getClientMain().gotoLocation(url,location,look);
  }
 catch (  IOException ex) {
    logger.log(Level.SEVERE,null,ex);
  }
}
Program: 46069
Project: 46069
Buggy source:
/** 
 */
public String importFile(File file,String extension){
  final JFrame frame=JmeClientMain.getFrame().getFrame();
  if (isContentExists(file) == true) {
    int result=JOptionPane.showConfirmDialog(frame,"String_Node_Str" + file.getName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION);
    if (result == JOptionPane.NO_OPTION) {
      return null;
    }
  }
  JOptionPane waitMsg=new JOptionPane("String_Node_Str" + file.getName() + "String_Node_Str");
  final JDialog dialog=waitMsg.createDialog(frame,"String_Node_Str");
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      dialog.setVisible(true);
    }
  }
);
  String uri=null;
  try {
    uri=uploadContent(file);
  }
 catch (  java.io.IOException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + file.getAbsolutePath(),excp);
    final String fileName=file.getName();
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        dialog.setVisible(false);
        JOptionPane.showMessageDialog(frame,"String_Node_Str" + fileName,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
);
    return null;
  }
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      dialog.setVisible(false);
    }
  }
);
  createCell(uri);
  return uri;
}

Fixed version (ground truth):
/** 
 */
public String importFile(File file,String extension){
  final JFrame frame=JmeClientMain.getFrame().getFrame();
  if (isContentExists(file) == true) {
    int result=JOptionPane.showConfirmDialog(frame,"String_Node_Str" + file.getName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION);
    if (result == JOptionPane.NO_OPTION) {
      return null;
    }
  }
  JOptionPane waitMsg=new JOptionPane("String_Node_Str" + file.getName() + "String_Node_Str");
  final JDialog dialog=waitMsg.createDialog(frame,"String_Node_Str");
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      dialog.setVisible(true);
    }
  }
);
  String uri=null;
  try {
    uri=uploadContent(file);
  }
 catch (  java.io.IOException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + file.getAbsolutePath(),excp);
    final String fileName=file.getName();
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        dialog.setVisible(false);
        JOptionPane.showMessageDialog(frame,"String_Node_Str" + fileName,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
);
    return null;
  }
 finally {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        dialog.setVisible(false);
      }
    }
);
  }
  createCell(uri);
  return uri;
}
Program: 46070
Project: 46070
Buggy source:
public void actionPerformed(ActionEvent event){
  String action=gestureMap.get(event.getActionCommand());
  logger.info("String_Node_Str" + event.getActionCommand());
  if (action.equals("String_Node_Str") == true) {
    CharacterEyes eyes=avatar.getEyes();
    eyes.wink(false);
  }
 else   if (action.equals("String_Node_Str") == true) {
    CharacterEyes eyes=avatar.getEyes();
    eyes.wink(true);
  }
 else {
    avatar.playAnimation(action);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent event){
  String action=gestureMap.get(event.getActionCommand());
  logger.info("String_Node_Str" + event.getActionCommand());
  if (action.equals("String_Node_Str") == true) {
    avatar.triggerActionStart(TriggerNames.SitOnGround);
  }
 else   if (action.equals("String_Node_Str") == true) {
    CharacterEyes eyes=avatar.getEyes();
    eyes.wink(false);
  }
 else {
    avatar.playAnimation(action);
  }
}
Program: 46073
Project: 46073
Buggy source:
/** 
 * Specifies whether to also display this app in the HUD. Note: this is in addition to  displaying the app in the world.
 */
public synchronized void setShowInHUD(boolean showInHUD){
  if (this.showInHUD == showInHUD)   return;
  this.showInHUD=showInHUD;
  if (showInHUD) {
    HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
    for (    Window2D window : windows) {
      HUDComponent component=mainHUD.createComponent(window);
      component.setPreferredLocation(Layout.CENTER);
      mainHUD.addComponent(component);
      component.setVisible(true);
    }
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * Specifies whether to also display this app in the HUD. Note: this is in addition to  displaying the app in the world.
 */
public synchronized void setShowInHUD(boolean showInHUD){
  if (this.showInHUD == showInHUD)   return;
  this.showInHUD=showInHUD;
  if (showInHUD) {
    HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
    for (    Window2D window : windows) {
      if (window instanceof WindowSwingHeader)       continue;
      System.err.println("String_Node_Str" + window);
      HUDComponent component=mainHUD.createComponent(window);
      component.setPreferredLocation(Layout.CENTER);
      mainHUD.addComponent(component);
      component.setVisible(true);
    }
  }
 else {
  }
}
Program: 46074
Project: 46074
Buggy source:
public void actionPerformed(ContextMenuItemEvent event){
  Window2D.this.restackToBottom();
}

Fixed version (ground truth):
public void actionPerformed(ContextMenuItemEvent event){
}
Program: 46075
Project: 46075
Buggy source:
public void actionPerformed(ContextMenuItemEvent event){
  app.getControlArb().takeControl();
}

Fixed version (ground truth):
public void actionPerformed(ContextMenuItemEvent event){
  app.setShowInHUD(true);
}
Program: 46076
Project: 46076
Buggy source:
/** 
 * Return the app-specific window menu items for the case where the app doesn't have control.
 */
private ContextMenuItem[] windowMenuItemsForNoControl(ContextMenuComponent contextMenuComp){
  return new ContextMenuItem[]{new SimpleContextMenuItem("String_Node_Str",new ContextMenuActionListener(){
    public void actionPerformed(    ContextMenuItemEvent event){
      app.getControlArb().takeControl();
    }
  }
)};
}

Fixed version (ground truth):
/** 
 * Return the app-specific window menu items for the case where the app doesn't have control.
 */
private ContextMenuItem[] windowMenuItemsForNoControl(ContextMenuComponent contextMenuComp){
  contextMenuComp.setShowStandardMenuItems(true);
  return new ContextMenuItem[]{new SimpleContextMenuItem("String_Node_Str",new ContextMenuActionListener(){
    public void actionPerformed(    ContextMenuItemEvent event){
      app.getControlArb().takeControl();
    }
  }
),new SimpleContextMenuItem("String_Node_Str",new ContextMenuActionListener(){
    public void actionPerformed(    ContextMenuItemEvent event){
      app.setShowInHUD(true);
    }
  }
)};
}
Program: 46077
Project: 46077
Buggy source:
public void run(){
  while (true) {
    String[] names=nameTagList.toArray(new String[0]);
    for (int i=0; i < names.length; i++) {
      String name=names[i];
      NameTagNode nameTag=NameTagNode.getNameTagNode(name);
      if (nameTag == null) {
        continue;
      }
      nameTagList.remove(name);
      PresenceInfo[] info=pm.getUserPresenceInfo(name);
      if (info == null || info.length == 0) {
        System.out.println("String_Node_Str" + name);
        continue;
      }
      PresenceInfo pi=info[0];
      nameTag.updateLabel(pi.usernameAlias,pi.inConeOfSilence,pi.isSpeaking,pi.isMuted);
    }
    if (nameTagList.size() == 0) {
      break;
    }
    try {
      Thread.sleep(200);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    String[] names=nameTagList.toArray(new String[0]);
    for (int i=0; i < names.length; i++) {
      String name=names[i];
      NameTagNode nameTag=NameTagNode.getNameTagNode(name);
      if (nameTag == null) {
        continue;
      }
      nameTagList.remove(name);
      PresenceInfo info=pm.getUserPresenceInfo(name);
      if (info == null) {
        System.out.println("String_Node_Str" + name);
        continue;
      }
      nameTag.updateLabel(info.usernameAlias,info.inConeOfSilence,info.isSpeaking,info.isMuted);
    }
    if (nameTagList.size() == 0) {
      break;
    }
    try {
      Thread.sleep(200);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 46078
Project: 46078
Buggy source:
public void microphoneData(String data){
  if (count == VU_COUNT) {
    count=0;
    volume=Math.round(Math.sqrt(volume) * 100) / 100D;
    meter.setValue(volume);
    volume=0;
  }
 else {
    double volume=Math.abs(Double.parseDouble(data));
    if (volume > this.volume) {
      this.volume=volume;
    }
  }
  count++;
}

Fixed version (ground truth):
public void microphoneData(String data){
  if (count == VU_COUNT) {
    count=0;
    volume=Math.round(Math.sqrt(volume) * 100) / 100D;
    java.awt.EventQueue.invokeLater(new Runnable(){
      public void run(){
        meter.setValue(volume);
      }
    }
);
    volume=0;
  }
 else {
    double volume=Math.abs(Double.parseDouble(data));
    if (volume > this.volume) {
      this.volume=volume;
    }
  }
  count++;
}
Program: 46079
Project: 46079
Buggy source:
public void startVuMeter(boolean startVuMeter){
  SoftphoneControl sc=SoftphoneControlImpl.getInstance();
  client.removeDisconnectListener(this);
  sc.removeSoftphoneListener(this);
  sc.removeMicrophoneInfoListener(this);
  if (startVuMeter) {
    client.addDisconnectListener(this);
    sc.addSoftphoneListener(this);
    sc.addMicrophoneInfoListener(this);
    try {
      sc.sendCommandToSoftphone("String_Node_Str");
    }
 catch (    IOException e) {
      System.out.println("String_Node_Str" + e.getMessage());
    }
  }
  sc.startVuMeter(startVuMeter);
  setVisible(startVuMeter);
}

Fixed version (ground truth):
public void startVuMeter(final boolean startVuMeter){
  SoftphoneControl sc=SoftphoneControlImpl.getInstance();
  client.removeDisconnectListener(this);
  sc.removeSoftphoneListener(this);
  sc.removeMicrophoneInfoListener(this);
  if (startVuMeter) {
    client.addDisconnectListener(this);
    sc.addSoftphoneListener(this);
    sc.addMicrophoneInfoListener(this);
    try {
      sc.sendCommandToSoftphone("String_Node_Str");
    }
 catch (    IOException e) {
      System.out.println("String_Node_Str" + e.getMessage());
    }
  }
  sc.startVuMeter(startVuMeter);
  java.awt.EventQueue.invokeLater(new Runnable(){
    public void run(){
      setVisible(startVuMeter);
    }
  }
);
}
Program: 46081
Project: 46081
Buggy source:
/** 
 * Returns the name of the controlling user.
 */
public String getControllingUser(){
  return ((ControlArbXrw)app.getControlArb()).getController();
}

Fixed version (ground truth):
/** 
 * Returns the name of the controlling user.
 */
public String getControllingUser(){
  ControlArb controlArb=app.getControlArb();
  if (controlArb instanceof ControlArbNull)   return null;
  return ((ControlArbXrw)controlArb).getController();
}
Program: 46084
Project: 46084
Buggy source:
public void clientDisconnected(WonderlandClientSender sender,WonderlandClientID clientID){
  PresenceInfo info=presenceInfoMap.get(clientID.getID());
  logger.warning("String_Node_Str" + clientID.getID() + "String_Node_Str"+ info);
  if (info == null) {
    logger.fine("String_Node_Str" + clientID.getID());
    return;
  }
  AppContext.getDataManager().markForUpdate(this);
  ManagedReference<PlayerInRangeNotifier> notifierRef=notifiers.remove(clientID.getID());
  if (notifierRef == null) {
    System.out.println("String_Node_Str" + clientID.getID());
  }
 else {
    notifierRef.get().done();
  }
  presenceInfoList.remove(info);
  sender.send(new PresenceInfoRemovedMessage(info));
}

Fixed version (ground truth):
public void clientDisconnected(WonderlandClientSender sender,WonderlandClientID clientID){
  PresenceInfo info=presenceInfoMap.get(clientID.getID());
  logger.warning("String_Node_Str" + clientID.getID() + "String_Node_Str"+ info);
  if (info == null) {
    logger.warning("String_Node_Str" + clientID.getID());
    return;
  }
  AppContext.getDataManager().markForUpdate(this);
  ManagedReference<PlayerInRangeNotifier> notifierRef=notifiers.remove(clientID.getID());
  if (notifierRef == null) {
    System.out.println("String_Node_Str" + clientID.getID());
  }
 else {
    notifierRef.get().done();
  }
  presenceInfoList.remove(info);
  sender.send(new PresenceInfoRemovedMessage(info));
}
Program: 46085
Project: 46085
Buggy source:
@Override public void disconnected(){
  super.disconnected();
  LocalAvatar avatar=((CellClientSession)session).getLocalAvatar();
  avatar.removeViewCellConfiguredListener(this);
  SoftphoneControlImpl.getInstance().removeSoftphoneListener(this);
  SoftphoneControlImpl.getInstance().sendCommandToSoftphone("String_Node_Str");
  InputManager.inputManager().removeGlobalEventListener(muteListener);
  notifyDisconnectListeners();
}

Fixed version (ground truth):
@Override public void disconnected(){
  super.disconnected();
  LocalAvatar avatar=((CellClientSession)session).getLocalAvatar();
  avatar.removeViewCellConfiguredListener(this);
  SoftphoneControlImpl.getInstance().removeSoftphoneListener(this);
  SoftphoneControlImpl.getInstance().sendCommandToSoftphone("String_Node_Str");
  notifyDisconnectListeners();
}
Program: 46086
Project: 46086
Buggy source:
@Override public void connect(WonderlandSession session) throws ConnectionFailureException {
  super.connect(session);
  this.session=session;
  pm=PresenceManagerFactory.getPresenceManager(session);
  LocalAvatar avatar=((CellClientSession)session).getLocalAvatar();
  avatar.addViewCellConfiguredListener(this);
  if (avatar.getViewCell() != null) {
    viewConfigured(avatar);
  }
  SoftphoneControlImpl.getInstance().addSoftphoneListener(this);
  InputManager.inputManager().addGlobalEventListener(muteListener);
  AudioMenu.getAudioMenu(this).setEnabled(true);
  userListJMenuItem.setEnabled(true);
}

Fixed version (ground truth):
@Override public void connect(WonderlandSession session) throws ConnectionFailureException {
  super.connect(session);
  this.session=session;
  pm=PresenceManagerFactory.getPresenceManager(session);
  LocalAvatar avatar=((CellClientSession)session).getLocalAvatar();
  avatar.addViewCellConfiguredListener(this);
  if (avatar.getViewCell() != null) {
    viewConfigured(avatar);
  }
  SoftphoneControlImpl.getInstance().addSoftphoneListener(this);
  AudioMenu.getAudioMenu(this).setEnabled(true);
  userListJMenuItem.setEnabled(true);
}
Program: 46087
Project: 46087
Buggy source:
public void softphoneMuted(boolean isMuted){
  if (isMuted == this.isMuted) {
    return;
  }
  this.isMuted=isMuted;
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),sc.isMuted()));
  }
 else {
    logger.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
public void softphoneMuted(boolean isMuted){
  if (this.isMuted == isMuted) {
    return;
  }
  mute(isMuted);
}
Program: 46088
Project: 46088
Buggy source:
public void mute(boolean isMuted){
  if (this.isMuted == isMuted) {
    return;
  }
  this.isMuted=isMuted;
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  sc.mute(isMuted);
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
  }
 else {
    logger.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
public void mute(boolean isMuted){
  this.isMuted=isMuted;
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  sc.mute(isMuted);
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
  }
 else {
    logger.warning("String_Node_Str");
  }
}
Program: 46089
Project: 46089
Buggy source:
/** 
 * The view cells transform has changed so update our internal structures
 * @param cell
 */
public void viewCellMoved(CellID viewCellID,CellTransform worldTransform){
  Vector3f worldTranslation=worldTransform.getTranslation(null);
synchronized (worldProxBounds) {
    BoundingVolume nowIn=null;
    int nowInIndex=-1;
    int i=0;
    while (i < worldProxBounds.length) {
      if (worldProxBounds[i].contains(worldTranslation)) {
        nowIn=worldProxBounds[i];
        nowInIndex=i;
      }
 else {
        i=worldProxBounds.length;
      }
      i++;
    }
    if (currentlyInIndex != nowInIndex) {
      if (nowInIndex < currentlyInIndex) {
        proximityListener.viewEnterExit(false,currentlyIn,currentlyInIndex,viewCellID);
      }
 else {
        proximityListener.viewEnterExit(true,nowIn,nowInIndex,viewCellID);
      }
      currentlyIn=nowIn;
      currentlyInIndex=nowInIndex;
    }
  }
}

Fixed version (ground truth):
/** 
 * The view cells transform has changed so update our internal structures
 * @param cell
 */
public void viewCellMoved(CellID viewCellID,CellTransform viewCellTransform){
  Vector3f viewCellWorldTranslation=viewCellTransform.getTranslation(null);
synchronized (worldProxBounds) {
    BoundingVolume currentContainer=null;
    int currentContainerIndex=-1;
    int i=0;
    while (i < worldProxBounds.length) {
      if (worldProxBounds[i].contains(viewCellWorldTranslation)) {
        currentContainer=worldProxBounds[i];
        currentContainerIndex=i;
      }
 else {
        i=worldProxBounds.length;
      }
      i++;
    }
    int lastContainerIndex=-1;
    if (this.lastContainerIndexMap.containsKey(viewCellID))     lastContainerIndex=this.lastContainerIndexMap.get(viewCellID);
    if (lastContainerIndex != currentContainerIndex) {
      if (currentContainerIndex < lastContainerIndex) {
        proximityListener.viewEnterExit(false,this.lastContainerMap.get(viewCellID),lastContainerIndex,viewCellID);
        if (currentContainerIndex == -1) {
          this.lastContainerMap.remove(viewCellID);
          this.lastContainerIndexMap.remove(viewCellID);
        }
      }
 else {
        proximityListener.viewEnterExit(true,currentContainer,currentContainerIndex,viewCellID);
        lastContainerMap.put(viewCellID,currentContainer);
        lastContainerIndexMap.put(viewCellID,currentContainerIndex);
      }
    }
  }
}
Program: 46090
Project: 46090
Buggy source:
/** 
 * Set a list of bounds for which the system will track view enter/exit for this cell. When the view enters/exits one of these bounds the listener will be called with the index of the bounds in the supplied array. The bounds must be ordered from largest to smallest, thus localBounds[i] must enclose localBounds[i+1]. An IllegalArgumentException will be thrown if this is not the case.
 * @param bounds
 */
void setProximityBounds(BoundingVolume[] localBounds){
  this.localProxBounds=new BoundingVolume[localBounds.length];
  this.worldProxBounds=new BoundingVolume[localBounds.length];
  int i=0;
  for (  BoundingVolume b : localBounds) {
    this.localProxBounds[i]=b.clone(null);
    worldProxBounds[i]=b.clone(null);
    if (i > 0 && !Math3DUtils.encloses(localProxBounds[i - 1],localProxBounds[i]))     throw new IllegalArgumentException("String_Node_Str");
    i++;
  }
}

Fixed version (ground truth):
/** 
 * Set a list of bounds for which the system will track view enter/exit for this cell. When the view enters/exits one of these bounds the listener will be called with the index of the bounds in the supplied array. The bounds must be ordered from largest to smallest, thus localBounds[i] must enclose localBounds[i+1]. An IllegalArgumentException will be thrown if this is not the case.
 * @param bounds
 */
public void setProximityBounds(BoundingVolume[] localBounds){
  this.localProxBounds=new BoundingVolume[localBounds.length];
  this.worldProxBounds=new BoundingVolume[localBounds.length];
  int i=0;
  for (  BoundingVolume b : localBounds) {
    this.localProxBounds[i]=b.clone(null);
    worldProxBounds[i]=b.clone(null);
    if (i > 0 && !Math3DUtils.encloses(localProxBounds[i - 1],localProxBounds[i]))     throw new IllegalArgumentException("String_Node_Str");
    i++;
  }
}
Program: 46091
Project: 46091
Buggy source:
private void inputEvent(Event event){
  if (event instanceof KeyEvent3D == false) {
    return;
  }
  KeyEvent3D e=(KeyEvent3D)event;
  if (e.isPressed() == false || e.getKeyChar() != '[') {
    return;
  }
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  boolean isMuted=sc.isMuted();
  isMuted=!isMuted;
  sc.mute(isMuted);
  session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
}

Fixed version (ground truth):
private void inputEvent(Event event){
  if (event instanceof KeyEvent3D == false) {
    return;
  }
  KeyEvent3D e=(KeyEvent3D)event;
  if (e.isPressed() == false || e.getKeyChar() != '[') {
    return;
  }
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  boolean isMuted=sc.isMuted();
  isMuted=!isMuted;
  this.isMuted=isMuted;
  sc.mute(isMuted);
  session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
}
Program: 46092
Project: 46092
Buggy source:
public void softphoneMuted(boolean isMuted){
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),sc.isMuted()));
  }
 else {
    logger.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
public void softphoneMuted(boolean isMuted){
  if (isMuted == this.isMuted) {
    return;
  }
  this.isMuted=isMuted;
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),sc.isMuted()));
  }
 else {
    logger.warning("String_Node_Str");
  }
}
Program: 46093
Project: 46093
Buggy source:
public void mute(boolean isMuted){
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  sc.mute(isMuted);
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
  }
 else {
    logger.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
public void mute(boolean isMuted){
  if (this.isMuted == isMuted) {
    return;
  }
  this.isMuted=isMuted;
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  sc.mute(isMuted);
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
  }
 else {
    logger.warning("String_Node_Str");
  }
}
Program: 46094
Project: 46094
Buggy source:
private void changePrivacy(ChatType chatType){
  Object[] selectedValues=selectableMemberList.getSelectedValues();
  String members="String_Node_Str";
  for (int i=0; i < selectedValues.length; i++) {
    if (i > 0) {
      members+="String_Node_Str";
    }
    members+=NameTagNode.getUsername((String)selectedValues[i]);
  }
  if (members.length() == 0) {
    session.send(client,new VoiceChatJoinMessage(group,presenceInfo,new PresenceInfo[0],chatType));
    return;
  }
  PresenceInfo[] membersInfo=VoiceChatDialog.getPresenceInfo(pm,members);
  for (int i=0; i < membersInfo.length; i++) {
    PresenceInfo info=membersInfo[i];
    if (info.clientID != null && presenceInfo.equals(info) == false) {
      continue;
    }
    session.send(client,new VoiceChatJoinMessage(group,info,new PresenceInfo[0],chatType));
  }
}

Fixed version (ground truth):
private void changePrivacy(ChatType chatType){
  Object[] selectedValues=selectableMemberList.getSelectedValues();
  ArrayList<PresenceInfo> membersInfo=new ArrayList();
  for (int i=0; i < selectedValues.length; i++) {
    String usernameAlias=NameTagNode.getUsername((String)selectedValues[i]);
    PresenceInfo[] info=pm.getAliasPresenceInfo(usernameAlias);
    if (info == null || info.length == 0) {
      System.out.println("String_Node_Str" + usernameAlias);
      continue;
    }
  }
  if (membersInfo.size() == 0) {
    session.send(client,new VoiceChatJoinMessage(group,presenceInfo,new PresenceInfo[0],chatType));
    return;
  }
  for (  PresenceInfo info : membersInfo) {
    if (info.clientID != null && presenceInfo.equals(info) == false) {
      continue;
    }
    session.send(client,new VoiceChatJoinMessage(group,info,new PresenceInfo[0],chatType));
  }
}
Program: 46095
Project: 46095
Buggy source:
private int setMemberList(){
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  ArrayList<String> memberData=new ArrayList();
  ArrayList<String> selectableMemberData=new ArrayList();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
    if (memberscontains(info) == false) {
      for (      PresenceInfo member : members) {
      }
      continue;
    }
    if (info.clientID == null || info.equals(presenceInfo)) {
      selectableMemberData.add(NameTagNode.getDisplayName(info.usernameAlias,info.isSpeaking,info.isMuted));
    }
 else {
      memberData.add(NameTagNode.getDisplayName(info.usernameAlias,info.isSpeaking,info.isMuted));
    }
  }
  String[] memberArray=memberData.toArray(new String[0]);
  SortUsers.sort(memberArray);
  memberList.setListData(memberArray);
  String[] selectableMemberArray=selectableMemberData.toArray(new String[0]);
  SortUsers.sort(selectableMemberArray);
  selectableMemberList.setListData(selectableMemberArray);
  return selectableMemberData.size();
}

Fixed version (ground truth):
private int setMemberList(){
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  ArrayList<String> memberData=new ArrayList();
  ArrayList<String> selectableMemberData=new ArrayList();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
    if (memberscontains(info) == false) {
      for (      PresenceInfo member : members) {
      }
      continue;
    }
    if (info.clientID == null || info.equals(presenceInfo)) {
      selectableMemberData.add(NameTagNode.getDisplayName(info.usernameAlias,info.isSpeaking,info.isMuted));
    }
 else {
      memberData.add(NameTagNode.getDisplayName(info.usernameAlias,info.isSpeaking,info.isMuted));
    }
  }
  String[] memberArray=memberData.toArray(new String[0]);
  SortUsers.sort(memberArray);
  memberList.setListData(memberArray);
  String[] selectableMemberArray=selectableMemberData.toArray(new String[0]);
  SortUsers.sort(selectableMemberArray);
  boolean needToUpdate=false;
  if (currentArray.length == selectableMemberArray.length) {
    for (int i=0; i < selectableMemberArray.length; i++) {
      if (currentArray[i].equals(selectableMemberArray[i]) == false) {
        needToUpdate=true;
        break;
      }
    }
  }
 else {
    needToUpdate=true;
  }
  if (needToUpdate) {
    currentArray=selectableMemberArray;
    selectableMemberList.setListData(selectableMemberArray);
  }
  return selectableMemberData.size();
}
Program: 46096
Project: 46096
Buggy source:
private void endCall(){
  Object[] selectedValues=selectableMemberList.getSelectedValues();
  String members="String_Node_Str";
  for (int i=0; i < selectedValues.length; i++) {
    if (i > 0) {
      members+="String_Node_Str";
    }
    members+=NameTagNode.getUsername((String)selectedValues[i]);
  }
  if (members.length() == 0) {
    session.send(client,new VoiceChatLeaveMessage(group,presenceInfo));
    return;
  }
  PresenceInfo[] membersInfo=VoiceChatDialog.getPresenceInfo(pm,members);
  for (int i=0; i < membersInfo.length; i++) {
    PresenceInfo info=membersInfo[i];
    if (info.clientID != null && presenceInfo.equals(info) == false) {
      continue;
    }
    session.send(client,new VoiceChatLeaveMessage(group,info));
  }
}

Fixed version (ground truth):
private void endCall(){
  Object[] selectedValues=selectableMemberList.getSelectedValues();
  ArrayList<PresenceInfo> membersInfo=new ArrayList();
  for (int i=0; i < selectedValues.length; i++) {
    String usernameAlias=NameTagNode.getUsername((String)selectedValues[i]);
    PresenceInfo[] info=pm.getAliasPresenceInfo(usernameAlias);
    if (info == null || info.length == 0) {
      System.out.println("String_Node_Str" + (String)selectedValues[i]);
      continue;
    }
    membersInfo.add(info[0]);
  }
  if (membersInfo.size() == 0) {
    session.send(client,new VoiceChatLeaveMessage(group,presenceInfo));
    return;
  }
  for (  PresenceInfo info : membersInfo) {
    if (info.clientID != null && presenceInfo.equals(info) == false) {
      continue;
    }
    session.send(client,new VoiceChatLeaveMessage(group,info));
  }
}
Program: 46097
Project: 46097
Buggy source:
private void volumeSliderStateChanged(javax.swing.event.ChangeEvent evt){
  javax.swing.JSlider source=(javax.swing.JSlider)evt.getSource();
  int volume=source.getValue();
  Object[] selectedValues=userList.getSelectedValues();
  if (selectedValues.length > 0) {
    for (int i=0; i < selectedValues.length; i++) {
      String username=NameTagNode.getUsername((String)selectedValues[i]);
      PresenceInfo[] info=pm.getAliasPresenceInfo(username);
      if (info == null) {
        logger.warning("String_Node_Str" + username);
        continue;
      }
      logger.info("String_Node_Str" + username + "String_Node_Str"+ volume);
      PresenceInfo pi=info[0];
      volumeChanged(pi.cellID,pi.callID,volume);
    }
  }
}

Fixed version (ground truth):
private void volumeSliderStateChanged(javax.swing.event.ChangeEvent evt){
  javax.swing.JSlider source=(javax.swing.JSlider)evt.getSource();
  int volume=source.getValue();
  Object[] selectedValues=userList.getSelectedValues();
  if (selectedValues.length > 0) {
    for (int i=0; i < selectedValues.length; i++) {
      String username=NameTagNode.getUsername((String)selectedValues[i]);
      PresenceInfo[] info=pm.getAliasPresenceInfo(username);
      if (info == null) {
        logger.warning("String_Node_Str" + username);
        continue;
      }
      logger.info("String_Node_Str" + username + "String_Node_Str"+ volume);
      PresenceInfo pi=info[0];
      volumeChanged(pi.cellID,pi.callID,volume);
      volumeChangeMap.put(pi,new Integer(volume));
    }
  }
}
Program: 46098
Project: 46098
Buggy source:
private void userListValueChanged(javax.swing.event.ListSelectionEvent evt){
  Object[] selectedValues=userList.getSelectedValues();
  if (selectedValues.length == 0) {
    editButton.setEnabled(false);
    volumeLabel.setText("String_Node_Str");
    volumeSlider.setEnabled(false);
  }
 else   if (selectedValues.length == 1) {
    controlPanel.setVisible(true);
    volumeSlider.setEnabled(true);
    String username=NameTagNode.getUsername((String)selectedValues[0]);
    PresenceInfo[] info=pm.getAliasPresenceInfo(username);
    if (info == null) {
      logger.warning("String_Node_Str" + username);
      editButton.setEnabled(false);
      return;
    }
    if ((presenceInfo != null) && presenceInfo.equals(info[0])) {
      volumeLabel.setText("String_Node_Str" + username);
      editButton.setEnabled(true);
    }
 else {
      volumeLabel.setText("String_Node_Str" + username);
      editButton.setEnabled(false);
    }
  }
 else {
    volumeLabel.setText("String_Node_Str" + selectedValues.length + "String_Node_Str");
    volumeSlider.setEnabled(true);
  }
}

Fixed version (ground truth):
private void userListValueChanged(javax.swing.event.ListSelectionEvent evt){
  Object[] selectedValues=userList.getSelectedValues();
  if (selectedValues.length == 0) {
    editButton.setEnabled(false);
    volumeLabel.setText("String_Node_Str");
    volumeSlider.setEnabled(false);
  }
 else   if (selectedValues.length == 1) {
    controlPanel.setVisible(true);
    volumeSlider.setEnabled(true);
    String username=NameTagNode.getUsername((String)selectedValues[0]);
    PresenceInfo[] info=pm.getAliasPresenceInfo(username);
    if (info == null) {
      logger.warning("String_Node_Str" + username);
      editButton.setEnabled(false);
      return;
    }
    if ((presenceInfo != null) && presenceInfo.equals(info[0])) {
      volumeLabel.setText("String_Node_Str" + username);
      editButton.setEnabled(true);
    }
 else {
      volumeLabel.setText("String_Node_Str" + username);
      editButton.setEnabled(false);
    }
    if (presenceInfo != null) {
      Integer v=volumeChangeMap.get(presenceInfo);
      if (v != null) {
        volumeSlider.setValue(v.intValue());
      }
    }
  }
 else {
    volumeLabel.setText("String_Node_Str" + selectedValues.length + "String_Node_Str");
    volumeSlider.setEnabled(true);
    volumeSlider.setValue(5);
  }
}
Program: 46100
Project: 46100
Buggy source:
private void setBuddyList(){
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  ArrayList<String> userList=new ArrayList();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
    userList.add(info.usernameAlias);
  }
  String[] userArray=userList.toArray(new String[0]);
  SortUsers.sort(userArray);
  this.userList=userList;
  buddyList.setListData(userArray);
  enableButtons();
}

Fixed version (ground truth):
private void setBuddyList(){
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  ArrayList<String> userList=new ArrayList();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
    userList.add(info.usernameAlias);
  }
  String[] userArray=userList.toArray(new String[0]);
  SortUsers.sort(userArray);
  boolean needToUpdate=false;
  if (currentArray.length == userArray.length) {
    for (int i=0; i < currentArray.length; i++) {
      if (currentArray[i].equals(userArray[i]) == false) {
        needToUpdate=true;
        break;
      }
    }
  }
 else {
    needToUpdate=true;
  }
  if (needToUpdate) {
    currentArray=userArray;
    buddyList.setListData(userArray);
  }
  enableButtons();
}
Program: 46101
Project: 46101
Buggy source:
public void setWindow(Window2D window){
  this.window=window;
}

Fixed version (ground truth):
public void setWindow(Window2D window){
  this.window=window;
  setBounds(getX(),getY(),window.getWidth(),window.getHeight());
}
Program: 46102
Project: 46102
Buggy source:
public void setComponent(JComponent component){
  this.component=component;
}

Fixed version (ground truth):
public void setComponent(JComponent component){
  this.component=component;
  setBounds(0,0,(int)component.getPreferredSize().getWidth(),(int)component.getPreferredSize().getHeight());
}
Program: 46103
Project: 46103
Buggy source:
/** 
 * Gets the frame for the HUD component
 * @return the HUD component's frame
 */
public HUDFrame2D getFrame(){
  return frame;
}

Fixed version (ground truth):
/** 
 * Gets the frame for the HUD component
 * @return the HUD component's frame
 */
public HUDFrameHeader2D getFrame(){
  return frame;
}
Program: 46104
Project: 46104
Buggy source:
/** 
 * Sets the frame decoration for the HUD component
 * @param frame the frame
 */
public void setFrame(HUDFrame2D frame){
  this.frame=frame;
}

Fixed version (ground truth):
/** 
 * Sets the frame decoration for the HUD component
 * @param frame the frame
 */
public void setFrame(HUDFrameHeader2D frame){
  this.frame=frame;
}
Program: 46106
Project: 46106
Buggy source:
/** 
 * Creates new form MainFrame 
 */
public MainFrameImpl(WorldManager wm,int width,int height){
  this.wm=wm;
  try {
    boolean hasNimbus=false;
    try {
      Class.forName("String_Node_Str");
      hasNimbus=true;
    }
 catch (    ClassNotFoundException e) {
    }
    if (hasNimbus) {
      UIManager.setLookAndFeel("String_Node_Str");
    }
 else {
      UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    }
    if ("String_Node_Str".equals(System.getProperty("String_Node_Str"))) {
      javax.swing.UIManager.put("String_Node_Str",Boolean.TRUE);
    }
  }
 catch (  Exception ex) {
    logger.warning("String_Node_Str" + UIManager.getCrossPlatformLookAndFeelClassName() + "String_Node_Str"+ ex);
  }
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  initComponents();
  initMenus();
  setTitle(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  centerPanel.setMinimumSize(new Dimension(width,height));
  centerPanel.setPreferredSize(new Dimension(width,height));
  DragAndDropManager.getDragAndDropManager().setDropTarget(centerPanel);
  serverField.getDocument().addDocumentListener(new DocumentListener(){
    public void insertUpdate(    DocumentEvent e){
      updateGoButton();
    }
    public void removeUpdate(    DocumentEvent e){
      updateGoButton();
    }
    public void changedUpdate(    DocumentEvent e){
      updateGoButton();
    }
  }
);
  pack();
}

Fixed version (ground truth):
/** 
 * Creates new form MainFrame 
 */
public MainFrameImpl(WorldManager wm,int width,int height){
  this.wm=wm;
  GUIUtils.initLookAndFeel();
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  initComponents();
  initMenus();
  setTitle(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  centerPanel.setMinimumSize(new Dimension(width,height));
  centerPanel.setPreferredSize(new Dimension(width,height));
  DragAndDropManager.getDragAndDropManager().setDropTarget(centerPanel);
  serverField.getDocument().addDocumentListener(new DocumentListener(){
    public void insertUpdate(    DocumentEvent e){
      updateGoButton();
    }
    public void removeUpdate(    DocumentEvent e){
      updateGoButton();
    }
    public void changedUpdate(    DocumentEvent e){
      updateGoButton();
    }
  }
);
  pack();
}
Program: 46107
Project: 46107
Buggy source:
/** 
 * Updates the GUI items in this panel for the currently selected cell. If there is nothing selected, do nothing
 */
public void updateGUI(){
  Cell cell=getSelectedCell();
  if (cell == null) {
    translateToggleButton.setSelected(false);
    translateToggleButton.setEnabled(false);
    rotateToggleButton.setSelected(false);
    rotateToggleButton.setEnabled(false);
    resizeToggleButton.setSelected(false);
    resizeToggleButton.setEnabled(false);
    sizeSlider.setValue(50);
    sizeSlider.setEnabled(false);
    return;
  }
  translateToggleButton.setEnabled(true);
  rotateToggleButton.setEnabled(true);
  resizeToggleButton.setEnabled(true);
  sizeSlider.setEnabled(true);
  CellComponent component=cell.getComponent(TranslateAffordanceCellComponent.class);
  translateToggleButton.setSelected(component != null);
  translateToggleButton.repaint();
  if (component != null) {
    float size=((AffordanceCellComponent)component).getSize();
    sizeSlider.setValue((int)((size - 1.0f) * 100.0f));
  }
 else {
    sizeSlider.setValue(50);
  }
  component=cell.getComponent(RotateAffordanceCellComponent.class);
  rotateToggleButton.setSelected(component != null);
  rotateToggleButton.repaint();
  component=cell.getComponent(ResizeAffordanceCellComponent.class);
  resizeToggleButton.setSelected(component != null);
  resizeToggleButton.repaint();
}

Fixed version (ground truth):
/** 
 * Updates the GUI items in this panel for the currently selected cell. If there is nothing selected, do nothing. NOTE: This method assumes it is being called in the AWT Event Thread.
 */
public void updateGUI(){
  Cell cell=getSelectedCell();
  if (cell == null) {
    translateToggleButton.setSelected(false);
    translateToggleButton.setEnabled(false);
    rotateToggleButton.setSelected(false);
    rotateToggleButton.setEnabled(false);
    resizeToggleButton.setSelected(false);
    resizeToggleButton.setEnabled(false);
    sizeSlider.setValue(50);
    sizeSlider.setEnabled(false);
    return;
  }
  translateToggleButton.setEnabled(true);
  rotateToggleButton.setEnabled(true);
  resizeToggleButton.setEnabled(true);
  sizeSlider.setEnabled(true);
  CellComponent component=cell.getComponent(TranslateAffordanceCellComponent.class);
  translateToggleButton.setSelected(component != null);
  translateToggleButton.repaint();
  if (component != null) {
    float size=((AffordanceCellComponent)component).getSize();
    sizeSlider.setValue((int)((size - 1.0f) * 100.0f));
  }
 else {
    sizeSlider.setValue(50);
  }
  component=cell.getComponent(RotateAffordanceCellComponent.class);
  rotateToggleButton.setSelected(component != null);
  rotateToggleButton.repaint();
  component=cell.getComponent(ResizeAffordanceCellComponent.class);
  resizeToggleButton.setSelected(component != null);
  resizeToggleButton.repaint();
}
Program: 46108
Project: 46108
Buggy source:
/** 
 * Creates new form AffordanceHUDPanel 
 */
public AffordanceHUDPanel(JFrame frame){
  initComponents();
  Hashtable<Integer,JComponent> labels=new Hashtable();
  labels.put(0,new JLabel("String_Node_Str"));
  labels.put(100,new JLabel("String_Node_Str"));
  labels.put(200,new JLabel("String_Node_Str"));
  labels.put(300,new JLabel("String_Node_Str"));
  labels.put(400,new JLabel("String_Node_Str"));
  sizeSlider.setLabelTable(labels);
  this.frame=frame;
  InputManager.inputManager().addGlobalEventListener(new SelectionListener());
}

Fixed version (ground truth):
/** 
 * Creates new form AffordanceHUDPanel 
 */
public AffordanceHUDPanel(){
  initComponents();
  Hashtable<Integer,JComponent> labels=new Hashtable();
  labels.put(0,new JLabel("String_Node_Str"));
  labels.put(100,new JLabel("String_Node_Str"));
  labels.put(200,new JLabel("String_Node_Str"));
  labels.put(300,new JLabel("String_Node_Str"));
  labels.put(400,new JLabel("String_Node_Str"));
  sizeSlider.setLabelTable(labels);
  InputManager.inputManager().addGlobalEventListener(new SelectionListener());
}
Program: 46109
Project: 46109
Buggy source:
@Override public void commitEvent(Event event){
  updateGUI();
}

Fixed version (ground truth):
@Override public void commitEvent(Event event){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      updateGUI();
    }
  }
);
}
Program: 46110
Project: 46110
Buggy source:
/** 
 * Creates the affordance HUD frame
 */
private void createHUD(){
  HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
  affordanceHUDPanel=new AffordanceHUDPanel(null);
  affordanceHUD=mainHUD.createComponent(affordanceHUDPanel);
  affordanceHUD.setPreferredLocation(Layout.SOUTH);
  affordanceHUD.addComponentListener(new HUDComponentListener(){
    public void HUDComponentChanged(    HUDComponentEvent event){
      if (event.getEventType() == ComponentEventType.DISAPPEARED) {
        InputManager.inputManager().postEvent(new AffordanceRemoveEvent());
      }
    }
  }
);
  mainHUD.addComponent(affordanceHUD);
}

Fixed version (ground truth):
/** 
 * Creates the affordance HUD frame. NOTE: This method should NOT be called on the AWT Event Thread.
 */
private void createHUD(){
  HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
  affordanceHUDPanel=new AffordanceHUDPanel();
  affordanceHUD=mainHUD.createComponent(affordanceHUDPanel);
  affordanceHUD.setPreferredLocation(Layout.SOUTH);
  affordanceHUD.addComponentListener(new HUDComponentListener(){
    public void HUDComponentChanged(    HUDComponentEvent event){
      if (event.getEventType() == ComponentEventType.DISAPPEARED) {
        InputManager.inputManager().postEvent(new AffordanceRemoveEvent());
      }
    }
  }
);
  mainHUD.addComponent(affordanceHUD);
}
Program: 46111
Project: 46111
Buggy source:
public void actionPerformed(ContextMenuItemEvent event){
  if (affordanceHUD == null) {
    createHUD();
  }
  affordanceHUD.setVisible(true);
  affordanceHUDPanel.setTranslationVisible(true);
  affordanceHUDPanel.updateGUI();
}

Fixed version (ground truth):
public void actionPerformed(ContextMenuItemEvent event){
  if (affordanceHUD == null) {
    createHUD();
  }
  affordanceHUD.setVisible(true);
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      affordanceHUDPanel.setTranslationVisible(true);
      affordanceHUDPanel.updateGUI();
    }
  }
);
}
Program: 46112
Project: 46112
Buggy source:
/** 
 */
public ContextMenuItem[] getContextMenuItems(ContextEvent event){
  final SimpleContextMenuItem editItem=new SimpleContextMenuItem("String_Node_Str",new EditContextListener());
  Cell cell=event.getPrimaryCell();
  final SecurityComponent sc=cell.getComponent(SecurityComponent.class);
  if (sc != null) {
    if (sc.hasPermissions()) {
      editItem.setEnabled(canMove(sc));
    }
 else {
      editItem.setLabel("String_Node_Str");
      editItem.setEnabled(false);
      new Thread(new Runnable(){
        public void run(){
          editItem.setLabel("String_Node_Str");
          editItem.setEnabled(canMove(sc));
          editItem.fireMenuItemRepaintListeners();
        }
      }
,"String_Node_Str").start();
    }
  }
  return new ContextMenuItem[]{editItem};
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public ContextMenuItem[] getContextMenuItems(ContextEvent event){
  final SimpleContextMenuItem editItem=new SimpleContextMenuItem("String_Node_Str",new EditContextListener());
  Cell cell=event.getPrimaryCell();
  final SecurityComponent sc=cell.getComponent(SecurityComponent.class);
  if (sc != null) {
    if (sc.hasPermissions()) {
      editItem.setEnabled(canMove(sc));
    }
 else {
      editItem.setLabel("String_Node_Str");
      editItem.setEnabled(false);
      new Thread(new Runnable(){
        public void run(){
          editItem.setLabel("String_Node_Str");
          editItem.setEnabled(canMove(sc));
          editItem.fireMenuItemRepaintListeners();
        }
      }
,"String_Node_Str").start();
    }
  }
  return new ContextMenuItem[]{editItem};
}