nus-yam/ex-repair huggingface dataset:
Program: 46113
Project: 46113
Buggy source:
public void run(){
  editItem.setLabel("String_Node_Str");
  editItem.setEnabled(canMove(sc));
  editItem.fireMenuItemRepaintListeners();
}

Fixed version (ground truth):
public void run(){
  affordanceHUDPanel.setTranslationVisible(true);
  affordanceHUDPanel.updateGUI();
}
Program: 46114
Project: 46114
Buggy source:
private void okButtonActionPerformed(java.awt.event.ActionEvent evt){
  presenceInfo.usernameAlias=usernameAliasTextField.getText();
  listener.changeUsernameAlias(presenceInfo);
  listeners.firePropertyChange("String_Node_Str",new String("String_Node_Str"),null);
}

Fixed version (ground truth):
private void okButtonActionPerformed(java.awt.event.ActionEvent evt){
  presenceInfo.usernameAlias=usernameAliasTextField.getText();
  pm.changeUsernameAlias(presenceInfo);
  listener.changeUsernameAlias(presenceInfo);
  listeners.firePropertyChange("String_Node_Str",new String("String_Node_Str"),null);
}
Program: 46115
Project: 46115
Buggy source:
public ChangeNameHUDPanel(UsernameAliasChangeListener listener,PresenceInfo presenceInfo){
  this();
  this.listener=listener;
  this.presenceInfo=presenceInfo;
  aliasLabel.setText("String_Node_Str" + presenceInfo.userID.getUsername());
  usernameAliasTextField.setText(presenceInfo.userID.getUsername());
  setVisible(true);
}

Fixed version (ground truth):
public ChangeNameHUDPanel(UsernameAliasChangeListener listener,PresenceManager pm,PresenceInfo presenceInfo){
  this();
  this.listener=listener;
  this.pm=pm;
  this.presenceInfo=presenceInfo;
  aliasLabel.setText("String_Node_Str" + presenceInfo.userID.getUsername());
  usernameAliasTextField.setText(presenceInfo.userID.getUsername());
  setVisible(true);
}
Program: 46116
Project: 46116
Buggy source:
private void editButtonActionPerformed(java.awt.event.ActionEvent evt){
  HUDComponent changeNameHUDComponent=changeNameMap.get(presenceInfo);
  if (changeNameHUDComponent == null) {
    ChangeNameHUDPanel changeNameHUDPanel=new ChangeNameHUDPanel(this,presenceInfo);
    HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
    final HUDComponent comp=mainHUD.createComponent(changeNameHUDPanel);
    comp.setPreferredLocation(Layout.NORTH);
    mainHUD.addComponent(comp);
    changeNameMap.put(presenceInfo,comp);
    PropertyChangeListener plistener=new PropertyChangeListener(){
      public void propertyChange(      PropertyChangeEvent pe){
        if (pe.getPropertyName().equals("String_Node_Str") || pe.getPropertyName().equals("String_Node_Str")) {
          comp.setVisible(false);
        }
      }
    }
;
    changeNameHUDPanel.addPropertyChangeListener(plistener);
    changeNameHUDComponent=comp;
  }
  changeNameHUDComponent.setVisible(true);
}

Fixed version (ground truth):
private void editButtonActionPerformed(java.awt.event.ActionEvent evt){
  HUDComponent changeNameHUDComponent=changeNameMap.get(presenceInfo);
  if (changeNameHUDComponent == null) {
    ChangeNameHUDPanel changeNameHUDPanel=new ChangeNameHUDPanel(this,pm,presenceInfo);
    HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
    final HUDComponent comp=mainHUD.createComponent(changeNameHUDPanel);
    comp.setPreferredLocation(Layout.NORTH);
    mainHUD.addComponent(comp);
    changeNameMap.put(presenceInfo,comp);
    PropertyChangeListener plistener=new PropertyChangeListener(){
      public void propertyChange(      PropertyChangeEvent pe){
        if (pe.getPropertyName().equals("String_Node_Str") || pe.getPropertyName().equals("String_Node_Str")) {
          comp.setVisible(false);
        }
      }
    }
;
    changeNameHUDPanel.addPropertyChangeListener(plistener);
    changeNameHUDComponent=comp;
  }
  changeNameHUDComponent.setVisible(true);
}
Program: 46117
Project: 46117
Buggy source:
/** 
 * Sets the location of the frame holding the label given the current mouse event, using its location
 */
private void setLabelPosition(MouseEvent mouseEvent){
  Component component=mouseEvent.getComponent();
  Point parentPoint=new Point(component.getLocationOnScreen());
  parentPoint.translate(mouseEvent.getX() + 10,mouseEvent.getY() - 15);
  labelFrame.setLocation(parentPoint);
}

Fixed version (ground truth):
/** 
 * Sets the location of the frame holding the label given the current mouse event, using its location. NOTE: This method assumes it is being called within the AWT Event Thread.
 */
private void setLabelPosition(MouseEvent mouseEvent){
  Component component=mouseEvent.getComponent();
  Point parentPoint=new Point(component.getLocationOnScreen());
  parentPoint.translate(mouseEvent.getX() + 10,mouseEvent.getY() - 15);
  labelFrame.setLocation(parentPoint);
}
Program: 46119
Project: 46119
Buggy source:
/** 
 * Sets the location of the frame holding the label given the current mouse event, using its location
 */
private void setLabelPosition(MouseEvent mouseEvent){
  Component component=mouseEvent.getComponent();
  Point parentPoint=new Point(component.getLocationOnScreen());
  parentPoint.translate(mouseEvent.getX() + 10,mouseEvent.getY() - 15);
  labelFrame.setLocation(parentPoint);
}

Fixed version (ground truth):
/** 
 * Sets the location of the frame holding the label given the current mouse event, using its location. NOTE: This method assumes it is being called within the AWT Event Thread.
 */
