nus-yam/ex-repair huggingface dataset:
Program: 45781
Project: 45781
Buggy source:
/** 
 * Manually set whether the translation affordance is visible (true) or not (false).
 * @param visible True if the translation affordance should be visible
 */
public void setTranslationVisible(boolean visible){
  Cell cell=getSelectedCell();
  if (cell == null) {
    return;
  }
  if (translateToggleButton.isSelected() != visible) {
    translateToggleButton.setSelected(visible);
  }
  CellComponent component=cell.getComponent(TranslateAffordanceCellComponent.class);
  if (visible) {
    if (component == null) {
      component=new TranslateAffordanceCellComponent(cell);
      cell.addComponent(component);
    }
    ((AffordanceCellComponent)component).setSize(getSliderSize());
  }
 else {
    if (component != null) {
      ((AffordanceCellComponent)component).remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Manually set whether the translation affordance is visible (true) or not (false).
 * @param visible True if the translation affordance should be visible
 */
public void setTranslationVisible(boolean visible){
  Cell cell=getSelectedCell();
  if (cell == null) {
    return;
  }
  if (translateToggleButton.isSelected() != visible) {
    translateToggleButton.setSelected(visible);
  }
  CellComponent component=cell.getComponent(TranslateAffordanceCellComponent.class);
  if (visible == true) {
    if (component == null) {
      component=new TranslateAffordanceCellComponent(cell);
      cell.addComponent(component);
    }
    ((AffordanceCellComponent)component).setSize(getSliderSize());
  }
 else {
    if (component != null) {
      ((AffordanceCellComponent)component).remove();
    }
  }
}
Program: 45782
Project: 45782
Buggy source:
/** 
 * Manually set whether the rotation affordance is visible (true) or not (false).
 * @param visible True if the rotation affordance should be visible
 */
public void setRotationVisible(boolean visible){
  Cell cell=getSelectedCell();
  if (cell == null) {
    return;
  }
  if (rotateToggleButton.isSelected() != visible) {
    rotateToggleButton.setSelected(visible);
  }
  CellComponent component=cell.getComponent(RotateAffordanceCellComponent.class);
  if (visible) {
    if (component == null) {
      component=new RotateAffordanceCellComponent(cell);
      cell.addComponent(component);
    }
    ((AffordanceCellComponent)component).setSize(getSliderSize());
  }
 else {
    if (component != null) {
      ((AffordanceCellComponent)component).remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Manually set whether the rotation affordance is visible (true) or not (false).
 * @param visible True if the rotation affordance should be visible
 */
public void setRotationVisible(boolean visible){
  Cell cell=getSelectedCell();
  if (cell == null) {
    return;
  }
  if (rotateToggleButton.isSelected() != visible) {
    rotateToggleButton.setSelected(visible);
  }
  CellComponent component=cell.getComponent(RotateAffordanceCellComponent.class);
  if (visible == true) {
    if (component == null) {
      component=new RotateAffordanceCellComponent(cell);
      cell.addComponent(component);
    }
    ((AffordanceCellComponent)component).setSize(getSliderSize());
  }
 else {
    if (component != null) {
      ((AffordanceCellComponent)component).remove();
    }
  }
}
Program: 45783
Project: 45783
Buggy source:
/** 
 * Creates new form AffordanceHUDPanel 
 */
public AffordanceHUDPanel(){
  initComponents();
  Dictionary<Integer,JComponent> labels=new Hashtable<Integer,JComponent>();
  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);
  HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
  positionHUDPanel=new PositionHUDPanel();
  positionHUD=mainHUD.createComponent(positionHUDPanel);
  positionHUD.setName("String_Node_Str");
  positionHUD.setPreferredLocation(Layout.SOUTHEAST);
  mainHUD.addComponent(positionHUD);
  InputManager.inputManager().addGlobalEventListener(new SelectionListener());
}

Fixed version (ground truth):
/** 
 * Creates new form AffordanceHUDPanel 
 */
public AffordanceHUDPanel(){
  initComponents();
  Hashtable<Integer,JComponent> labels=new Hashtable<Integer,JComponent>();
  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);
  HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
  positionHUDPanel=new PositionHUDPanel();
  positionHUD=mainHUD.createComponent(positionHUDPanel);
  positionHUD.setName("String_Node_Str");
  positionHUD.setPreferredLocation(Layout.SOUTHEAST);
  mainHUD.addComponent(positionHUD);
  InputManager.inputManager().addGlobalEventListener(new SelectionListener());
}
Program: 45784
Project: 45784
Buggy source:
/** 
 * Manually set whether the resizing affordance is visible (true) or not (false).
 * @param visible True if the resizing affordance should be visible
 */
public void setResizingVisible(boolean visible){
  Cell cell=getSelectedCell();
  if (cell == null) {
    return;
  }
  if (resizeToggleButton.isSelected() != visible) {
    resizeToggleButton.setSelected(visible);
  }
  CellComponent component=cell.getComponent(ResizeAffordanceCellComponent.class);
  if (visible) {
    if (component == null) {
      component=new ResizeAffordanceCellComponent(cell);
      cell.addComponent(component);
    }
    ((AffordanceCellComponent)component).setSize(getSliderSize());
  }
 else {
    if (component != null) {
      ((AffordanceCellComponent)component).remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Manually set whether the resizing affordance is visible (true) or not (false).
 * @param visible True if the resizing affordance should be visible
 */
public void setResizingVisible(boolean visible){
  Cell cell=getSelectedCell();
  if (cell == null) {
    return;
  }
  if (resizeToggleButton.isSelected() != visible) {
    resizeToggleButton.setSelected(visible);
  }
  CellComponent component=cell.getComponent(ResizeAffordanceCellComponent.class);
  if (visible == true) {
    if (component == null) {
      component=new ResizeAffordanceCellComponent(cell);
      cell.addComponent(component);
    }
    ((AffordanceCellComponent)component).setSize(getSliderSize());
  }
 else {
    if (component != null) {
      ((AffordanceCellComponent)component).remove();
    }
  }
}
Program: 45785
Project: 45785
Buggy source:
/** 
 * 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.setName("String_Node_Str");
  affordanceHUD.setPreferredLocation(Layout.SOUTH);
  affordanceHUD.addEventListener(new HUDEventListener(){
    public void HUDObjectChanged(    HUDEvent event){
      if (event.getEventType() == HUDEventType.CLOSED) {
        affordanceHUDPanel.closed();
        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);
  affordanceHUDPanel.setHUDComponent(affordanceHUD);
  affordanceHUD.setName(BUNDLE.getString("String_Node_Str"));
  affordanceHUD.setPreferredLocation(Layout.SOUTH);
  affordanceHUD.addEventListener(new HUDEventListener(){
    public void HUDObjectChanged(    HUDEvent event){
      if (event.getEventType() == HUDEventType.CLOSED) {
        affordanceHUDPanel.closed();
        InputManager.inputManager().postEvent(new AffordanceRemoveEvent());
      }
    }
  }
);
  mainHUD.addComponent(affordanceHUD);
}
Program: 45787
Project: 45787
Buggy source:
public void createCell(DeployedModel deployedModel){
  CellServerState state=deployedModel.getCellServerState();
  PositionComponentServerState pcss=(PositionComponentServerState)state.getComponentServerState(PositionComponentServerState.class);
  BoundingVolume boundsHint=null;
  if (pcss != null) {
    Bounds bounds=pcss.getBounds();
    if (bounds.type == Bounds.BoundsType.BOX) {
      boundsHint=new BoundingBox(Vector3f.ZERO,(float)bounds.x,(float)bounds.y,(float)bounds.z);
    }
 else {
      boundsHint=new BoundingSphere((float)bounds.x,Vector3f.ZERO);
    }
  }
  BoundingVolumeHint hint=new BoundingVolumeHint(true,boundsHint);
  state.setBoundingVolumeHint(hint);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + deployedModel.getModelURL(),excp);
  }
}

Fixed version (ground truth):
public void createCell(DeployedModel deployedModel){
  CellServerState state=deployedModel.getCellServerState();
  PositionComponentServerState pcss=(PositionComponentServerState)state.getComponentServerState(PositionComponentServerState.class);
  BoundingVolume boundsHint=null;
  if (pcss != null) {
    Bounds bounds=pcss.getBounds();
    if (bounds.type == Bounds.BoundsType.BOX) {
      boundsHint=new BoundingBox(Vector3f.ZERO,(float)bounds.x,(float)bounds.y,(float)bounds.z);
    }
 else {
      if (bounds.x > 20)       boundsHint=new BoundingSphere(1f,Vector3f.ZERO);
 else       boundsHint=new BoundingSphere((float)bounds.x,Vector3f.ZERO);
    }
  }
  BoundingVolumeHint hint=new BoundingVolumeHint(true,boundsHint);
  state.setBoundingVolumeHint(hint);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + deployedModel.getModelURL(),excp);
  }
}
Program: 45790
Project: 45790
Buggy source:
@Override public int hashCode(){
  int hash=7;
  hash=31 * hash + (this.name != null ? this.name.hashCode() : 0);
  return hash;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int hashCode(){
  int hash=7;
  hash=31 * hash + (this.name != null ? this.name.hashCode() : 0);
  return hash;
}
Program: 45791
Project: 45791
Buggy source:
/** 
 */
public void restore(){
  Cell cell=editor.getCell();
  if (movableComponent == null) {
    logger.warning("String_Node_Str" + cell.getName());
    return;
  }
  CellTransform transform=cell.getLocalTransform();
  transform.setTranslation(originalTranslation);
  transform.setScaling(originalScaling.x);
  transform.setRotation(originalRotation);
  movableComponent.localMoveRequest(transform);
}

Fixed version (ground truth):
/** 
 */
public void restore(){
  Cell cell=editor.getCell();
  if (movableComponent == null) {
    logger.warning("String_Node_Str" + cell.getName());
    return;
  }
  if (isLocalChangesMade == true) {
    CellTransform transform=cell.getLocalTransform();
    transform.setTranslation(originalTranslation);
    transform.setScaling(originalScaling.x);
    transform.setRotation(originalRotation);
    movableComponent.localMoveRequest(transform);
  }
}
Program: 45792
Project: 45792
Buggy source:
public void stateChanged(ChangeEvent e){
  if (setLocal == false) {
    updateScale();
  }
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  if (setLocal == false) {
    isLocalChangesMade=true;
    updateScale();
  }
}
Program: 45794
Project: 45794
Buggy source:
/** 
 */
@Override public Component getTreeCellRendererComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row,boolean hasFocus){
  super.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
  DefaultMutableTreeNode treeNode=(DefaultMutableTreeNode)value;
  if (treeNode == dragOverTreeNode) {
    setBorder(BorderFactory.createLineBorder(Color.BLACK));
  }
 else {
    setBorder(null);
  }
  Object userObject=treeNode.getUserObject();
  if (userObject instanceof Cell) {
    Cell cell=(Cell)treeNode.getUserObject();
    setText(cell.getName());
  }
  return this;
}

Fixed version (ground truth):
/** 
 */
@Override public Component getTreeCellRendererComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row,boolean hasFocus){
  super.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
  DefaultMutableTreeNode treeNode=(DefaultMutableTreeNode)value;
  if (treeNode == dragOverTreeNode) {
    setBorder(BorderFactory.createLineBorder(Color.BLACK));
  }
 else {
    setBorder(null);
  }
  Object userObject=treeNode.getUserObject();
  if (userObject instanceof Cell) {
    Cell cell=(Cell)treeNode.getUserObject();
    setText(cell.getName() + "String_Node_Str" + cell.getCellID().toString()+ "String_Node_Str");
  }
  return this;
}
Program: 45795
Project: 45795
Buggy source:
/** 
 * Applies the values stored in the GUI to the cell. Loops through each of the panels and tells them to apply().
 */
private void applyValues(){
  for (  PropertiesFactorySPI factory : factoryList) {
    Class clazz=factory.getClass();
    if (dirtyPanelSet.contains(clazz) == true) {
      factory.apply();
    }
  }
  CellServerState updateState=stateUpdates.cellServerState;
  if (updateState != null) {
    updateState.removeAllComponentServerStates();
  }
  CellServerStateUpdateMessage msg=new CellServerStateUpdateMessage(selectedCell.getCellID(),updateState,stateUpdates.cellComponentServerStateSet);
  ResponseMessage response=selectedCell.sendCellMessageAndWait(msg);
  if (response instanceof ErrorMessage) {
    ErrorMessage em=(ErrorMessage)response;
    LOGGER.log(Level.WARNING,"String_Node_Str" + em.getErrorMessage(),em.getErrorCause());
    JOptionPane.showMessageDialog(this,em.getErrorMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
  }
  stateUpdates.clear();
  selectedCellServerState=fetchCellServerState();
  if (selectedCellServerState == null) {
    LOGGER.warning("String_Node_Str" + selectedCell.getName());
    return;
  }
  dirtyPanelSet.clear();
  applyButton.setEnabled(false);
  restoreButton.setEnabled(false);
  updateGUI();
}

Fixed version (ground truth):
/** 
 * Applies the values stored in the GUI to the cell. Loops through each of the panels and tells them to apply().
 */
private void applyValues(){
  for (  PropertiesFactorySPI factory : factoryList) {
    Class clazz=factory.getClass();
    if (dirtyPanelSet.contains(clazz) == true) {
      factory.apply();
    }
  }
  CellServerState updateState=stateUpdates.cellServerState;
  if (updateState != null) {
    updateState.removeAllComponentServerStates();
  }
  CellServerStateUpdateMessage msg=new CellServerStateUpdateMessage(selectedCell.getCellID(),updateState,stateUpdates.cellComponentServerStateSet);
  ResponseMessage response=selectedCell.sendCellMessageAndWait(msg);
  if (response instanceof ErrorMessage) {
    ErrorMessage em=(ErrorMessage)response;
    LOGGER.log(Level.WARNING,"String_Node_Str" + em.getErrorMessage(),em.getErrorCause());
    JOptionPane.showMessageDialog(this,em.getErrorMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
  }
  stateUpdates.clear();
  selectedCellServerState=fetchCellServerState();
  if (selectedCellServerState == null) {
    LOGGER.warning("String_Node_Str" + selectedCell.getName());
    return;
  }
  dirtyPanelSet.clear();
  applyButton.setEnabled(false);
  restoreButton.setEnabled(false);
  updateGUI();
  DefaultMutableTreeNode node=cellNodes.get(selectedCell);
  ((DefaultTreeModel)cellHierarchyTree.getModel()).nodeChanged(node);
}
Program: 45796
Project: 45796
Buggy source:
public static WonderlandCharacterParams loadFemale() throws IOException {
  URL femaleURL=WonderlandCharacterParams.class.getResource(FEMALE_CONFIGS);
  WonderlandCharacterParams params=new WonderlandCharacterParams(femaleURL);
  for (  ConfigType type : DEFAULT_FEMALE_PRESETS.keySet()) {
    params.setElementPreset(type,DEFAULT_FEMALE_PRESETS.get(type));
  }
  return params;
}

Fixed version (ground truth):
public static WonderlandCharacterParams loadFemale() throws IOException {
  URL femaleURL=WonderlandCharacterParams.class.getResource(FEMALE_CONFIGS);
  WonderlandCharacterParams params=new WonderlandCharacterParams(femaleURL);
  for (  ConfigType type : DEFAULT_FEMALE_PRESETS.keySet()) {
    params.setElementPreset(type,DEFAULT_FEMALE_PRESETS.get(type));
  }
  for (  ConfigType type : DEFAULT_FEMALE_COLORS.keySet()) {
    params.setElementColor(type,DEFAULT_FEMALE_COLORS.get(type));
  }
  return params;
}
Program: 45797
Project: 45797
Buggy source:
public static WonderlandCharacterParams loadMale() throws IOException {
  URL maleURL=WonderlandCharacterParams.class.getResource(MALE_CONFIGS);
  WonderlandCharacterParams params=new WonderlandCharacterParams(maleURL);
  for (  ConfigType type : DEFAULT_MALE_PRESETS.keySet()) {
    params.setElementPreset(type,DEFAULT_MALE_PRESETS.get(type));
  }
  return params;
}

Fixed version (ground truth):
public static WonderlandCharacterParams loadMale() throws IOException {
  URL maleURL=WonderlandCharacterParams.class.getResource(MALE_CONFIGS);
  WonderlandCharacterParams params=new WonderlandCharacterParams(maleURL);
  for (  ConfigType type : DEFAULT_MALE_PRESETS.keySet()) {
    params.setElementPreset(type,DEFAULT_MALE_PRESETS.get(type));
  }
  for (  ConfigType type : DEFAULT_MALE_COLORS.keySet()) {
    params.setElementColor(type,DEFAULT_MALE_COLORS.get(type));
  }
  return params;
}
Program: 45798
Project: 45798
Buggy source:
public void createCell(DeployedModel deployedModel){
  CellServerState state=deployedModel.getCellServerState();
  PositionComponentServerState pcss=(PositionComponentServerState)state.getComponentServerState(PositionComponentServerState.class);
  BoundingVolume boundsHint=null;
  if (pcss != null) {
    Bounds bounds=pcss.getBounds();
    if (bounds.type == Bounds.BoundsType.BOX) {
      boundsHint=new BoundingBox(Vector3f.ZERO,(float)bounds.x,(float)bounds.y,(float)bounds.z);
    }
 else {
      if (bounds.x > 20)       boundsHint=new BoundingSphere(1f,Vector3f.ZERO);
 else       boundsHint=new BoundingSphere((float)bounds.x,Vector3f.ZERO);
    }
  }
  BoundingVolumeHint hint=new BoundingVolumeHint(true,boundsHint);
  state.setBoundingVolumeHint(hint);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + deployedModel.getModelURL(),excp);
  }
}

Fixed version (ground truth):
public void createCell(DeployedModel deployedModel){
  CellServerState state=deployedModel.getCellServerState();
  PositionComponentServerState pcss=(PositionComponentServerState)state.getComponentServerState(PositionComponentServerState.class);
  BoundingVolume boundsHint=null;
  if (pcss != null) {
    Bounds bounds=pcss.getBounds();
    if (bounds.type == Bounds.BoundsType.BOX) {
      if (bounds.x > 20 || bounds.y > 20 || bounds.z > 20) {
        boundsHint=new BoundingBox(Vector3f.ZERO,1,1,1);
      }
 else {
        boundsHint=new BoundingBox(Vector3f.ZERO,(float)bounds.x,(float)bounds.y,(float)bounds.z);
      }
    }
 else {
      if (bounds.x > 20)       boundsHint=new BoundingSphere(1f,Vector3f.ZERO);
 else       boundsHint=new BoundingSphere((float)bounds.x,Vector3f.ZERO);
    }
  }
  BoundingVolumeHint hint=new BoundingVolumeHint(true,boundsHint);
  state.setBoundingVolumeHint(hint);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + deployedModel.getModelURL(),excp);
  }
}
Program: 45800
Project: 45800
Buggy source:
private void newButtonActionPerformed(java.awt.event.ActionEvent evt){
  AvatarRegistry registry=AvatarRegistry.getAvatarRegistry();
  String avatarName=registry.getUniqueAvatarName();
  ImiAvatar newAvatar=ImiAvatar.createAvatar(avatarName);
  newAvatar.configure();
}

Fixed version (ground truth):
private void newButtonActionPerformed(java.awt.event.ActionEvent evt){
  RenderManager rm=ClientContextJME.getWorldManager().getRenderManager();
  String shaderCheck=System.getProperty("String_Node_Str");
  boolean shaderPass=true;
  if (shaderCheck != null && shaderCheck.equals("String_Node_Str")) {
    shaderPass=rm.getContextCaps().GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB >= 512;
  }
  if (rm.supportsOpenGL20() == false || !shaderPass) {
    String msg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    String title="String_Node_Str";
    JFrame frame=JmeClientMain.getFrame().getFrame();
    JOptionPane.showMessageDialog(frame,msg,title,JOptionPane.ERROR_MESSAGE);
    return;
  }
  AvatarRegistry registry=AvatarRegistry.getAvatarRegistry();
  String avatarName=registry.getUniqueAvatarName();
  ImiAvatar newAvatar=ImiAvatar.createAvatar(avatarName);
  newAvatar.configure();
}
Program: 45801
Project: 45801
Buggy source:
private void useButtonActionPerformed(java.awt.event.ActionEvent evt){
  AvatarRegistry registry=AvatarRegistry.getAvatarRegistry();
  AvatarSPI avatar=(AvatarSPI)avatarList.getSelectedValue();
  registry.setAvatarInUse(avatar,false);
}

Fixed version (ground truth):
private void useButtonActionPerformed(java.awt.event.ActionEvent evt){
  AvatarRegistry registry=AvatarRegistry.getAvatarRegistry();
  AvatarSPI avatar=(AvatarSPI)avatarList.getSelectedValue();
  if (avatar.isHighResolution() == false) {
    registry.setAvatarInUse(avatar,false);
    return;
  }
  RenderManager rm=ClientContextJME.getWorldManager().getRenderManager();
  String shaderCheck=System.getProperty("String_Node_Str");
  boolean shaderPass=true;
  if (shaderCheck != null && shaderCheck.equals("String_Node_Str")) {
    shaderPass=rm.getContextCaps().GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB >= 512;
  }
  if (rm.supportsOpenGL20() == false || !shaderPass) {
    String msg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    String title="String_Node_Str";
    JFrame frame=JmeClientMain.getFrame().getFrame();
    JOptionPane.showMessageDialog(frame,msg,title,JOptionPane.ERROR_MESSAGE);
    return;
  }
  registry.setAvatarInUse(avatar,false);
}
Program: 45802
Project: 45802
Buggy source:
private void customizeButtonActionPerformed(java.awt.event.ActionEvent evt){
  AvatarSPI avatar=(AvatarSPI)avatarList.getSelectedValue();
  avatar.configure();
}

Fixed version (ground truth):
private void customizeButtonActionPerformed(java.awt.event.ActionEvent evt){
  AvatarSPI avatar=(AvatarSPI)avatarList.getSelectedValue();
  if (avatar.isHighResolution() == false) {
    avatar.configure();
    return;
  }
  RenderManager rm=ClientContextJME.getWorldManager().getRenderManager();
  String shaderCheck=System.getProperty("String_Node_Str");
  boolean shaderPass=true;
  if (shaderCheck != null && shaderCheck.equals("String_Node_Str")) {
    shaderPass=rm.getContextCaps().GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB >= 512;
  }
  if (rm.supportsOpenGL20() == false || !shaderPass) {
    String msg="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    String title="String_Node_Str";
    JFrame frame=JmeClientMain.getFrame().getFrame();
    JOptionPane.showMessageDialog(frame,msg,title,JOptionPane.ERROR_MESSAGE);
    return;
  }
  avatar.configure();
}
Program: 45804
Project: 45804
Buggy source:
/** 
 */
@Override protected void deactivate(){
  AvatarSessionLoader loader=loaderMap.get(getSessionManager());
  if (loader != null) {
    loader.removeAvatarLoaderStateListener(this);
    loader.unload();
    loaderMap.remove(getSessionManager());
  }
  ViewManager.getViewManager().removeViewManagerListener(this);
  if (inUseListener != null) {
    AvatarRegistry.getAvatarRegistry().removeAvatarInUseListener(inUseListener);
    inUseListener=null;
  }
  if (menusAdded == true) {
    MainFrame frame=JmeClientMain.getFrame();
    frame.removeFromWindowMenu(gestureMI);
    frame.removeFromToolsMenu(collisionResponseEnabledMI);
    frame.removeFromToolsMenu(gravityEnabledMI);
    frame.removeFromEditMenu(avatarConfigMI);
    if (frame instanceof MainFrameImpl) {
      ((MainFrameImpl)frame).removeFromCameraChoices(chaseCameraMI);
    }
 else {
      frame.removeFromViewMenu(chaseCameraMI);
    }
    if (avatarControlsMI != null) {
      frame.removeFromWindowMenu(avatarControlsMI);
    }
    if (avatarSettingsMI != null) {
      frame.removeFromEditMenu(avatarSettingsMI);
    }
    menusAdded=false;
  }
}

Fixed version (ground truth):
/** 
 */
@Override protected void deactivate(){
  if (menusAdded == true) {
    MainFrame frame=JmeClientMain.getFrame();
    frame.removeFromWindowMenu(gestureMI);
    frame.removeFromToolsMenu(collisionResponseEnabledMI);
    frame.removeFromToolsMenu(gravityEnabledMI);
    frame.removeFromEditMenu(avatarConfigMI);
    if (frame instanceof MainFrameImpl) {
      ((MainFrameImpl)frame).removeFromCameraChoices(chaseCameraMI);
    }
 else {
      frame.removeFromViewMenu(chaseCameraMI);
    }
    if (avatarControlsMI != null) {
      frame.removeFromWindowMenu(avatarControlsMI);
    }
    if (avatarSettingsMI != null) {
      frame.removeFromEditMenu(avatarSettingsMI);
    }
    menusAdded=false;
  }
  if (inUseListener != null) {
    AvatarRegistry.getAvatarRegistry().removeAvatarInUseListener(inUseListener);
    inUseListener=null;
  }
  ViewManager.getViewManager().removeViewManagerListener(this);
  AvatarSessionLoader loader=loaderMap.get(getSessionManager());
  if (loader != null) {
    loader.removeAvatarLoaderStateListener(this);
    loader.unload();
    loaderMap.remove(getSessionManager());
  }
}
Program: 45805
Project: 45805
Buggy source:
/** 
 * Sets the state of the avatar session loader.
 * @param state The new state
 */
public void setState(State state){
synchronized (currentState) {
    logger.info("String_Node_Str" + state);
    currentState=state;
    fireAvatarLoaderStateEvent(state);
  }
}

Fixed version (ground truth):
/** 
 * Sets the state of the avatar session loader.
 * @param state The new state
 */
public void setState(State state){
synchronized (currentState) {
    currentState=state;
    fireAvatarLoaderStateEvent(state);
  }
}
Program: 45806
Project: 45806
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String getName(){
  return avatarName;
}
Program: 45807
Project: 45807
Buggy source:
/** 
 * {@inheritDoc}
 */
public AvatarConfigInfo getAvatarConfigInfo(ServerSessionManager session){
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public AvatarConfigInfo getAvatarConfigInfo(ServerSessionManager session){
  return new AvatarConfigInfo(avatarURL,BasicAvatarLoaderFactory.class.getName());
}
Program: 45808
Project: 45808
Buggy source:
/** 
 * Default constructor 
 */
public BasicAvatar(){
}

Fixed version (ground truth):
/** 
 * Default constructor 
 */
public BasicAvatar(String avatarName,String avatarURL){
  this.avatarName=avatarName;
  this.avatarURL=avatarURL;
}
Program: 45809
Project: 45809
Buggy source:
private void BusyButtonActionPerformed(java.awt.event.ActionEvent evt){
  session.send(client,new VoiceChatBusyMessage(group,caller,myPresenceInfo,chatType));
  incomingCallHUDComponent.setVisible(false);
}

Fixed version (ground truth):
private void BusyButtonActionPerformed(java.awt.event.ActionEvent evt){
  answered=true;
  session.send(client,new VoiceChatBusyMessage(group,caller,myPresenceInfo,chatType));
  incomingCallHUDComponent.setVisible(false);
}
Program: 45812
Project: 45812
Buggy source:
protected void componentWorldVisible(HUDComponent2D component){
  logger.info("String_Node_Str" + component);
  HUDComponentState state=(HUDComponentState)hudStateMap.get(component);
  if ((state != null) && (!state.isWorldVisible())) {
    Cell cell=component.getCell();
    if (cell != null) {
      HUDView3D worldView=state.getWorldView();
      if (worldView == null) {
        if (worldDisplayer == null) {
          logger.fine("String_Node_Str");
          worldDisplayer=new HUDView3DDisplayer(cell);
        }
        logger.fine("String_Node_Str");
        worldView=worldDisplayer.createView(state.getWindow());
        worldView.setPixelScale(worldPixelScale);
        state.setWorldView(worldView);
      }
      logger.fine("String_Node_Str");
      worldView.setOrtho(false,false);
      worldView.setPixelScale(worldPixelScale);
      worldView.setVisibleApp(true);
      worldView.setVisibleUser(true,false);
      componentMovedWorld(component);
      worldView.update();
    }
  }
}

Fixed version (ground truth):
protected void componentWorldVisible(HUDComponent2D component){
  logger.info("String_Node_Str" + component);
  HUDComponentState state=(HUDComponentState)hudStateMap.get(component);
  if ((state != null) && (!state.isWorldVisible())) {
    Cell cell=component.getCell();
    if (cell != null) {
      HUDView3D worldView=state.getWorldView();
      if (worldView == null) {
        logger.fine("String_Node_Str");
        HUDView3DDisplayer worldDisplayer=new HUDView3DDisplayer(cell);
        logger.fine("String_Node_Str");
        worldView=worldDisplayer.createView(state.getWindow());
        worldView.setPixelScale(worldPixelScale);
        state.setWorldView(worldView);
      }
      logger.fine("String_Node_Str");
      worldView.setOrtho(false,false);
      worldView.setPixelScale(worldPixelScale);
      worldView.setVisibleApp(true);
      worldView.setVisibleUser(true,false);
      componentMovedWorld(component);
      worldView.update();
    }
  }
}
Program: 45813
Project: 45813
Buggy source:
public HUDFrameHeader2DImpl(){
  initComponents();
  addListeners();
  paint=new GradientPaint(0,0,gradientStartColor,0,getHeight(),gradientEndColor);
}

Fixed version (ground truth):
public HUDFrameHeader2DImpl(){
  initComponents();
  addListeners();
  paint=new GradientPaint(0,0,gradientStartColor,0,(int)getPreferredSize().getHeight(),gradientEndColor);
}
Program: 45814
Project: 45814
Buggy source:
/** 
 * {@inheritDoc}
 */
public Vector2f getLocation(HUDComponent component){
  Vector2f location=new Vector2f();
  if (!hudViewMap.containsKey(component)) {
    return location;
  }
  HUDView2D view=(HUDView2D)hudViewMap.get(component);
  if (component != null) {
    location.set((float)component.getLocation().getX(),(float)component.getLocation().getY());
  }
  return location;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Vector2f getLocation(HUDComponent component){
  Vector2f location=new Vector2f();
  if ((component != null) && (hudViewMap.containsKey(component))) {
    location.set((float)component.getLocation().getX(),(float)component.getLocation().getY());
  }
  return location;
}
Program: 45816
Project: 45816
Buggy source:
/** 
 * Adds a bound property listener to the dialog
 * @param listener a listener for dialog events
 */
@Override public synchronized void addPropertyChangeListener(PropertyChangeListener listener){
  if (listeners == null) {
    listeners=new PropertyChangeSupport(this);
  }
  listeners.addPropertyChangeListener(listener);
}

Fixed version (ground truth):
/** 
 * Adds a bound property listener to the dialog
 * @param listener a listener for dialog events
 */
@Override public void addPropertyChangeListener(PropertyChangeListener listener){
  if (listeners == null) {
    listeners=new PropertyChangeSupport(this);
  }
  listeners.addPropertyChangeListener(listener);
}
Program: 45817
Project: 45817
Buggy source:
public void setButtons(BUTTONS buttons){
  this.buttons=buttons;
switch (buttons) {
case NONE:
    okButton.setVisible(false);
  cancelButton.setVisible(false);
break;
case OK:
okButton.setVisible(true);
cancelButton.setVisible(false);
break;
case OK_CANCEL:
okButton.setVisible(true);
cancelButton.setVisible(true);
break;
}
validate();
}

Fixed version (ground truth):
public void setButtons(BUTTONS buttons){
  this.buttons=buttons;
switch (buttons) {
case NONE:
    okButton.setVisible(false);
  cancelButton.setVisible(false);
break;
case OK:
okButton.setVisible(true);
cancelButton.setVisible(false);
break;
case OK_CANCEL:
okButton.setVisible(true);
cancelButton.setVisible(true);
break;
default :
break;
}
validate();
}
Program: 45818
Project: 45818
Buggy source:
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt){
  listeners.firePropertyChange("String_Node_Str",new String("String_Node_Str"),null);
}

Fixed version (ground truth):
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt){
  listeners.firePropertyChange("String_Node_Str","String_Node_Str",null);
}
Program: 45819
Project: 45819
Buggy source:
private void okButtonActionPerformed(java.awt.event.ActionEvent evt){
  listeners.firePropertyChange("String_Node_Str",new String("String_Node_Str"),new String(valueTextField.getText()));
}

Fixed version (ground truth):
private void okButtonActionPerformed(java.awt.event.ActionEvent evt){
  listeners.firePropertyChange("String_Node_Str","String_Node_Str",valueTextField.getText());
}
Program: 45820
Project: 45820
Buggy source:
public void setMode(DIALOG_MODE mode){
  this.mode=mode;
switch (mode) {
case MESSAGE:
    valueTextField.setVisible(false);
  messageLabel.setFont(messageFont);
messageLabel.setForeground(MESSAGE_COLOR);
break;
case INPUT:
valueTextField.setVisible(true);
messageLabel.setFont(dialogFont);
messageLabel.setForeground(DIALOG_COLOR);
break;
}
validate();
}

Fixed version (ground truth):
public void setMode(DIALOG_MODE mode){
  this.mode=mode;
switch (mode) {
case MESSAGE:
    valueTextField.setVisible(false);
  messageLabel.setFont(messageFont);
messageLabel.setForeground(MESSAGE_COLOR);
break;
case INPUT:
valueTextField.setVisible(true);
messageLabel.setFont(dialogFont);
messageLabel.setForeground(DIALOG_COLOR);
break;
default :
break;
}
validate();
}
Program: 45821
Project: 45821
Buggy source:
public void setType(MESSAGE_TYPE type){
  this.type=type;
switch (type) {
case INFO:
    iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
  break;
case WARNING:
iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
break;
case ERROR:
iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
break;
case QUERY:
iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
break;
}
validate();
}

Fixed version (ground truth):
public void setType(MESSAGE_TYPE type){
  this.type=type;
switch (type) {
case INFO:
    iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
  break;
case WARNING:
iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
break;
case ERROR:
iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
break;
case QUERY:
iconLabel.setIcon(new ImageIcon(getClass().getResource("String_Node_Str")));
break;
default :
break;
}
validate();
}
Program: 45822
Project: 45822
Buggy source:
/** 
 * Removes a bound property listener from the dialog
 * @param listener the listener to remove
 */
@Override public synchronized void removePropertyChangeListener(PropertyChangeListener listener){
  if (listeners != null) {
    listeners.removePropertyChangeListener(listener);
  }
}

Fixed version (ground truth):
/** 
 * Removes a bound property listener from the dialog
 * @param listener the listener to remove
 */
@Override public void removePropertyChangeListener(PropertyChangeListener listener){
  if (listeners != null) {
    listeners.removePropertyChangeListener(listener);
  }
}
Program: 45823
Project: 45823
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Vector2f getLocation(HUDComponent component){
  Vector2f location=new Vector2f();
  if (component == null) {
    return location;
  }
  HUDView2D view2d=(HUDView2D)hudViewMap.get(component);
  if (view2d == null) {
    return location;
  }
  float compWidth=view2d.getDisplayerLocalWidth();
  float compHeight=view2d.getDisplayerLocalHeight();
  int hudWidth=hud.getWidth();
  int hudHeight=hud.getHeight();
  location=positionMap.get(component);
  if (location == null) {
    location=new Vector2f(nextX,nextY);
    nextX+=compWidth + X_GAP;
  }
  int x=(int)location.x;
  int y=(int)location.y;
  if (x < hud.getX() + MIN_LEFT_MARGIN) {
    x=hud.getX() + MIN_LEFT_MARGIN;
  }
 else   if (x + compWidth > hud.getX() + hudWidth - MIN_RIGHT_MARGIN) {
    x=MIN_LEFT_MARGIN;
    y+=compHeight + Y_GAP;
  }
  if (y < hud.getY() + MIN_BOTTOM_MARGIN) {
    y=hud.getY() + MIN_BOTTOM_MARGIN;
  }
 else   if (y + compHeight > hud.getY() + hudHeight - MIN_TOP_MARGIN) {
    y=(int)(hud.getY() + hudHeight - MIN_TOP_MARGIN - compHeight);
  }
  location.set(x,y);
  positionMap.put(component,location);
  return location;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Vector2f getLocation(HUDComponent component){
  Vector2f location=new Vector2f();
  if ((component != null) && (hudViewMap.get(component) != null)) {
    HUDView2D view2d=(HUDView2D)hudViewMap.get(component);
    float compWidth=view2d.getDisplayerLocalWidth();
    float compHeight=view2d.getDisplayerLocalHeight();
    int hudWidth=hud.getWidth();
    int hudHeight=hud.getHeight();
    location=positionMap.get(component);
    if (location == null) {
      location=new Vector2f(nextX,nextY);
      nextX+=compWidth + X_GAP;
    }
    int x=(int)location.x;
    int y=(int)location.y;
    if (x < hud.getX() + MIN_LEFT_MARGIN) {
      x=hud.getX() + MIN_LEFT_MARGIN;
    }
 else     if (x + compWidth > hud.getX() + hudWidth - MIN_RIGHT_MARGIN) {
      x=MIN_LEFT_MARGIN;
      y+=compHeight + Y_GAP;
    }
    if (y < hud.getY() + MIN_BOTTOM_MARGIN) {
      y=hud.getY() + MIN_BOTTOM_MARGIN;
    }
 else     if (y + compHeight > hud.getY() + hudHeight - MIN_TOP_MARGIN) {
      y=(int)(hud.getY() + hudHeight - MIN_TOP_MARGIN - compHeight);
    }
    location.set(x,y);
    positionMap.put(component,location);
  }
  return location;
}
Program: 45824
Project: 45824
Buggy source:
public HUDObject2D(){
  listeners=new ConcurrentLinkedQueue();
  eventQueue=new ConcurrentLinkedQueue();
  bounds=new Rectangle2D.Double();
  id=(int)(Math.random() * 10000);
}

Fixed version (ground truth):
public HUDObject2D(){
  listeners=new ConcurrentLinkedQueue();
  eventQueue=new ConcurrentLinkedQueue();
  bounds=new Rectangle2D.Double();
  id=new Random().nextInt(10000);
}
Program: 45825
Project: 45825
Buggy source:
public void attachView(HUDView2D view){
  logger.fine("String_Node_Str" + view + "String_Node_Str"+ this);
  Entity e=view.getEntity();
  RenderComponent rcFrame=(RenderComponent)e.getComponent(RenderComponent.class);
  GeometryNode node=this.getGeometryNode();
  rcFrame.setAttachPoint(this.getGeometryNode());
}

Fixed version (ground truth):
public void attachView(HUDView2D view){
  logger.fine("String_Node_Str" + view + "String_Node_Str"+ this);
  Entity e=view.getEntity();
  RenderComponent rcFrame=(RenderComponent)e.getComponent(RenderComponent.class);
  rcFrame.setAttachPoint(this.getGeometryNode());
}
Program: 45826
Project: 45826
Buggy source:
public void run(){
  ReconnectFrame rf=new ReconnectFrame(JmeClientMain.this,mgr);
  rf.pack();
  rf.setLocationRelativeTo(JmeClientMain.getFrame().getFrame());
  rf.setVisible(true);
}

Fixed version (ground truth):
public void run(){
  ReconnectDialog rf=new ReconnectDialog(JmeClientMain.this,mgr);
  rf.setVisible(true);
}
Program: 45827
Project: 45827
Buggy source:
public void sessionStatusChanged(WonderlandSession session,Status status){
  if (status == Status.DISCONNECTED) {
    ServerSessionManager serverSessionManager=session.getSessionManager();
    ClientContextJME.removeAllPhysicsSystems(serverSessionManager);
    ClientContextJME.removeAllCollisionSystems(serverSessionManager);
    boolean inLogout;
synchronized (JmeClientMain.this) {
      inLogout=loggingOut;
    }
    if (!inLogout) {
      final ServerSessionManager mgr=curSession.getSessionManager();
      LOGGER.warning("String_Node_Str");
      logout();
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          ReconnectFrame rf=new ReconnectFrame(JmeClientMain.this,mgr);
          rf.pack();
          rf.setLocationRelativeTo(JmeClientMain.getFrame().getFrame());
          rf.setVisible(true);
        }
      }
);
    }
 else {
synchronized (JmeClientMain.this) {
        loggingOut=false;
      }
    }
  }
}

Fixed version (ground truth):
public void sessionStatusChanged(WonderlandSession session,Status status){
  if (status == Status.DISCONNECTED) {
    ServerSessionManager serverSessionManager=session.getSessionManager();
    ClientContextJME.removeAllPhysicsSystems(serverSessionManager);
    ClientContextJME.removeAllCollisionSystems(serverSessionManager);
    boolean inLogout;
synchronized (JmeClientMain.this) {
      inLogout=loggingOut;
    }
    if (!inLogout) {
      final ServerSessionManager mgr=curSession.getSessionManager();
      LOGGER.warning("String_Node_Str");
      logout();
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          ReconnectDialog rf=new ReconnectDialog(JmeClientMain.this,mgr);
          rf.setVisible(true);
        }
      }
);
    }
 else {
synchronized (JmeClientMain.this) {
        loggingOut=false;
      }
    }
  }
}
Program: 45831
Project: 45831
Buggy source:
public View2D createView(Window2D window){
  if (window instanceof WindowSwingHeader)   return null;
  HUDComponent component=mainHUD.createComponent(window);
  component.setPreferredLocation(Layout.CENTER);
  hudComponents.add(component);
  component.addEventListener(new HUDEventListener(){
    public void HUDObjectChanged(    HUDEvent e){
      if (e.getEventType().equals(HUDEvent.HUDEventType.CLOSED)) {
        app.setShowInHUD(false);
      }
    }
  }
);
  mainHUD.addComponent(component);
  component.setVisible(true);
  return null;
}