private void setLabelPosition(MouseEvent mouseEvent){
  Component component=mouseEvent.getComponent();
  Point parentPoint=new Point(component.getLocationOnScreen());
  parentPoint.translate(mouseEvent.getX() + 10,mouseEvent.getY() - 15);
  labelFrame.setLocation(parentPoint);
}
Program: 46121
Project: 46121
Buggy source:
@Override public void commitEvent(Event event){
  MouseEvent3D mouseEvent=(MouseEvent3D)event;
  MouseEvent awtMouseEvent=(MouseEvent)mouseEvent.getAwtEvent();
  if (event instanceof MouseButtonEvent3D) {
    MouseButtonEvent3D buttonEvent=(MouseButtonEvent3D)event;
    if (buttonEvent.isPressed() && buttonEvent.getButton() == ButtonId.BUTTON1) {
      MouseEvent awtButtonEvent=(MouseEvent)buttonEvent.getAwtEvent();
      dragStartScreen=new Point(awtButtonEvent.getX(),awtButtonEvent.getY());
      dragStartWorld=buttonEvent.getIntersectionPointWorld();
      showPositionLabel(awtMouseEvent);
      fireTranslationStarted();
      return;
    }
 else     if (buttonEvent.isReleased() == true) {
      hidePositionLabel();
      return;
    }
    return;
  }
  if (!(event instanceof MouseDraggedEvent3D)) {
    return;
  }
  MouseDraggedEvent3D dragEvent=(MouseDraggedEvent3D)event;
  Vector3f dragVector=dragEvent.getDragVectorWorld(dragStartWorld,dragStartScreen,new Vector3f());
  Vector3f addVector;
  float moved=0.0f;
switch (direction) {
case X_AXIS:
    addVector=new Vector3f(dragVector.x,0,0);
  moved=dragVector.x;
break;
case Y_AXIS:
addVector=new Vector3f(0,dragVector.y,0);
moved=dragVector.y;
break;
case Z_AXIS:
addVector=new Vector3f(0,0,dragVector.z);
moved=dragVector.z;
break;
default :
addVector=new Vector3f();
break;
}
updatePositionLabel(moved,awtMouseEvent);
fireTranslationChanged(addVector);
}

Fixed version (ground truth):
@Override public void commitEvent(Event event){
  MouseEvent3D mouseEvent=(MouseEvent3D)event;
  MouseEvent awtMouseEvent=(MouseEvent)mouseEvent.getAwtEvent();
  if (event instanceof MouseButtonEvent3D) {
    MouseButtonEvent3D buttonEvent=(MouseButtonEvent3D)event;
    if (buttonEvent.isPressed() && buttonEvent.getButton() == ButtonId.BUTTON1) {
      MouseEvent awtButtonEvent=(MouseEvent)buttonEvent.getAwtEvent();
      dragStartScreen=new Point(awtButtonEvent.getX(),awtButtonEvent.getY());
      dragStartWorld=buttonEvent.getIntersectionPointWorld();
      showPositionLabel(awtMouseEvent);
      fireTranslationStarted();
    }
 else     if (buttonEvent.isReleased() == true) {
      hidePositionLabel();
    }
    return;
  }
  if (!(event instanceof MouseDraggedEvent3D)) {
    return;
  }
  MouseDraggedEvent3D dragEvent=(MouseDraggedEvent3D)event;
  Vector3f dragVector=dragEvent.getDragVectorWorld(dragStartWorld,dragStartScreen,new Vector3f());
  Vector3f addVector;
  float moved=0.0f;
switch (direction) {
case X_AXIS:
    addVector=new Vector3f(dragVector.x,0,0);
  moved=dragVector.x;
break;
case Y_AXIS:
addVector=new Vector3f(0,dragVector.y,0);
moved=dragVector.y;
break;
case Z_AXIS:
addVector=new Vector3f(0,0,dragVector.z);
moved=dragVector.z;
break;
default :
addVector=new Vector3f();
break;
}
updatePositionLabel(moved,awtMouseEvent);
fireTranslationChanged(addVector);
}
Program: 46122
Project: 46122
Buggy source:
public synchronized void setUserList(){
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
    String username=info.userID.getUsername();
    String displayName=NameTagNode.getDisplayName(info.usernameAlias,info.isSpeaking,info.isMuted);
    if (!usernameMap.containsKey(username)) {
      userListModel.addElement(displayName);
      usernameMap.put(username,userListModel.indexOf(displayName));
    }
 else {
      userListModel.setElementAt(displayName,usernameMap.get(username));
    }
  }
  Iterator<String> iter=usernameMap.keySet().iterator();
  while (iter.hasNext()) {
    String username=(String)iter.next();
    boolean found=false;
    for (int i=0; i < presenceInfoList.length; i++) {
      PresenceInfo info=presenceInfoList[i];
      if (username.equals(info.userID.getUsername())) {
        found=true;
        break;
      }
    }
    if (!found) {
      userListModel.removeElementAt(usernameMap.get(username));
      usernameMap.remove(username);
    }
  }
}

Fixed version (ground truth):
public synchronized void setUserList(){
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
    String username=info.userID.getUsername();
    String displayName=NameTagNode.getDisplayName(info.usernameAlias,info.isSpeaking,info.isMuted);
    if (!usernameMap.containsKey(username)) {
      userListModel.addElement(displayName);
      usernameMap.put(username,displayName);
    }
 else {
      String oldName=usernameMap.get(username);
      if (!displayName.equals(oldName)) {
        usernameMap.replace(username,displayName);
        int index=userListModel.indexOf(oldName);
        userListModel.setElementAt(displayName,index);
      }
    }
  }
  Iterator<String> iter=usernameMap.keySet().iterator();
  while (iter.hasNext()) {
    String username=(String)iter.next();
    boolean found=false;
    for (int i=0; i < presenceInfoList.length; i++) {
      PresenceInfo info=presenceInfoList[i];
      if (username.equals(info.userID.getUsername())) {
        found=true;
        break;
      }
    }
    if (!found) {
      userListModel.removeElement(usernameMap.get(username));
      usernameMap.remove(username);
    }
  }
}
Program: 46124
Project: 46124
Buggy source:
/** 
 * Constructor 
 */