Fixed version (ground truth):
public View2D createView(Window2D window){
  if (window instanceof WindowSwingHeader)   return null;
  HUDComponent component=mainHUD.createComponent(window);
  component.setName(app.getName());
  component.setPreferredLocation(Layout.CENTER);
  hudComponents.add(component);
  component.addEventListener(new HUDEventListener(){
    public void HUDObjectChanged(    HUDEvent e){
      if (e.getEventType().equals(HUDEvent.HUDEventType.CLOSED)) {
        app.setShowInHUD(false);
      }
    }
  }
);
  mainHUD.addComponent(component);
  component.setVisible(true);
  return null;
}
Program: 45833
Project: 45833
Buggy source:
public void primaryViewCellChanged(ViewCell oldViewCell,ViewCell newViewCell){
  logger.fine("String_Node_Str" + this + "String_Node_Str"+ oldViewCell+ "String_Node_Str"+ newViewCell);
  if (curViewCell != null) {
    curViewCell.removeTransformChangeListener(this);
  }
  curViewCell=newViewCell;
  curViewCell.addTransformChangeListener(this);
}

Fixed version (ground truth):
public void primaryViewCellChanged(ViewCell oldViewCell,ViewCell newViewCell){
  logger.fine("String_Node_Str" + this + "String_Node_Str"+ oldViewCell+ "String_Node_Str"+ newViewCell);
  if (curViewCell != null) {
    curViewCell.removeTransformChangeListener(this);
  }
  curViewCell=newViewCell;
  if (curViewCell != null)   curViewCell.addTransformChangeListener(this);
}
Program: 45834
Project: 45834
Buggy source:
/** 
 * Creates new form AddComponentDialog 
 */
public AddComponentDialog(CellPropertiesJFrame editframe,boolean modal,Cell cell){
  super(editframe,modal);
  this.cell=cell;
  this.editframe=editframe;
  initComponents();
  componentsTable=createTable();
  capabilityScrollPane.setViewportView(componentsTable);
  ListSelectionModel selectionModel=componentsTable.getSelectionModel();
  selectionModel.addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent e){
      boolean isEnabled=componentsTable.getSelectedRow() != -1;
      okButton.setEnabled(isEnabled);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates new form AddComponentDialog 
 */
public AddComponentDialog(CellPropertiesJFrame editframe,boolean modal,Cell cell){
  super(editframe,modal);
  this.editframe=editframe;
  initComponents();
  componentsTable=createTable();
  capabilityScrollPane.setViewportView(componentsTable);
  ListSelectionModel selectionModel=componentsTable.getSelectionModel();
  selectionModel.addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent e){
      boolean isEnabled=componentsTable.getSelectedRow() != -1;
      okButton.setEnabled(isEnabled);
    }
  }
);
}
Program: 45835
Project: 45835
Buggy source:
/** 
 * Creates the table based upon the list of registered components
 */
private JTable createTable(){
  CellComponentRegistry registry=CellComponentRegistry.getCellComponentRegistry();
  Set<CellComponentFactorySPI> factories=registry.getAllCellFactories();
  CellServerState state=editframe.getCellServerState();
  Iterator<CellComponentFactorySPI> it=factories.iterator();
  while (it.hasNext()) {
    CellComponentFactorySPI spi=it.next();
    Class clazz=spi.getDefaultCellComponentServerState().getClass();
    if (state.getComponentServerState(clazz) != null) {
      it.remove();
    }
  }
  List<CellComponentFactorySPI> factoryList=new LinkedList<CellComponentFactorySPI>(factories);
  Comparator nameComparator=new Comparator<CellComponentFactorySPI>(){
    public int compare(    CellComponentFactorySPI o1,    CellComponentFactorySPI o2){
      return o1.getDisplayName().compareTo(o2.getDisplayName());
    }
  }
;
  Collections.sort(factoryList,nameComparator);
  int size=factoryList.size();
  Object[][] entries=new Object[size][2];
  int i=0;
  for (  CellComponentFactorySPI factory : factoryList) {
    entries[i][0]=factory.getDisplayName();
    entries[i][1]=factory.getDescription();
    factoryMap.put(factory.getDisplayName(),factory);
    i++;
  }
  Object[] names=new Object[]{BUNDLE.getString("String_Node_Str"),BUNDLE.getString("String_Node_Str")};
  JTable table=new JTable(entries,names);
  table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  return table;
}