public ContextMenuManager(){
  factoryList=new LinkedList();
  LoginManager.addPrimaryServerListener(new PrimaryServerListener(){
    public void primaryServer(    ServerSessionManager server){
synchronized (factoryList) {
        factoryList.clear();
        if (server != null) {
          ScannedClassLoader cl=server.getClassloader();
          Iterator<ContextMenuFactorySPI> it=cl.getAll(ContextMenuFactory.class,ContextMenuFactorySPI.class);
          while (it.hasNext() == true) {
            factoryList.add(it.next());
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructor 
 */
public ContextMenuManager(){
  factoryList=new LinkedList();
  listeners=new HashSet();
  LoginManager.addPrimaryServerListener(new PrimaryServerListener(){
    public void primaryServer(    ServerSessionManager server){
synchronized (factoryList) {
        factoryList.clear();
        if (server != null) {
          ScannedClassLoader cl=server.getClassloader();
          Iterator<ContextMenuFactorySPI> it=cl.getAll(ContextMenuFactory.class,ContextMenuFactorySPI.class);
          while (it.hasNext() == true) {
            factoryList.add(it.next());
          }
        }
      }
synchronized (listeners) {
        listeners.clear();
      }
    }
  }
);
}
Program: 46125
Project: 46125
Buggy source:
public void primaryServer(ServerSessionManager server){
synchronized (factoryList) {
    factoryList.clear();
    if (server != null) {
      ScannedClassLoader cl=server.getClassloader();
      Iterator<ContextMenuFactorySPI> it=cl.getAll(ContextMenuFactory.class,ContextMenuFactorySPI.class);
      while (it.hasNext() == true) {
        factoryList.add(it.next());
      }
    }
  }
}

Fixed version (ground truth):
public void primaryServer(ServerSessionManager server){
synchronized (factoryList) {
    factoryList.clear();
    if (server != null) {
      ScannedClassLoader cl=server.getClassloader();
      Iterator<ContextMenuFactorySPI> it=cl.getAll(ContextMenuFactory.class,ContextMenuFactorySPI.class);
      while (it.hasNext() == true) {
        factoryList.add(it.next());
      }
    }
  }
synchronized (listeners) {
    listeners.clear();
  }
}
Program: 46126
Project: 46126
Buggy source:
/** 
 * Remove the gives context menu factory from the cell component. This change will not effect a menu that is currently being displayed, but will be applied next time the menu is displayed
 * @param factory The context menu factory to remove
 */
public void removeContextMenuFactory(ContextMenuFactorySPI factory){
synchronized (factories) {
    factories.remove(factory);
  }
}

Fixed version (ground truth):
/** 
 * Remove the given context menu factory from the cell component. This change will not effect a menu that is currently being displayed, but will be applied next time the menu is displayed
 * @param factory The context menu factory to remove
 */
public void removeContextMenuFactory(ContextMenuFactorySPI factory){
synchronized (factories) {
    factories.remove(factory);
  }
}
Program: 46127
Project: 46127
Buggy source:
/** 
 * This is called when the status of the cell changes.
 */
@Override protected void setStatus(CellStatus status,boolean increasing){
  super.setStatus(status,increasing);
switch (status) {
case ACTIVE:
    if (increasing) {
      if (menuFactory == null) {
        menuFactory=new ContextMenuFactorySPI(){
          public ContextMenuItem[] getContextMenuItems(          ContextEvent event){
            return windowMenuItemsForEvent(event,contextMenuComp);
          }
        }
;
        contextMenuComp.addContextMenuFactory(menuFactory);
      }
    }
  break;
case DISK:
if (!increasing) {
  if (menuFactory != null) {
    contextMenuComp.removeContextMenuFactory(menuFactory);
    menuFactory=null;
  }
}
break;
}
}

Fixed version (ground truth):
/** 
 * This is called when the status of the cell changes.
 */
@Override protected void setStatus(CellStatus status,boolean increasing){
  super.setStatus(status,increasing);
switch (status) {
case ACTIVE:
    if (increasing) {
      if (menuFactory == null) {
        menuFactory=new ContextMenuFactorySPI(){
          public ContextMenuItem[] getContextMenuItems(          ContextEvent event){
            return windowMenuItemsForEvent(event,contextMenuComp);
          }
        }
;
        contextMenuComp.addContextMenuFactory(menuFactory);
      }
      if (menuListener == null) {
        menuListener=new ContextMenuListener(){
          public void contextMenuDisplayed(          ContextEvent event){
            System.out.println("String_Node_Str");
            windowMenuDisplayed(event,contextMenuComp);
          }
        }
;
        ContextMenuManager cmm=ContextMenuManager.getContextMenuManager();
        cmm.addContextMenuListener(menuListener);
      }
    }
  break;
case DISK:
if (!increasing) {
  if (menuFactory != null) {
    contextMenuComp.removeContextMenuFactory(menuFactory);
    menuFactory=null;
  }
  if (menuListener != null) {
    ContextMenuManager cmm=ContextMenuManager.getContextMenuManager();
    cmm.removeContextMenuListener(menuListener);
    menuListener=null;
  }
}
break;
}
}
Program: 46128
Project: 46128
Buggy source:
/** 
 * 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();
    }
  }
)};
}

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){
  return new ContextMenuItem[]{new SimpleContextMenuItem("String_Node_Str",new ContextMenuActionListener(){
    public void actionPerformed(    ContextMenuItemEvent event){
      app.getControlArb().takeControl();
    }
  }
)};
}
Program: 46130
Project: 46130
Buggy source:
public static void makeOrbsVisible(boolean isVisible){
  OrbCell[] attachedOrbs=attachedOrbMap.values().toArray(new OrbCell[0]);
  for (int i=0; i < attachedOrbs.length; i++) {
    attachedOrbs[i].setVisible(isVisible);
  }
  for (  OrbCell orbCell : detachedOrbList) {
    orbCell.setVisible(isVisible);
  }
}

Fixed version (ground truth):
public static void makeOrbsVisible(boolean isVisible){
  Collection<ArrayList<OrbCell>> attachedOrbs=attachedOrbMap.values();
  Iterator<ArrayList<OrbCell>> it=attachedOrbs.iterator();
  while (it.hasNext()) {
    ArrayList<OrbCell> orbs=it.next();
    for (    OrbCell orb : orbs) {
      orb.setVisible(isVisible);
    }
  }
  for (  OrbCell orbCell : detachedOrbList) {
    orbCell.setVisible(isVisible);
  }
}
Program: 46132
Project: 46132
Buggy source:
/** 
 * Set the cell status, ensuring that the cell passes through any intermediate status.
 * @param cell
 * @param status
 */
private void setCellStatus(Cell cell,CellStatus status){
  logger.warning("String_Node_Str" + cell.getCellID() + "String_Node_Str"+ status);
  int currentStatus=cell.getStatus().ordinal();
  int requiredStatus=status.ordinal();
  if (currentStatus == requiredStatus)   return;
  int dir=(requiredStatus > currentStatus ? 1 : -1);
  boolean increasing=(dir == 1);
  while (currentStatus != requiredStatus) {
    currentStatus+=dir;
    cell.setStatus(CellStatus.values()[currentStatus],increasing);
  }
}

Fixed version (ground truth):
/** 
 * Set the cell status, ensuring that the cell passes through any intermediate status.
 * @param cell
 * @param status
 */
private void setCellStatus(Cell cell,CellStatus status){
  logger.fine("String_Node_Str" + cell.getCellID() + "String_Node_Str"+ status);
synchronized (cell) {
    int currentStatus=cell.getStatus().ordinal();
    int requiredStatus=status.ordinal();
    if (currentStatus == requiredStatus)     return;
    int dir=(requiredStatus > currentStatus ? 1 : -1);
    boolean increasing=(dir == 1);
    while (currentStatus != requiredStatus) {
      currentStatus+=dir;
      cell.setStatus(CellStatus.values()[currentStatus],increasing);
    }
  }
}
Program: 46133
Project: 46133
Buggy source:
@Override public void setClientState(CellClientState configData){
  super.setClientState(configData);
  SimpleShapeCellClientState c=(SimpleShapeCellClientState)configData;
  this.shape=c.getShape();
  this.mass=c.getMass();
  this.materialJME=c.getMaterialJME();
  if (shapeRenderer != null) {
    shapeRenderer.shapeChanged();
    shapeRenderer.colorChanged();
  }
}

Fixed version (ground truth):
@Override public void setClientState(CellClientState configData){
  super.setClientState(configData);
  SimpleShapeCellClientState c=(SimpleShapeCellClientState)configData;
  boolean shapeChanged=true;
  if (shape != null && shape.equals(c.getShape()) == true) {
    shapeChanged=false;
  }
  this.shape=c.getShape();
  this.mass=c.getMass();
  this.materialJME=c.getMaterialJME();
  if (shapeRenderer != null && shapeChanged) {
    System.out.println("String_Node_Str");
    shapeRenderer.shapeChanged();
    shapeRenderer.colorChanged();
  }
}
Program: 46134
Project: 46134
Buggy source:
private double getServerVolume(double clientVolume){
  double serverVolume;
  if (clientVolume > 5) {
    serverVolume=(double)(1 + ((clientVolume - 5) * .6));
  }
 else {
    serverVolume=(double)(clientVolume / 5.);
  }
  return serverVolume;
}

Fixed version (ground truth):
private int getServerVolume(double clientVolume){
  double serverVolume;
  if (clientVolume > 5) {
    serverVolume=(double)(1 + ((clientVolume - 5) * .6));
  }
 else {
    serverVolume=(double)(clientVolume / 5.);
  }
  return serverVolume;
}
Program: 46135
Project: 46135
Buggy source:
/** 
 * Returns the children of the WFS path. The relativePath argument must never begin with a "/".
 */
public static CellList getWFSChildren(String root,String canonicalName){
  try {
    URL url=new URL(getWebServerURL(),WFS_PREFIX + root + "String_Node_Str"+ canonicalName);
    return CellList.decode(canonicalName,url.openStream());
  }
 catch (  java.lang.Exception excp) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the children of the WFS path. The relativePath argument must never begin with a "/".
 */
public static CellList getWFSChildren(String root,String canonicalName){
  try {
    URL url=getURL(WFS_PREFIX + root + "String_Node_Str"+ canonicalName);
    return CellList.decode(canonicalName,url.openStream());
  }
 catch (  java.lang.Exception excp) {
    return null;
  }
}
Program: 46136
Project: 46136
Buggy source:
/** 
 * Returns the cell's setup information, null upon error. The relativePath argument must never begin with a "/". For a cell in the root path, use an empty string for the relative path argument
 */
public static CellServerState getWFSCell(String root,String relativePath,String name){
  try {
    URL url=null;
    if (relativePath.compareTo("String_Node_Str") == 0) {
      url=new URL(getWebServerURL(),WFS_PREFIX + root + "String_Node_Str"+ name);
    }
 else {
      url=new URL(getWebServerURL(),WFS_PREFIX + root + "String_Node_Str"+ relativePath+ "String_Node_Str"+ name);
    }
    InputStreamReader isr=new InputStreamReader(url.openStream());
    return CellServerState.decode(isr,null);
  }
 catch (  java.lang.Exception excp) {
    System.out.println(excp.toString());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the cell's setup information, null upon error. The relativePath argument must never begin with a "/". For a cell in the root path, use an empty string for the relative path argument
 */
public static CellServerState getWFSCell(String root,String relativePath,String name){
  try {
    URL url=null;
    if (relativePath.compareTo("String_Node_Str") == 0) {
      url=getURL(WFS_PREFIX + root + "String_Node_Str"+ name);
    }
 else {
      url=getURL(WFS_PREFIX + root + "String_Node_Str"+ relativePath+ "String_Node_Str"+ name);
    }
    InputStreamReader isr=new InputStreamReader(url.openStream());
    return CellServerState.decode(isr,null);
  }
 catch (  java.lang.Exception excp) {
    System.out.println(excp.toString());
    return null;
  }
}
Program: 46137
Project: 46137
Buggy source:
/** 
 * Returns all of the WFS root names or null upon error
 */
public static WorldRootList getWFSRoots(){
  try {
    URL url=new URL(getWebServerURL(),WFS_PREFIX + "String_Node_Str");
    CellImporter.getLogger().info("String_Node_Str" + url.toExternalForm());
    return WorldRootList.decode(url.openStream());
  }
 catch (  java.lang.Exception excp) {
    CellImporter.getLogger().info("String_Node_Str" + excp.toString());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns all of the WFS root names or null upon error
 */
public static WorldRootList getWFSRoots(){
  try {
    URL url=getURL(WFS_PREFIX + "String_Node_Str");
    CellImporter.getLogger().info("String_Node_Str" + url.toExternalForm());
    return WorldRootList.decode(url.openStream());
  }
 catch (  java.lang.Exception excp) {
    CellImporter.getLogger().info("String_Node_Str" + excp.toString());
    return null;
  }
}
Program: 46138
Project: 46138
Buggy source:
/** 
 * Returns the list of cells in the WFS as a hashmap. The list of cells is ordered so that parent cells appear before child cells. Takes the WFS URI of the WFS root.
 */
public static CellList getWFSCells(String root,boolean reload){
  try {
    URL url=new URL(getWebServerURL(),WFS_PREFIX + root + "String_Node_Str"+ Boolean.toString(reload));
    return CellList.decode("String_Node_Str",url.openStream());
  }
 catch (  java.lang.Exception excp) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the list of cells in the WFS as a hashmap. The list of cells is ordered so that parent cells appear before child cells. Takes the WFS URI of the WFS root.
 */
public static CellList getWFSCells(String root,boolean reload){
  try {
    URL url=getURL(WFS_PREFIX + root + "String_Node_Str"+ Boolean.toString(reload));
    return CellList.decode("String_Node_Str",url.openStream());
  }
 catch (  java.lang.Exception excp) {
    return null;
  }
}
Program: 46139
Project: 46139
Buggy source:
/** 
 * Returns the children of the root WFS path, given the name of the WFS root.
 */
public static CellList getWFSRootChildren(String root){
  try {
    URL url=new URL(getWebServerURL(),WFS_PREFIX + root + "String_Node_Str");
    return CellList.decode("String_Node_Str",url.openStream());
  }
 catch (  java.lang.Exception excp) {
    System.err.println(excp);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the children of the root WFS path, given the name of the WFS root.
 */
public static CellList getWFSRootChildren(String root){
  try {
    URL url=getURL(WFS_PREFIX + root + "String_Node_Str");
    return CellList.decode("String_Node_Str",url.openStream());
  }
 catch (  java.lang.Exception excp) {
    System.err.println(excp);
    return null;
  }
}
Program: 46140
Project: 46140
Buggy source:
@Override public void mouseExited(MouseEvent e){
  JMenuItem item=(JMenuItem)e.getSource();
  if (item.isEnabled() == true) {
    item.setBackground(Color.white);
    contextMenu.pack();
  }
}

Fixed version (ground truth):
@Override public void mouseExited(MouseEvent e){
  System.out.println("String_Node_Str");
  JMenuItem item=(JMenuItem)e.getSource();
  if (item.isEnabled() == true) {
    item.setBackground(Color.white);
    contextMenu.pack();
  }
}
Program: 46141
Project: 46141
Buggy source:
@Override public void mouseEntered(MouseEvent e){
  JMenuItem item=(JMenuItem)e.getSource();
  if (item.isEnabled() == true) {
    item.setBackground(WL_LIGHT_GREEN);
    contextMenu.pack();
  }
}

Fixed version (ground truth):
@Override public void mouseEntered(MouseEvent e){
  JMenuItem item=(JMenuItem)e.getSource();
  if (item.isEnabled() == true) {
    System.out.println("String_Node_Str");
    item.setBackground(WL_LIGHT_GREEN);
    item.setOpaque(true);
    item.repaint();
    contextMenu.pack();
  }
}
Program: 46142
Project: 46142
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  JMenuItem item=(JMenuItem)e.getSource();
  if (item.isEnabled() == false) {
    return;
  }
  item.setBackground(WL_GREEN);
  hideContextMenu();
  ContextMenuItem menuItem=menuItemMap.get(item);
  if (menuItem != null && menuItem instanceof SimpleContextMenuItem) {
    SimpleContextMenuItem scmi=(SimpleContextMenuItem)menuItem;
    ContextMenuActionListener listener=scmi.getActionListener();
    if (listener != null) {
      listener.actionPerformed(new ContextMenuItemEvent(menuItem,popupCell));
    }
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  JMenuItem item=(JMenuItem)e.getSource();
  if (item.isEnabled() == false) {
    return;
  }
  item.setBackground(WL_GREEN);
  item.repaint();
  hideContextMenu();
  ContextMenuItem menuItem=menuItemMap.get(item);
  if (menuItem != null && menuItem instanceof SimpleContextMenuItem) {
    SimpleContextMenuItem scmi=(SimpleContextMenuItem)menuItem;
    ContextMenuActionListener listener=scmi.getActionListener();
    if (listener != null) {
      listener.actionPerformed(new ContextMenuItemEvent(menuItem,popupCell));
    }
  }
}
Program: 46143
Project: 46143
Buggy source:
/** 
 * Constructor 
 */
public SwingContextMenu(){
  contextMenu=new JFrame();
  contextMenu.setResizable(false);
  contextMenu.setUndecorated(true);
  contextMenu.getContentPane().setLayout(new GridLayout(1,1));
  contextPanel=new JPanel();
  contextPanel.setBackground(WL_LIGHT_BLUE);
  contextPanel.setOpaque(true);
  contextMenu.getContentPane().add(contextPanel);
  contextPanel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
  contextPanel.setLayout(new BoxLayout(contextPanel,BoxLayout.Y_AXIS));
}

Fixed version (ground truth):
/** 
 * Constructor 
 */
public SwingContextMenu(){
  contextMenu=new JFrame();
  contextMenu.setResizable(false);
  contextMenu.setUndecorated(true);
  contextMenu.getContentPane().setLayout(new GridLayout(1,1));
  contextPanel=new JPanel();
  contextMenu.getContentPane().add(contextPanel);
  contextPanel.setBorder(BorderFactory.createLineBorder(WL_LIGHT_BLUE,2));
  contextPanel.setLayout(new BoxLayout(contextPanel,BoxLayout.Y_AXIS));
}
Program: 46144
Project: 46144
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();
  PresenceManagerFactory.reset();
  LocalAvatar avatar=((CellClientSession)session).getLocalAvatar();
  avatar.removeViewCellConfiguredListener(this);
  SoftphoneControlImpl.getInstance().removeSoftphoneListener(this);
  SoftphoneControlImpl.getInstance().sendCommandToSoftphone("String_Node_Str");
  InputManager.inputManager().removeGlobalEventListener(muteListener);
  notifyDisconnectListeners();
}
Program: 46145
Project: 46145
Buggy source:
private void detachOrb(boolean setTransform){
  if (hostCell == null) {
    return;
  }
  hostCell.removeTransformChangeListener(this);
  if (setTransform) {
    transformChanged(hostCell,false);
  }
  ArrayList<OrbCell> attachedOrbList=attachedOrbMap.get(hostCell);
synchronized (attachedOrbList) {
    attachedOrbList.remove(orbCell);
  }
synchronized (detachedOrbList) {
    detachedOrbList.add(orbCell);
  }
  if (orbDialog != null) {
    orbDialog.orbDetached();
  }
  hostCell=null;
}

Fixed version (ground truth):
private void detachOrb(boolean positionAttachedOrbs){
  hostCell.removeTransformChangeListener(this);
  ArrayList<OrbCell> attachedOrbList=attachedOrbMap.get(hostCell);
synchronized (attachedOrbList) {
    attachedOrbList.remove(orbCell);
  }
synchronized (detachedOrbList) {
    detachedOrbList.add(orbCell);
  }
  if (positionAttachedOrbs) {
    positionAttachedOrbs(hostCell);
  }
  if (orbDialog != null) {
    orbDialog.orbDetached();
  }
  hostCell=null;
}
Program: 46148
Project: 46148
Buggy source:
private void attachOrb(CellID hostCellID,boolean isAttached){
  Cell newHostCell=ClientContext.getCellCache(session).getCell(hostCellID);
  if (newHostCell == null) {
    logger.warning("String_Node_Str" + hostCellID);
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    String s="String_Node_Str";
    if (hostCell != null) {
      s=hostCell.getCellID().toString();
    }
    logger.fine("String_Node_Str" + isAttached + "String_Node_Str"+ avatarCell.getCellID()+ "String_Node_Str"+ newHostCell.getCellID()+ "String_Node_Str"+ s);
  }
  if (isAttached) {
    if (hostCell != null) {
      detachOrb(false);
    }
synchronized (detachedOrbList) {
      detachedOrbList.remove(orbCell);
    }
    ArrayList<OrbCell> attachedOrbList=attachedOrbMap.get(newHostCell);
    if (attachedOrbList == null) {
      attachedOrbList=new ArrayList();
      attachedOrbMap.put(newHostCell,attachedOrbList);
    }
synchronized (attachedOrbList) {
      attachedOrbList.remove(orbCell);
      attachedOrbList.add(orbCell);
    }
    hostCell=newHostCell;
    newHostCell.addTransformChangeListener(this);
    transformChanged(newHostCell,true);
  }
 else {
    detachOrb(true);
  }
  return;
}

Fixed version (ground truth):
private void attachOrb(CellID hostCellID,boolean attach){
  Cell newHostCell=ClientContext.getCellCache(session).getCell(hostCellID);
  if (newHostCell == null) {
    logger.warning("String_Node_Str" + hostCellID);
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    String s="String_Node_Str";
    if (hostCell != null) {
      s=hostCell.getCellID().toString();
    }
    logger.fine("String_Node_Str" + attach + "String_Node_Str"+ avatarCell.getCellID()+ "String_Node_Str"+ newHostCell.getCellID()+ "String_Node_Str"+ s);
  }
  if (attach) {
    if (hostCell != null) {
      logger.fine("String_Node_Str" + orbCell.getCellID() + "String_Node_Str"+ hostCell.getCellID());
      detachOrb(false);
    }
synchronized (detachedOrbList) {
      detachedOrbList.remove(orbCell);
    }
    ArrayList<OrbCell> attachedOrbList=attachedOrbMap.get(newHostCell);
    if (attachedOrbList == null) {
      attachedOrbList=new ArrayList();
      attachedOrbMap.put(newHostCell,attachedOrbList);
    }
synchronized (attachedOrbList) {
      attachedOrbList.remove(orbCell);
      attachedOrbList.add(orbCell);
    }
    hostCell=newHostCell;
    newHostCell.addTransformChangeListener(this);
    positionAttachedOrbs(newHostCell);
  }
 else {
    detachOrb(true);
  }
  return;
}
Program: 46149
Project: 46149
Buggy source:
public void done(){
  if (done) {
    return;
  }
  done=true;
synchronized (detachedOrbList) {
    detachedOrbList.remove(orbCell);
    reorderDetachedOrbs();
    if (hostCell != null) {
      ArrayList<OrbCell> attachedOrbList=attachedOrbMap.get(hostCell);
      if (attachedOrbList != null) {
        attachedOrbList.remove(orbCell);
      }
    }
    reorderAttachedOrbs();
  }
  followMe.done();
  channelComp.removeMessageReceiver(OrbAttachMessage.class);
  channelComp.removeMessageReceiver(OrbAttachVirtualPlayerMessage.class);
  channelComp.removeMessageReceiver(OrbSetBystanderCountMessage.class);
  channelComp.removeMessageReceiver(OrbChangeNameMessage.class);
  channelComp.removeMessageReceiver(OrbEndCallMessage.class);
  channelComp.removeMessageReceiver(OrbMuteCallMessage.class);
  channelComp.removeMessageReceiver(OrbSetVolumeMessage.class);
  channelComp.removeMessageReceiver(OrbSpeakingMessage.class);
  orbRootNode.detachChild(nameTag);
  nameTag.done();
  String playerWithVpCallID=orbCell.getPlayerWithVpCallID();
  if (playerWithVpCallID == null || playerWithVpCallID.equals(orbCell.getCallID())) {
    pm.removePresenceInfo(presenceInfo);
  }
}

Fixed version (ground truth):
public void done(){
  if (done) {
    return;
  }
  done=true;
synchronized (detachedOrbList) {
    detachedOrbList.remove(orbCell);
    reorderDetachedOrbs();
    if (hostCell != null) {
      ArrayList<OrbCell> attachedOrbList=attachedOrbMap.get(hostCell);
      if (attachedOrbList != null) {
        attachedOrbList.remove(orbCell);
      }
      if (attachedOrbList.size() > 0) {
        positionAttachedOrbs(hostCell);
      }
 else {
        attachedOrbMap.remove(hostCell);
      }
    }
  }
  followMe.done();
  channelComp.removeMessageReceiver(OrbAttachMessage.class);
  channelComp.removeMessageReceiver(OrbAttachVirtualPlayerMessage.class);
  channelComp.removeMessageReceiver(OrbSetBystanderCountMessage.class);
  channelComp.removeMessageReceiver(OrbChangeNameMessage.class);
  channelComp.removeMessageReceiver(OrbEndCallMessage.class);
  channelComp.removeMessageReceiver(OrbMuteCallMessage.class);
  channelComp.removeMessageReceiver(OrbSetVolumeMessage.class);
  channelComp.removeMessageReceiver(OrbSpeakingMessage.class);
  orbRootNode.detachChild(nameTag);
  nameTag.done();
  String playerWithVpCallID=orbCell.getPlayerWithVpCallID();
  if (presenceInfoAdded) {
    pm.removePresenceInfo(presenceInfo);
  }
}
Program: 46150
Project: 46150
Buggy source:
private void transformChanged(Cell cell,boolean isAttached){
  logger.finest("String_Node_Str" + cell.getName() + "String_Node_Str"+ cell.getLocalTransform());
  CellTransform transform=cell.getLocalTransform();
  Vector3f translation=transform.getTranslation(null);
  if (isAttached) {
    float orbHeight=getOrbHeight();
    translation.setY(orbHeight);
    followMe.setTargetPosition(translation);
  }
 else {
    translation.setZ(translation.getZ() + (float).2);
    translation.setY((float).5);
    followMe.setTargetPosition(translation,transform.getRotation(null));
  }
}

Fixed version (ground truth):
public void transformChanged(Cell cell,ChangeSource source){
  logger.finest("String_Node_Str" + cell.getName() + "String_Node_Str"+ cell.getLocalTransform());
  positionAttachedOrbs(cell);
}
Program: 46151
Project: 46151
Buggy source:
private void reorderDetachedOrbs(){
synchronized (detachedOrbList) {
    for (int i=0; i < detachedOrbList.size(); i++) {
      transformChanged(detachedOrbList.get(i),true);
    }
  }
}

Fixed version (ground truth):
private void reorderDetachedOrbs(){
synchronized (detachedOrbList) {
  }
}
Program: 46152
Project: 46152
Buggy source:
public void endCall(){
  orbMessageHandlerRef.get().done();
}

Fixed version (ground truth):
public void endCall(){
  if (orbMessageHandlerRef != null) {
    orbMessageHandlerRef.get().done();
  }
}
Program: 46154
Project: 46154
Buggy source:
private Vector3f calcOffsetTranslation(){
  Vector3f translation=new Vector3f();
  if (parent == null)   return translation;
  if (ortho) {
    if (type == Type.PRIMARY || type == Type.UNKNOWN) {
      translation.x=locationOrtho.x;
      translation.y=locationOrtho.y;
    }
 else {
      translation.x=offset.x;
      translation.y=offset.y;
      Dimension parentSize=parent.getSizeApp();
      translation.x+=-parentSize.width / 2f;
      translation.y+=parentSize.height / 2f;
      translation.x+=sizeApp.width / 2f;
      translation.y-=sizeApp.height / 2f;
      translation.x+=offset.x;
      translation.y-=offset.y;
    }
    logger.fine("String_Node_Str" + this);
    logger.fine("String_Node_Str" + translation);
  }
 else {
    translation.x=offset.x;
    translation.y=offset.y;
    Vector2f pixelScale=getPixelScaleCurrent();
    Dimension parentSize=parent.getSizeApp();
    translation.x+=-parentSize.width * pixelScale.x / 2f;
    translation.y+=parentSize.height * pixelScale.y / 2f;
    translation.x+=sizeApp.width * pixelScale.x / 2f;
    translation.y-=sizeApp.height * pixelScale.y / 2f;
    translation.x+=pixelOffset.x * pixelScale.x;
    translation.y-=pixelOffset.y * pixelScale.y;
  }
  return translation;
}

Fixed version (ground truth):
private Vector3f calcOffsetTranslation(){
  Vector3f translation=new Vector3f();
  if (parent == null)   return translation;
  logger.fine("String_Node_Str" + this);
  if (ortho) {
    if (type == Type.PRIMARY || type == Type.UNKNOWN) {
      translation.x=locationOrtho.x;
      translation.y=locationOrtho.y;
    }
 else {
      translation.x=locationOrtho.x + offset.x;
      translation.y=locationOrtho.y + offset.y;
      Dimension parentSize=parent.getSizeApp();
      translation.x+=-parentSize.width / 2f;
      translation.y+=parentSize.height / 2f;
      translation.x+=sizeApp.width / 2f;
      translation.y-=sizeApp.height / 2f;
      translation.x+=pixelOffset.x;
      translation.y-=pixelOffset.y;
    }
  }
 else {
    translation.x=offset.x;
    translation.y=offset.y;
    Vector2f pixelScale=getPixelScaleCurrent();
    Dimension parentSize=parent.getSizeApp();
    translation.x+=-parentSize.width * pixelScale.x / 2f;
    translation.y+=parentSize.height * pixelScale.y / 2f;
    translation.x+=sizeApp.width * pixelScale.x / 2f;
    translation.y-=sizeApp.height * pixelScale.y / 2f;
    translation.x+=pixelOffset.x * pixelScale.x;
    translation.y-=pixelOffset.y * pixelScale.y;
  }
  logger.fine("String_Node_Str" + translation);
  return translation;
}
Program: 46157
Project: 46157
Buggy source:
/** 
 * Return the window menu items for this window based on its current state.
 */
public ContextMenuItem[] windowMenuItems(){
switch (type) {
case PRIMARY:
case UNKNOWN:
    return new ContextMenuItem[]{new SimpleContextMenuItem("String_Node_Str",new ContextMenuActionListener(){
      public void actionPerformed(      ContextMenuItemEvent event){
        app.getControlArb().releaseControl();
      }
    }
)};
case SECONDARY:
  return new ContextMenuItem[]{};
case POPUP:
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Return the window menu items for this window based on its current state.
 */
public ContextMenuItem[] windowMenuItems(){
}
Program: 46158
Project: 46158
Buggy source:
public void actionPerformed(ContextMenuItemEvent event){
  app.getControlArb().releaseControl();
}

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

Fixed version (ground truth):
public void mouseExited(MouseEvent e){
  if (!app.getControlArb().hasControl())   return;
}
Program: 46160
Project: 46160
Buggy source:
public void mousePressed(MouseEvent e){
}

Fixed version (ground truth):
public void mousePressed(MouseEvent e){
  if (e.getID() == MouseEvent.MOUSE_PRESSED && e.getButton() == MouseEvent.BUTTON3 && e.getModifiersEx() == MouseEvent.BUTTON3_DOWN_MASK) {
    view.getWindow().displayWindowMenu(view.getEntity(),e);
    return;
  }
  if (!app.getControlArb().hasControl())   return;
}
Program: 46161
Project: 46161
Buggy source:
public void mouseReleased(MouseEvent e){
}

Fixed version (ground truth):
public void mouseReleased(MouseEvent e){
  if (!app.getControlArb().hasControl())   return;
}
Program: 46162
Project: 46162
Buggy source:
public boolean consumesEvent(Event event){
  return app.getControlArb().hasControl();
}

Fixed version (ground truth):
@Override public boolean consumesEvent(Event event){
  return true;
}
Program: 46163
Project: 46163
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void cleanup(){
  super.cleanup();
  setVisible(false);
  if (headerWindow != null) {
    headerWindow.cleanup();
    headerWindow=null;
  }
  headerPanel.removeMouseListener(this);
  Entity viewEntity=getEntity();
  if (viewEntity != null) {
    consumingListener.removeFromEntity(viewEntity);
  }
  view=null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void cleanup(){
  super.cleanup();
  setVisible(false);
  if (headerWindow != null) {
    headerWindow.cleanup();
    headerWindow=null;
  }
  headerPanel.removeMouseListener(this);
  headerPanel.removeMouseMotionListener(this);
  Entity viewEntity=getEntity();
  if (viewEntity != null) {
    consumingListener.removeFromEntity(viewEntity);
  }
  view=null;
}
Program: 46164
Project: 46164
Buggy source:
public void mouseEntered(MouseEvent e){
}

Fixed version (ground truth):
public void mouseEntered(MouseEvent e){
  if (!app.getControlArb().hasControl())   return;
}
Program: 46165
Project: 46165
Buggy source:
public void mouseClicked(MouseEvent e){
  if (Gui2D.isChangeControlEvent(e)) {
    ControlArb appControlArb=app.getControlArb();
    if (appControlArb.hasControl()) {
      appControlArb.releaseControl();
    }
 else {
      appControlArb.takeControl();
    }
  }
}

Fixed version (ground truth):
public void mouseClicked(MouseEvent e){
  if (Gui2D.isChangeControlEvent(e)) {
    ControlArb appControlArb=app.getControlArb();
    if (appControlArb.hasControl()) {
      appControlArb.releaseControl();
    }
 else {
      appControlArb.takeControl();
    }
    return;
  }
}
Program: 46166
Project: 46166
Buggy source:
/** 
 * Create a new instance of FrameHeaderSwing.
 * @param view The view the frame encloses.
 * @param closeListeners The listeners to be notified when the header's close button is pressed.
 */
public FrameHeaderSwing(View2DCell view,LinkedList<Frame2DCell.CloseListener> closeListeners){
  super("String_Node_Str" + view,view,null);
  this.view=view;
  Window2D viewWindow=view.getWindow();
  app=viewWindow.getApp();
  headerWindow=new WindowSwingHeader(app,viewWindow,1,1,view.getPixelScale(),"String_Node_Str" + view.getName(),view);
  headerWindow.setCoplanar(true);
  headerPanel=new HeaderPanel();
  JmeClientMain.getFrame().getCanvas3DPanel().add(headerPanel);
  headerPanel.setContainer(this);
  headerWindow.setComponent(headerPanel);
  headerPanel.addMouseListener(this);
  View2DDisplayer displayer=view.getDisplayer();
  frameView=(View2DEntity)headerWindow.getView(displayer);
  frameView.disableGUI();
  consumingListener.addToEntity(frameView.getEntity());
}

Fixed version (ground truth):
/** 
 * Create a new instance of FrameHeaderSwing.
 * @param view The view the frame encloses.
 * @param closeListeners The listeners to be notified when the header's close button is pressed.
 */
public FrameHeaderSwing(View2DCell view,LinkedList<Frame2DCell.CloseListener> closeListeners){
  super("String_Node_Str" + view,view,null);
  this.view=view;
  Window2D viewWindow=view.getWindow();
  app=viewWindow.getApp();
  headerWindow=new WindowSwingHeader(app,viewWindow,1,1,view.getPixelScale(),"String_Node_Str" + view.getName(),view);
  headerWindow.setCoplanar(true);
  headerPanel=new HeaderPanel();
  JmeClientMain.getFrame().getCanvas3DPanel().add(headerPanel);
  headerPanel.setContainer(this);
  headerWindow.setComponent(headerPanel);
  headerPanel.addMouseListener(this);
  headerPanel.addMouseMotionListener(this);
  View2DDisplayer displayer=view.getDisplayer();
  frameView=(View2DEntity)headerWindow.getView(displayer);
  frameView.disableGUI();
  consumingListener.addToEntity(frameView.getEntity());
}
Program: 46167
Project: 46167
Buggy source:
public void removeMouseListener(MouseListener listener){
  super.removeMouseListener(listener);
  if (jLabel1 != null) {
    jLabel1.removeMouseListener(listener);
  }
  if (jLabel2 != null) {
    jLabel2.removeMouseListener(listener);
  }
  if (jButton1 != null) {
    jButton1.removeMouseListener(listener);
  }
}

Fixed version (ground truth):
@Override public void removeMouseListener(MouseListener listener){
  super.removeMouseListener(listener);
  if (jLabel1 != null) {
    jLabel1.removeMouseListener(listener);
  }
  if (jLabel2 != null) {
    jLabel2.removeMouseListener(listener);
  }
  if (jButton1 != null) {
    jButton1.removeMouseListener(listener);
  }
}
Program: 46168
Project: 46168
Buggy source:
public void addMouseListener(MouseListener listener){
  super.addMouseListener(listener);
  if (jLabel1 != null) {
    jLabel1.addMouseListener(listener);
  }
  if (jLabel2 != null) {
    jLabel2.addMouseListener(listener);
  }
  if (jButton1 != null) {
    jButton1.addMouseListener(listener);
  }
}

Fixed version (ground truth):
@Override public void addMouseListener(MouseListener listener){
  super.addMouseListener(listener);
  if (jLabel1 != null) {
    jLabel1.addMouseListener(listener);
  }
  if (jLabel2 != null) {
    jLabel2.addMouseListener(listener);
  }
  if (jButton1 != null) {
    jButton1.addMouseListener(listener);
  }
}