Fixed version (ground truth):
/** 
 * Creates the table based upon the list of registered components
 */
private JTable createTable(){
  CellComponentRegistry registry=CellComponentRegistry.getCellComponentRegistry();
  Set<CellComponentFactorySPI> factories=registry.getAllCellFactories();
  CellServerState state=editframe.getCellServerState();
  Iterator<CellComponentFactorySPI> it=factories.iterator();
  while (it.hasNext() == true) {
    CellComponentFactorySPI spi=it.next();
    Class clazz=spi.getDefaultCellComponentServerState().getClass();
    if (state.getComponentServerState(clazz) != null) {
      it.remove();
    }
  }
  List<CellComponentFactorySPI> factoryList=new LinkedList(factories);
  Comparator nameComparator=new Comparator<CellComponentFactorySPI>(){
    public int compare(    CellComponentFactorySPI o1,    CellComponentFactorySPI o2){
      return o1.getDisplayName().compareTo(o2.getDisplayName());
    }
  }
;
  Collections.sort(factoryList,nameComparator);
  int size=factoryList.size();
  Object[][] entries=new Object[size][2];
  int i=0;
  for (  CellComponentFactorySPI factory : factoryList) {
    entries[i][0]=factory.getDisplayName();
    entries[i][1]=factory.getDescription();
    factoryMap.put(factory.getDisplayName(),factory);
    i++;
  }
  Object[] names=new Object[]{BUNDLE.getString("String_Node_Str"),BUNDLE.getString("String_Node_Str")};
  JTable table=new JTable(entries,names);
  table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  return table;
}
Program: 45836
Project: 45836
Buggy source:
private void checkDirty(){
  String name=cellNameTextField.getText();
  if ((editor != null) && !name.equals(originalCellName)) {
    editor.setPanelDirty(BasicJPanel.class,true);
  }
 else   if (editor != null) {
    editor.setPanelDirty(BasicJPanel.class,false);
  }
}

Fixed version (ground truth):
private void checkDirty(){
  String name=cellNameTextField.getText();
  if (editor != null && name.equals(originalCellName) == false) {
    editor.setPanelDirty(BasicJPanel.class,true);
  }
 else   if (editor != null) {
    editor.setPanelDirty(BasicJPanel.class,false);
  }
}