nus-yam/ex-repair huggingface dataset:
Program: 45646
Project: 45646
Buggy source:
private void updateLabel(){
  removeLabel();
  if (labelHidden) {
    return;
  }
  if (name.equals(usernameAlias) == false) {
    font=ALIAS_NAME_FONT;
  }
 else {
    font=REAL_NAME_FONT;
  }
  if (inConeOfSilence) {
    foregroundColor=CONE_OF_SILENCE_COLOR;
  }
 else {
    if (isSpeaking) {
      foregroundColor=SPEAKING_COLOR;
    }
 else {
      foregroundColor=NOT_SPEAKING_COLOR;
    }
  }
  final String displayName=getDisplayName(usernameAlias,isSpeaking,isMuted);
  SceneWorker.addWorker(new WorkCommit(){
    public void commit(){
      if (visible) {
        if (label == null) {
          label=new TextLabel2D(displayName,foregroundColor,backgroundColor,height,true,font);
          label.setLocalTranslation(0,heightAbove,0);
          Matrix3f rot=new Matrix3f();
          rot.fromAngleAxis((float)Math.PI,new Vector3f(0f,1f,0f));
          label.setLocalRotation(rot);
          attachChild(label);
        }
 else {
          label.setText(displayName,foregroundColor,backgroundColor);
        }
        ClientContextJME.getWorldManager().addToUpdateList(NameTagNode.this);
      }
    }
  }
);
}

Fixed version (ground truth):
private void updateLabel(){
  if (name == null)   return;
  if (labelHidden) {
    removeLabel();
    return;
  }
  if (name.equals(usernameAlias) == false) {
    font=ALIAS_NAME_FONT;
  }
 else {
    font=REAL_NAME_FONT;
  }
  if (inConeOfSilence) {
    foregroundColor=CONE_OF_SILENCE_COLOR;
  }
 else {
    if (isSpeaking) {
      foregroundColor=SPEAKING_COLOR;
    }
 else {
      foregroundColor=NOT_SPEAKING_COLOR;
    }
  }
  final String displayName=getDisplayName(usernameAlias,isSpeaking,isMuted);
  SceneWorker.addWorker(new WorkCommit(){
    public void commit(){
      if (visible) {
        if (label == null) {
          label=new TextLabel2D(displayName,foregroundColor,backgroundColor,height,true,font);
          label.setLocalTranslation(0,heightAbove,0);
          Matrix3f rot=new Matrix3f();
          rot.fromAngleAxis((float)Math.PI,new Vector3f(0f,1f,0f));
          label.setLocalRotation(rot);
          attachChild(label);
        }
 else {
          label.setFont(font);
          label.setText(displayName,foregroundColor,backgroundColor);
        }
        ClientContextJME.getWorldManager().addToUpdateList(NameTagNode.this);
      }
    }
  }
);
}
Program: 45647
Project: 45647
Buggy source:
public void commit(){
  if (visible) {
    if (label == null) {
      label=new TextLabel2D(displayName,foregroundColor,backgroundColor,height,true,font);
      label.setLocalTranslation(0,heightAbove,0);
      Matrix3f rot=new Matrix3f();
      rot.fromAngleAxis((float)Math.PI,new Vector3f(0f,1f,0f));
      label.setLocalRotation(rot);
      attachChild(label);
    }
 else {
      label.setText(displayName,foregroundColor,backgroundColor);
    }
    ClientContextJME.getWorldManager().addToUpdateList(NameTagNode.this);
  }
}

Fixed version (ground truth):
public void commit(){
  if (visible) {
    if (label == null) {
      label=new TextLabel2D(displayName,foregroundColor,backgroundColor,height,true,font);
      label.setLocalTranslation(0,heightAbove,0);
      Matrix3f rot=new Matrix3f();
      rot.fromAngleAxis((float)Math.PI,new Vector3f(0f,1f,0f));
      label.setLocalRotation(rot);
      attachChild(label);
    }
 else {
      label.setFont(font);
      label.setText(displayName,foregroundColor,backgroundColor);
    }
    ClientContextJME.getWorldManager().addToUpdateList(NameTagNode.this);
  }
}
Program: 45648
Project: 45648
Buggy source:
public void setNameTag(EventType eventType,String username,String alias){
  logger.fine("String_Node_Str" + eventType + "String_Node_Str"+ username+ "String_Node_Str"+ alias);
switch (eventType) {
case HIDE:
    labelHidden=true;
  break;
case SMALL_FONT:
labelHidden=false;
height=SMALL_SIZE;
break;
case REGULAR_FONT:
labelHidden=false;
height=REGULAR_SIZE;
break;
case LARGE_FONT:
labelHidden=false;
height=LARGE_SIZE;
break;
case ENTERED_CONE_OF_SILENCE:
inConeOfSilence=true;
break;
case EXITED_CONE_OF_SILENCE:
inConeOfSilence=false;
break;
case STARTED_SPEAKING:
isSpeaking=true;
break;
case STOPPED_SPEAKING:
isSpeaking=false;
break;
case MUTE:
isMuted=true;
isSpeaking=false;
removeLabel();
break;
case UNMUTE:
isMuted=false;
break;
case CHANGE_NAME:
removeLabel();
usernameAlias=alias;
break;
default :
logger.warning("String_Node_Str" + eventType);
break;
}
updateLabel();
}

Fixed version (ground truth):
public void setNameTag(EventType eventType,String username,String alias){
  logger.severe("String_Node_Str" + eventType + "String_Node_Str"+ username+ "String_Node_Str"+ alias);
switch (eventType) {
case HIDE:
    labelHidden=true;
  break;
case SMALL_FONT:
labelHidden=false;
height=SMALL_SIZE;
break;
case REGULAR_FONT:
labelHidden=false;
height=REGULAR_SIZE;
break;
case LARGE_FONT:
labelHidden=false;
height=LARGE_SIZE;
break;
case ENTERED_CONE_OF_SILENCE:
inConeOfSilence=true;
break;
case EXITED_CONE_OF_SILENCE:
inConeOfSilence=false;
break;
case STARTED_SPEAKING:
isSpeaking=true;
break;
case STOPPED_SPEAKING:
isSpeaking=false;
break;
case MUTE:
isMuted=true;
isSpeaking=false;
break;
case UNMUTE:
isMuted=false;
break;
case CHANGE_NAME:
usernameAlias=alias;
break;
default :
logger.warning("String_Node_Str" + eventType);
break;
}
updateLabel();
}
Program: 45649
Project: 45649
Buggy source:
public NameTagNode(String name,float heightAbove){
  this.name=name;
  this.heightAbove=heightAbove;
  visible=true;
  usernameAlias=name;
  setNameTag(EventType.REGULAR_FONT,name,usernameAlias);
}

Fixed version (ground truth):
public NameTagNode(String name,float heightAbove){
  this.name=name;
  this.usernameAlias=name;
  this.heightAbove=heightAbove;
  visible=true;
  setNameTag(EventType.REGULAR_FONT,name,usernameAlias);
}
Program: 45650
Project: 45650
Buggy source:
public void initialize(){
  CellManagerMO.getCellManager().registerAvatarCellComponent(AvatarConfigComponentMO.class);
}

Fixed version (ground truth):
public void initialize(){
  CellManagerMO.getCellManager().registerAvatarCellComponent(AvatarConfigComponentMO.class);
  CellManagerMO.getCellManager().registerAvatarCellComponent(NameTagComponentMO.class);
}
Program: 45651
Project: 45651
Buggy source:
private Quad getQuad(){
  Vector2f scales=new Vector2f();
  BufferedImage img=getImage(scales);
  float w=img.getWidth();
  float h=img.getHeight();
  float factor=height / h;
  Quad ret=new Quad("String_Node_Str",w * factor,h * factor);
  TextureState ts=DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
  Texture tex=TextureManager.loadTexture(img,MinificationFilter.BilinearNoMipMaps,MagnificationFilter.Bilinear,true);
  ts.setTexture(tex);
  ts.setEnabled(true);
  ret.setRenderState(ts);
  ret.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
  BlendState as=DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
  as.setBlendEnabled(true);
  as.setTestEnabled(true);
  as.setTestFunction(TestFunction.GreaterThan);
  as.setEnabled(true);
  ret.setRenderState(as);
  ret.setLightCombineMode(LightCombineMode.Off);
  ret.updateRenderState();
  this.quad=ret;
  return ret;
}

Fixed version (ground truth):
private Quad getQuad(){
  Vector2f scales=new Vector2f();
  BufferedImage img=getImage(scales);
  float w=img.getWidth();
  float h=img.getHeight();
  float factor=height / h;
  Quad ret;
  if (imgWidth == w && imgHeight == h) {
    ret=quad;
    TextureState texState=(TextureState)quad.getRenderState(StateType.Texture);
    Texture oldtex=texState.getTexture();
    TextureManager.releaseTexture(oldtex);
    Texture tex=TextureManager.loadTexture(img,MinificationFilter.BilinearNoMipMaps,MagnificationFilter.Bilinear,true);
    texState.setTexture(tex);
  }
 else {
    ret=new Quad("String_Node_Str",w * factor,h * factor);
    TextureState ts=DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
    Texture tex=TextureManager.loadTexture(img,MinificationFilter.BilinearNoMipMaps,MagnificationFilter.Bilinear,true);
    ts.setTexture(tex);
    ts.setEnabled(true);
    ret.setRenderState(ts);
    BlendState as=DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
    as.setBlendEnabled(false);
    as.setReference(0.5f);
    as.setTestFunction(BlendState.TestFunction.GreaterThan);
    as.setTestEnabled(true);
    ret.setRenderState(as);
    ret.setLightCombineMode(LightCombineMode.Off);
    ret.updateRenderState();
    this.quad=ret;
    imgWidth=w;
    imgHeight=h;
  }
  return ret;
}
Program: 45652
Project: 45652
Buggy source:
public void setFont(Font font){
  this.font=font;
  BufferedImage tmp0=new BufferedImage(10,10,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g2d=(Graphics2D)tmp0.getGraphics();
  drawFont=font.deriveFont(fontResolution);
  fontRenderContext=g2d.getFontRenderContext();
}

Fixed version (ground truth):
public void setFont(Font font){
  if (this.font == font)   return;
  this.font=font;
  BufferedImage tmp0=new BufferedImage(10,10,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g2d=(Graphics2D)tmp0.getGraphics();
  drawFont=font.deriveFont(fontResolution);
  fontRenderContext=g2d.getFontRenderContext();
}
Program: 45653
Project: 45653
Buggy source:
public void setText(String text,Color foreground,Color background){
  this.text=text;
  this.foreground=foreground;
  this.background=background;
  Node tmpParent=quad.getParent();
  quad.removeFromParent();
  TextureState texState=(TextureState)quad.getRenderState(StateType.Texture);
  Texture tex=texState.getTexture();
  TextureManager.releaseTexture(tex);
  tmpParent.attachChild(getQuad());
}

Fixed version (ground truth):
public void setText(String text,Color foreground,Color background){
  this.text=text;
  this.foreground=foreground;
  this.background=background;
  Quad oldQuad=quad;
  Quad updatedQuad=getQuad();
  if (updatedQuad != oldQuad) {
    Node tmpParent=oldQuad.getParent();
    oldQuad.removeFromParent();
    TextureState texState=(TextureState)oldQuad.getRenderState(StateType.Texture);
    Texture tex=texState.getTexture();
    TextureManager.releaseTexture(tex);
    tmpParent.attachChild(updatedQuad);
  }
}
Program: 45654
Project: 45654
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);
      }
      if (menuListener == null) {
        menuListener=new ContextMenuListener(){
          public void contextMenuDisplayed(          ContextMenuEvent event){
            windowMenuDisplayed(event,contextMenuComp);
          }
        }
;
        ContextMenuManager cmm=ContextMenuManager.getContextMenuManager();
        cmm.addContextMenuListener(menuListener);
      }
    }
 else {
      if (app != null) {
        ControlArb controlArb=app.getControlArb();
        if (controlArb != null) {
          if (controlArb.hasControl()) {
            controlArb.releaseControl();
          }
        }
      }
    }
  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;
}
}

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(          ContextMenuEvent event){
            windowMenuDisplayed(event,contextMenuComp);
          }
        }
;
        ContextMenuManager cmm=ContextMenuManager.getContextMenuManager();
        cmm.addContextMenuListener(menuListener);
      }
    }
 else {
      if (app != null) {
        ControlArb controlArb=app.getControlArb();
        if (controlArb != null) {
          if (controlArb.hasControl()) {
            controlArb.releaseControl();
          }
        }
      }
    }
  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;
  }
  destroy();
}
break;
}
}
Program: 45655
Project: 45655
Buggy source:
/** 
 * Deallocate resources.
 */
public void cleanup(){
synchronized (appCleanupLock) {
    setShowInHUD(false);
    viewSet.cleanup();
    if (controlArb != null) {
      controlArb.cleanup();
      controlArb=null;
    }
    stack.cleanup();
    LinkedList<Window2D> toRemoveList=(LinkedList<Window2D>)windows.clone();
    for (    Window2D window : toRemoveList) {
      window.cleanup();
    }
    windows.clear();
    toRemoveList.clear();
    pixelScale=null;
  }
}

Fixed version (ground truth):
/** 
 * Deallocate resources.
 */
public void cleanup(){
synchronized (appCleanupLock) {
    setShowInHUD(false);
    viewSet.cleanup();
    if (controlArb != null) {
      controlArb.cleanup();
      controlArb=null;
    }
    stack.cleanup();
    LinkedList<Window2D> toRemoveList=(LinkedList<Window2D>)windows.clone();
    for (    Window2D window : toRemoveList) {
      window.cleanup();
    }
    windows.clear();
    toRemoveList.clear();
    pixelScale=null;
  }
synchronized (apps) {
    apps.remove(this);
  }
}
Program: 45656
Project: 45656
Buggy source:
/** 
 * Executed by the JVM shutdown process. 
 */
private static void shutdown(){
  logger.warning("String_Node_Str");
  isAppBaseRunning=false;
  LinkedList<App2D> appsCopy=(LinkedList<App2D>)apps.clone();
  for (  App2D app : appsCopy) {
    logger.warning("String_Node_Str" + app);
    app.cleanup();
  }
  logger.warning("String_Node_Str");
  apps.clear();
  logger.warning("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Executed by the JVM shutdown process. 
 */
private static void shutdown(){
  logger.info("String_Node_Str");
  isAppBaseRunning=false;
  LinkedList<App2D> appsCopy=(LinkedList<App2D>)apps.clone();
  for (  App2D app : appsCopy) {
    logger.info("String_Node_Str" + app);
    app.cleanup();
  }
  logger.info("String_Node_Str");
  apps.clear();
  logger.info("String_Node_Str");
}
Program: 45657
Project: 45657
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void cleanup(){
  controller=null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void cleanup(){
  super.cleanup();
  controller=null;
}
Program: 45658
Project: 45658
Buggy source:
private void receive(CellMessage message){
  if (message instanceof AudioTreatmentDoneMessage) {
    addMenuItems(new String[]{"String_Node_Str","String_Node_Str"});
    channelComp.send(new AudioTreatmentRequestMessage(cell.getCellID(),true,true));
    return;
  }
  if (message instanceof AudioTreatmentMenuChangeMessage) {
    addMenuItems(((AudioTreatmentMenuChangeMessage)message).getMenuItems());
    return;
  }
  if (message instanceof AudioVolumeMessage) {
    logger.fine("String_Node_Str" + ((AudioVolumeMessage)message).getVolume());
    new VolumeControlJFrame(cell.getCellID(),this,"String_Node_Str",CallID.getCallID(cell.getCellID()),VolumeUtil.getClientVolume(((AudioVolumeMessage)message).getVolume()));
    return;
  }
}

Fixed version (ground truth):
private void receive(CellMessage message){
  if (message instanceof AudioTreatmentDoneMessage) {
    addMenuItems(new String[]{"String_Node_Str","String_Node_Str"});
    channelComp.send(new AudioTreatmentRequestMessage(cell.getCellID(),true,true));
    return;
  }
  if (message instanceof AudioTreatmentEndedMessage) {
    AudioTreatmentEndedMessage msg=(AudioTreatmentEndedMessage)message;
    logger.warning("String_Node_Str" + msg.getReason());
    notifyTreatmentEnded(msg.getReason());
    return;
  }
  if (message instanceof AudioTreatmentEstablishedMessage) {
    logger.warning("String_Node_Str");
    notifyTreatmentEstablished();
    return;
  }
  if (message instanceof AudioTreatmentMenuChangeMessage) {
    addMenuItems(((AudioTreatmentMenuChangeMessage)message).getMenuItems());
    return;
  }
  if (message instanceof AudioVolumeMessage) {
    logger.fine("String_Node_Str" + ((AudioVolumeMessage)message).getVolume());
    new VolumeControlJFrame(cell.getCellID(),this,"String_Node_Str",CallID.getCallID(cell.getCellID()),VolumeUtil.getClientVolume(((AudioVolumeMessage)message).getVolume()));
    return;
  }
}
Program: 45660
Project: 45660
Buggy source:
/** 
 * Given a component factory, adds the component to the server and upates the GUI to indicate its presence
 */
private void addComponent(CellComponentFactorySPI spi){
  CellComponentServerState state=spi.getDefaultCellComponentServerState();
  CellID cellID=selectedCell.getCellID();
  CellServerComponentMessage message=CellServerComponentMessage.newAddMessage(cellID,state);
  ResponseMessage response=selectedCell.sendCellMessageAndWait(message);
  if (response == null) {
    LOGGER.warning("String_Node_Str" + selectedCell.getCellID() + "String_Node_Str"+ selectedCell.getName()+ "String_Node_Str");
    return;
  }
  if (response instanceof CellServerComponentResponseMessage) {
    CellServerComponentResponseMessage cscrm=(CellServerComponentResponseMessage)response;
    addComponentToPanelSet(cscrm.getCellComponentServerState());
  }
 else   if (response instanceof ErrorMessage) {
    LOGGER.log(Level.WARNING,"String_Node_Str",((ErrorMessage)response).getErrorCause());
  }
}

Fixed version (ground truth):
/** 
 * Given a component factory, adds the component to the server and upates the GUI to indicate its presence
 */
private void addComponent(CellComponentFactorySPI spi){
  CellComponentServerState state=spi.getDefaultCellComponentServerState();
  CellID cellID=selectedCell.getCellID();
  CellServerComponentMessage message=CellServerComponentMessage.newAddMessage(cellID,state);
  ResponseMessage response=selectedCell.sendCellMessageAndWait(message);
  if (response == null) {
    LOGGER.warning("String_Node_Str" + selectedCell.getCellID() + "String_Node_Str"+ selectedCell.getName()+ "String_Node_Str");
    return;
  }
  if (response instanceof CellServerComponentResponseMessage) {
    setSelectedCell(selectedCell);
  }
 else   if (response instanceof ErrorMessage) {
    LOGGER.log(Level.WARNING,"String_Node_Str",((ErrorMessage)response).getErrorCause());
  }
}
Program: 45661
Project: 45661
Buggy source:
/** 
 * Given the component properties SPI, removes the component from the server and updates the GUI to indicate its absense
 */
private void removeComponent(PropertiesFactorySPI factory){
  Class clazz=PropertiesManager.getServerStateClass(factory);
  if (clazz == null) {
    LOGGER.warning("String_Node_Str" + factory);
    return;
  }
  CellComponentRegistry r=CellComponentRegistry.getCellComponentRegistry();
  CellComponentFactorySPI spi=r.getCellFactoryByStateClass(clazz);
  if (spi == null) {
    LOGGER.warning("String_Node_Str" + clazz.getName());
    return;
  }
  CellComponentServerState s=spi.getDefaultCellComponentServerState();
  String className=s.getServerComponentClassName();
  CellID cellID=selectedCell.getCellID();
  CellServerComponentMessage cscm=CellServerComponentMessage.newRemoveMessage(cellID,className);
  ResponseMessage response=selectedCell.sendCellMessageAndWait(cscm);
  if (response == null) {
    LOGGER.warning("String_Node_Str" + cellID + "String_Node_Str"+ selectedCell.getName()+ "String_Node_Str");
    return;
  }
  if (response instanceof OKMessage) {
    listModel.removeElement(factory.getDisplayName());
    capabilityList.setSelectedIndex(-1);
    factoryList.remove(factory);
  }
 else   if (response instanceof ErrorMessage) {
    LOGGER.log(Level.WARNING,"String_Node_Str",((ErrorMessage)response).getErrorCause());
  }
}

Fixed version (ground truth):
/** 
 * Given the component properties SPI, removes the component from the server and updates the GUI to indicate its absense
 */
private void removeComponent(PropertiesFactorySPI factory){
  Class clazz=PropertiesManager.getServerStateClass(factory);
  if (clazz == null) {
    LOGGER.warning("String_Node_Str" + factory);
    return;
  }
  CellComponentRegistry r=CellComponentRegistry.getCellComponentRegistry();
  CellComponentFactorySPI spi=r.getCellFactoryByStateClass(clazz);
  if (spi == null) {
    LOGGER.warning("String_Node_Str" + clazz.getName());
    return;
  }
  CellComponentServerState s=spi.getDefaultCellComponentServerState();
  String className=s.getServerComponentClassName();
  CellID cellID=selectedCell.getCellID();
  CellServerComponentMessage cscm=CellServerComponentMessage.newRemoveMessage(cellID,className);
  ResponseMessage response=selectedCell.sendCellMessageAndWait(cscm);
  if (response == null) {
    LOGGER.warning("String_Node_Str" + cellID + "String_Node_Str"+ selectedCell.getName()+ "String_Node_Str");
    return;
  }
  if (response instanceof OKMessage) {
    setSelectedCell(selectedCell);
  }
 else   if (response instanceof ErrorMessage) {
    LOGGER.log(Level.WARNING,"String_Node_Str",((ErrorMessage)response).getErrorCause());
  }
}
Program: 45662
Project: 45662
Buggy source:
/** 
 * Removes the given listener for context menu display events. If the listener does not exist, then this method does nothing.
 * @param listener The listener to remove
 */
public void removeContextMenuListener(ContextMenuListener listener){
synchronized (listeners) {
    listeners.remove(listeners);
  }
}

Fixed version (ground truth):
/** 
 * Removes the given listener for context menu display events. If the listener does not exist, then this method does nothing.
 * @param listener The listener to remove
 */
public void removeContextMenuListener(ContextMenuListener listener){
synchronized (listeners) {
    listeners.remove(listener);
  }
}
Program: 45663
Project: 45663
Buggy source:
private void applyChanges(){
  if (myNameTagAttribute != originalMyNameTagAttribute) {
    originalMyNameTagAttribute=myNameTagAttribute;
switch (myNameTagAttribute) {
case HIDE:
      NameTagNode.setMyNameTag(EventType.HIDE,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
    break;
case SMALL_FONT:
  NameTagNode.setMyNameTag(EventType.SMALL_FONT,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
break;
case REGULAR_FONT:
NameTagNode.setMyNameTag(EventType.REGULAR_FONT,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
break;
case LARGE_FONT:
NameTagNode.setMyNameTag(EventType.LARGE_FONT,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
break;
}
}
if (otherNameTagAttributes == originalOtherNameTagAttributes) {
return;
}
originalOtherNameTagAttributes=otherNameTagAttributes;
switch (otherNameTagAttributes) {
case HIDE:
NameTagNode.setOtherNameTags(EventType.HIDE,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
OrbCell.makeOrbsVisible(false);
break;
case SMALL_FONT:
NameTagNode.setOtherNameTags(EventType.SMALL_FONT,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
OrbCell.makeOrbsVisible(true);
break;
case REGULAR_FONT:
NameTagNode.setOtherNameTags(EventType.REGULAR_FONT,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
OrbCell.makeOrbsVisible(true);
break;
case LARGE_FONT:
NameTagNode.setOtherNameTags(EventType.LARGE_FONT,presenceInfo.userID.getUsername(),presenceInfo.usernameAlias);
OrbCell.makeOrbsVisible(true);
break;
}
}

Fixed version (ground truth):
private void applyChanges(){
  if (myNameTagAttribute != originalMyNameTagAttribute) {
    originalMyNameTagAttribute=myNameTagAttribute;
switch (myNameTagAttribute) {
case HIDE:
      setMyNameTag(EventType.HIDE);
    break;
case SMALL_FONT:
  setMyNameTag(EventType.SMALL_FONT);
break;
case REGULAR_FONT:
setMyNameTag(EventType.REGULAR_FONT);
break;
case LARGE_FONT:
setMyNameTag(EventType.LARGE_FONT);
break;
}
}
if (otherNameTagAttributes == originalOtherNameTagAttributes) {
return;
}
originalOtherNameTagAttributes=otherNameTagAttributes;
switch (otherNameTagAttributes) {
case HIDE:
setOtherNameTags(EventType.HIDE);
OrbCell.makeOrbsVisible(false);
break;
case SMALL_FONT:
setOtherNameTags(EventType.SMALL_FONT);
OrbCell.makeOrbsVisible(true);
break;
case REGULAR_FONT:
setOtherNameTags(EventType.REGULAR_FONT);
OrbCell.makeOrbsVisible(true);
break;
case LARGE_FONT:
setOtherNameTags(EventType.LARGE_FONT);
OrbCell.makeOrbsVisible(true);
break;
}
}
Program: 45664
Project: 45664
Buggy source:
public NamePropertiesHUDPanel(PresenceInfo presenceInfo){
  this();
  this.presenceInfo=presenceInfo;
}

Fixed version (ground truth):
public NamePropertiesHUDPanel(PresenceManager pm,WonderlandSession session,PresenceInfo presenceInfo){
  this();
  this.pm=pm;
  this.session=session;
  this.presenceInfo=presenceInfo;
}
Program: 45665
Project: 45665
Buggy source:
private void propertiesButtonActionPerformed(java.awt.event.ActionEvent evt){
  if (namePropertiesHUDComponent == null) {
    HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
    NamePropertiesHUDPanel namePropertiesHUDPanel=new NamePropertiesHUDPanel(presenceInfo);
    namePropertiesHUDComponent=mainHUD.createComponent(namePropertiesHUDPanel);
    namePropertiesHUDComponent.setPreferredLocation(Layout.NORTH);
    namePropertiesHUDComponent.setName(BUNDLE.getString("String_Node_Str"));
    namePropertiesHUDComponent.setIcon(new ImageIcon(getClass().getResource("String_Node_Str" + "String_Node_Str")));
    mainHUD.addComponent(namePropertiesHUDComponent);
    PropertyChangeListener plistener=new PropertyChangeListener(){
      public void propertyChange(      PropertyChangeEvent pe){
        String name=pe.getPropertyName();
        if (name.equals("String_Node_Str") || name.equals("String_Node_Str")) {
          namePropertiesHUDComponent.setVisible(false);
        }
      }
    }
;
    namePropertiesHUDPanel.addPropertyChangeListener(plistener);
  }
  namePropertiesHUDComponent.setVisible(true);
}

Fixed version (ground truth):
private void propertiesButtonActionPerformed(java.awt.event.ActionEvent evt){
  if (namePropertiesHUDComponent == null) {
    HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
    NamePropertiesHUDPanel namePropertiesHUDPanel=new NamePropertiesHUDPanel(pm,session,presenceInfo);
    namePropertiesHUDComponent=mainHUD.createComponent(namePropertiesHUDPanel);
    namePropertiesHUDComponent.setPreferredLocation(Layout.NORTH);
    namePropertiesHUDComponent.setName(BUNDLE.getString("String_Node_Str"));
    namePropertiesHUDComponent.setIcon(new ImageIcon(getClass().getResource("String_Node_Str" + "String_Node_Str")));
    mainHUD.addComponent(namePropertiesHUDComponent);
    PropertyChangeListener plistener=new PropertyChangeListener(){
      public void propertyChange(      PropertyChangeEvent pe){
        String name=pe.getPropertyName();
        if (name.equals("String_Node_Str") || name.equals("String_Node_Str")) {
          namePropertiesHUDComponent.setVisible(false);
        }
      }
    }
;
    namePropertiesHUDPanel.addPropertyChangeListener(plistener);
  }
  namePropertiesHUDComponent.setVisible(true);
}
Program: 45667
Project: 45667
Buggy source:
public void run(){
  while (true) {
    String[] names=nameTagList.toArray(new String[0]);
    for (int i=0; i < names.length; i++) {
      String name=names[i];
      NameTagNode nameTag=NameTagNode.getNameTagNode(name);
      if (nameTag == null) {
        continue;
      }
      nameTagList.remove(name);
      PresenceInfo info=pm.getUserPresenceInfo(name);
      if (info == null) {
        logger.info("String_Node_Str" + name);
        continue;
      }
      nameTag.updateLabel(info.usernameAlias,info.inConeOfSilence,info.isSpeaking,info.isMuted);
    }
    if (nameTagList.size() == 0) {
      break;
    }
    try {
      Thread.sleep(200);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    String[] names=nameTagList.toArray(new String[0]);
    for (int i=0; i < names.length; i++) {
      String name=names[i];
      nameTagList.remove(name);
      PresenceInfo info=pm.getUserPresenceInfo(name);
      if (info == null) {
        logger.info("String_Node_Str" + name);
        continue;
      }
      CellCache cellCache=ClientContext.getCellCache(session);
      Cell cell=cellCache.getCell(info.cellID);
      if (cell == null) {
        logger.warning("String_Node_Str" + name);
        continue;
      }
      NameTagComponent comp=new NameTagComponent(cell,name,(float).17);
      NameTagNode nameTag=comp.getNameTagNode();
      nameTag.updateLabel(info.usernameAlias,info.inConeOfSilence,info.isSpeaking,info.isMuted);
    }
    if (nameTagList.size() == 0) {
      break;
    }
    try {
      Thread.sleep(200);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 45668
Project: 45668
Buggy source:
public void done(){
  if (done) {
    return;
  }
  done=true;
  nameTagMap.remove(name);
  detachChild(q);
}

Fixed version (ground truth):
public void done(){
  if (done) {
    return;
  }
  done=true;
  detachChild(q);
}
Program: 45669
Project: 45669
Buggy source:
public NameTagNode(String name,float heightAbove){
  this.name=name;
  this.heightAbove=heightAbove;
  visible=true;
  nameTagMap.put(name,this);
  usernameAlias=name;
  setNameTag(EventType.REGULAR_FONT,name,usernameAlias);
}

Fixed version (ground truth):
public NameTagNode(String name,float heightAbove){
  this.name=name;
  this.heightAbove=heightAbove;
  visible=true;
  usernameAlias=name;
  setNameTag(EventType.REGULAR_FONT,name,usernameAlias);
}
Program: 45670
Project: 45670
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void cleanup(){
  if (eventHook != null) {
    eventHook=null;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void cleanup(){
  super.cleanup();
  if (eventHook != null) {
    eventHook=null;
  }
}
Program: 45671
Project: 45671
Buggy source:
@Override public void cleanup(){
  cleanupViews();
  super.cleanup();
}

Fixed version (ground truth):
@Override public void cleanup(){
  cleanupViews();
  super.cleanup();
  embeddedPeer.dispose();
}
Program: 45672
Project: 45672
Buggy source:
/** 
 * {@inheritDoc}
 */
public void removeComponent(HUDComponent component){
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("String_Node_Str" + component);
  }
  HUDComponentState state=(HUDComponentState)hudStateMap.get(component);
  if (state != null) {
    Window2D window=state.getWindow();
    HUDView2D view2D=state.getView();
    if ((window != null) && (view2D != null)) {
      hudViewMap.remove(view2D);
      window.removeView(view2D);
      view2D.cleanup();
      view2D=null;
    }
    HUDView3D view3D=state.getWorldView();
    if (view3D != null) {
      view3D.cleanup();
      view3D=null;
    }
    hudStateMap.remove(component);
    state=null;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void removeComponent(HUDComponent component){
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("String_Node_Str" + component);
  }
  HUDComponentState state=(HUDComponentState)hudStateMap.get(component);
  if (state != null) {
    Window2D window=state.getWindow();
    HUDView2D view2D=state.getView();
    if (window != null) {
      if (view2D != null) {
        hudViewMap.remove(view2D);
        window.removeView(view2D);
        view2D.cleanup();
        view2D=null;
      }
      window.cleanup();
    }
    HUDView3D view3D=state.getWorldView();
    if (view3D != null) {
      view3D.cleanup();
      view3D=null;
    }
    hudStateMap.remove(component);
    state=null;
  }
}
Program: 45673
Project: 45673
Buggy source:
private void restoreLater(){
  audioGroupIdTextField.setText(originalGroupId);
switch (treatmentType) {
case FILE:
    fileRadioButton.setSelected(true);
  break;
case CONTENT_REPOSITORY:
contentRepositoryRadioButton.setSelected(true);
break;
case URL:
URLRadioButton.setSelected(true);
break;
}
treatmentTextField.setText(originalTreatments);
volumeSlider.setValue(originalVolume);
switch (originalPlayWhen) {
case ALWAYS:
alwaysRadioButton.setSelected(true);
break;
case FIRST_IN_RANGE:
proximityRadioButton.setSelected(true);
break;
case MANUAL:
manualRadioButton.setSelected(true);
break;
}
playOnceCheckBox.setSelected(originalPlayOnce);
extentRadiusSpinner.setValue(originalExtentRadius);
extentRadiusSpinner.setEnabled(useCellBounds == false);
fullVolumeAreaPercentSpinner.setValue(originalFullVolumeAreaPercent);
falloffSlider.setValue(originalFalloff);
falloffSlider.setEnabled(originalDistanceAttenuated);
BoundingVolume bounds=editor.getCell().getLocalBounds();
if (originalUseCellBounds == true && bounds instanceof BoundingBox) {
distanceAttenuatedRadioButton.setSelected(false);
distanceAttenuatedRadioButton.setEnabled(false);
distanceAttenuated=false;
}
 else {
distanceAttenuatedRadioButton.setSelected(originalDistanceAttenuated);
}
falloffSlider.setEnabled(distanceAttenuatedRadioButton.isSelected());
useCellBoundsRadioButton.setEnabled(true);
useCellBoundsRadioButton.setSelected(originalUseCellBounds);
showBoundsCheckBox.setSelected(originalShowBounds);
showBounds();
}

Fixed version (ground truth):
private void restoreLater(){
  audioGroupIdTextField.setText(originalGroupId);
switch (originalTreatmentType) {
case FILE:
    fileRadioButton.setSelected(true);
  break;
case CONTENT_REPOSITORY:
contentRepositoryRadioButton.setSelected(true);
break;
case URL:
URLRadioButton.setSelected(true);
break;
}
treatmentTextField.setText(originalTreatments);
volumeSlider.setValue(originalVolume);
switch (originalPlayWhen) {
case ALWAYS:
alwaysRadioButton.setSelected(true);
break;
case FIRST_IN_RANGE:
proximityRadioButton.setSelected(true);
break;
case MANUAL:
manualRadioButton.setSelected(true);
break;
}
playOnceCheckBox.setSelected(originalPlayOnce);
extentRadiusSpinner.setValue(originalExtentRadius);
extentRadiusSpinner.setEnabled(useCellBounds == false);
fullVolumeAreaPercentSpinner.setValue(originalFullVolumeAreaPercent);
falloffSlider.setValue(originalFalloff);
falloffSlider.setEnabled(originalDistanceAttenuated);
BoundingVolume bounds=editor.getCell().getLocalBounds();
if (originalUseCellBounds == true && bounds instanceof BoundingBox) {
distanceAttenuatedRadioButton.setSelected(false);
distanceAttenuatedRadioButton.setEnabled(false);
distanceAttenuated=false;
}
 else {
distanceAttenuatedRadioButton.setSelected(originalDistanceAttenuated);
}
falloffSlider.setEnabled(distanceAttenuatedRadioButton.isSelected());
useCellBoundsRadioButton.setEnabled(true);
useCellBoundsRadioButton.setSelected(originalUseCellBounds);
showBoundsCheckBox.setSelected(originalShowBounds);
showBounds();
}
Program: 45675
Project: 45675
Buggy source:
/** 
 * Inform the slaves that the parent of a popup window has changed.
 * @param window The popup window.
 * @param parent The new parent of the popup window.
 */
public void setPopupParent(WindowXrw window,WindowXrw parent){
  int wid=window.getWid();
  int parentWid=parent.getWid();
  ((ServerProxyMaster)serverProxy).setPopupParent(wid,parentWid);
}

Fixed version (ground truth):
/** 
 * Inform the slaves that the parent of a popup window has changed.
 * @param window The popup window.
 * @param parent The new parent of the popup window.
 */
public void setPopupParent(WindowXrw window,WindowXrw parent){
  if (parent == null)   return;
  int wid=window.getWid();
  int parentWid=parent.getWid();
  ((ServerProxyMaster)serverProxy).setPopupParent(wid,parentWid);
}
Program: 45676
Project: 45676
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void relayout(HUDComponent component){
  int hudWidth=hud.getWidth();
  int hudHeight=hud.getHeight();
  HUDComponent2D component2D=(HUDComponent2D)component;
  Vector2f positionPercent=positionMap.get(component2D);
  float compX=hud.getX() + positionPercent.x * hudWidth;
  float compY=hud.getY() + positionPercent.y * hudHeight;
  HUDView2D view=(HUDView2D)hudViewMap.get(component2D);
  float viewWidth=view.getDisplayerLocalWidth();
  float viewHeight=view.getDisplayerLocalHeight();
  if (hud.getX() + hudWidth - (compX + viewWidth) < MIN_RIGHT_MARGIN) {
    compX=hud.getX() + hudWidth - viewWidth - MIN_RIGHT_MARGIN;
  }
  if (compX < hud.getX() + MIN_LEFT_MARGIN) {
    compX=hud.getX() + MIN_LEFT_MARGIN;
  }
  if (compY < hud.getY() + MIN_BOTTOM_MARGIN) {
    compY=hud.getY() + MIN_BOTTOM_MARGIN;
  }
  if (hud.getY() + hudHeight - (compY + viewHeight) < MIN_TOP_MARGIN) {
    compY=hud.getY() + hudHeight - viewHeight - MIN_TOP_MARGIN;
  }
  component2D.setLocation((int)compX,(int)compY);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void relayout(HUDComponent component){
  int hudWidth=hud.getWidth();
  int hudHeight=hud.getHeight();
  HUDComponent2D component2D=(HUDComponent2D)component;
  Vector2f positionPercent=positionMap.get(component2D);
  if (positionPercent == null) {
    logger.warning("String_Node_Str" + component2D);
    return;
  }
  float compX=hud.getX() + positionPercent.x * hudWidth;
  float compY=hud.getY() + positionPercent.y * hudHeight;
  HUDView2D view=(HUDView2D)hudViewMap.get(component2D);
  float viewWidth=view.getDisplayerLocalWidth();
  float viewHeight=view.getDisplayerLocalHeight();
  if (hud.getX() + hudWidth - (compX + viewWidth) < MIN_RIGHT_MARGIN) {
    compX=hud.getX() + hudWidth - viewWidth - MIN_RIGHT_MARGIN;
  }
  if (compX < hud.getX() + MIN_LEFT_MARGIN) {
    compX=hud.getX() + MIN_LEFT_MARGIN;
  }
  if (compY < hud.getY() + MIN_BOTTOM_MARGIN) {
    compY=hud.getY() + MIN_BOTTOM_MARGIN;
  }
  if (hud.getY() + hudHeight - (compY + viewHeight) < MIN_TOP_MARGIN) {
    compY=hud.getY() + hudHeight - viewHeight - MIN_TOP_MARGIN;
  }
  component2D.setLocation((int)compX,(int)compY);
}
Program: 45677
Project: 45677
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean hasControl(){
  boolean control=false;
  if (window != null) {
    App2D app=window.getApp();
    ControlArb arbiter=app.getControlArb();
    if (arbiter != null) {
      control=arbiter.hasControl();
    }
  }
  return control;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean hasControl(){
  boolean control=false;
  if (window != null) {
    App2D app=window.getApp();
    if (app != null) {
      ControlArb arbiter=app.getControlArb();
      if (arbiter != null) {
        control=arbiter.hasControl();
      }
    }
  }
  return control;
}
Program: 45678
Project: 45678
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + cell + "String_Node_Str"+ ((component != null) ? component.getClass().getName() : "String_Node_Str")+ "String_Node_Str"+ window+ "String_Node_Str"+ super.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return getClass().getSimpleName() + "String_Node_Str" + cell+ "String_Node_Str"+ ((component != null) ? component.getClass().getName() : "String_Node_Str")+ "String_Node_Str"+ window+ "String_Node_Str"+ super.toString();
}
Program: 45679
Project: 45679
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);
  rcFrame.setAttachPoint(this.getGeometryNode());
}

Fixed version (ground truth):
public void attachView(HUDView2D view){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str" + view);
    logger.finest("String_Node_Str" + this);
  }
  Entity e=view.getEntity();
  RenderComponent rcFrame=(RenderComponent)e.getComponent(RenderComponent.class);
  rcFrame.setAttachPoint(this.getGeometryNode());
}
Program: 45680
Project: 45680
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void frameUpdate(){
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void frameUpdate(){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str");
  }
}
Program: 45681
Project: 45681
Buggy source:
/** 
 * Create an instance of HUDView2D with a specified geometry node.
 * @param displayer the entity in which the view is displayed.
 * @param window The window displayed in this view.
 * @param geometryNode The geometry node on which to display the view.
 */
public HUDView2D(View2DDisplayer displayer,Window2D window,GeometryNode geometryNode){
  super(window,geometryNode);
  this.displayer=displayer;
  changeMask=CHANGED_ALL;
  update();
  name="String_Node_Str" + window.getName();
}

Fixed version (ground truth):
/** 
 * Create an instance of HUDView2D with a specified geometry node.
 * @param displayer the entity in which the view is displayed.
 * @param window The window displayed in this view.
 * @param geometryNode The geometry node on which to display the view.
 */
public HUDView2D(View2DDisplayer displayer,Window2D window,GeometryNode geometryNode){
  super(window,geometryNode);
  this.displayer=displayer;
  changeMask=CHANGED_ALL;
  name="String_Node_Str" + window.getName();
  update();
}
Program: 45682
Project: 45682
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void detachFrame(){
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void detachFrame(){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str");
  }
  if (frameView != null) {
    frameView.setVisibleUser(false,false);
    frameView.setVisibleApp(false);
    detachView(frameView);
    frameView=null;
  }
}
Program: 45683
Project: 45683
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected boolean hasFrame(){
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected boolean hasFrame(){
  return (frameView != null);
}
Program: 45684
Project: 45684
Buggy source:
public HUDView2D getFrameView(){
  return null;
}

Fixed version (ground truth):
public HUDView2D getFrameView(){
  return frameView;
}
Program: 45685
Project: 45685
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void reattachFrame(){
  logger.fine("String_Node_Str");
  detachFrame();
  attachFrame();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void reattachFrame(){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str");
  }
  detachFrame();
  attachFrame();
}
Program: 45686
Project: 45686
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void frameUpdateTitle(){
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void frameUpdateTitle(){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str");
  }
  if (frame != null) {
    frame.setTitle(getTitle());
  }
}
Program: 45687
Project: 45687
Buggy source:
@Override public String toString(){
  String string="String_Node_Str" + getName() + "String_Node_Str"+ getSizeApp()+ "String_Node_Str"+ isOrtho();
  if (isOrtho()) {
    string+="String_Node_Str" + this.getLocationOrtho();
  }
  return string;
}

Fixed version (ground truth):
@Override public String toString(){
  String string="String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ getName()+ "String_Node_Str"+ getSizeApp()+ "String_Node_Str"+ isOrtho();
  if (isOrtho()) {
    string+="String_Node_Str" + this.getLocationOrtho();
  }
  return string;
}
Program: 45688
Project: 45688
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void attachFrame(){
  logger.fine("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void attachFrame(){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str");
  }
  if (frameView == null) {
    createFrame();
  }
  if (frameView != null) {
    attachView(frameView);
    frameView.setVisibleApp(true,false);
    frameView.setVisibleUser(true);
  }
}
Program: 45689
Project: 45689
Buggy source:
public void detachView(HUDView2D view){
  logger.fine("String_Node_Str" + view + "String_Node_Str"+ this);
  Entity viewEntity=view.getEntity();
  if (viewEntity == null) {
    return;
  }
  entity.removeEntity(viewEntity);
  RenderComponent rcFrame=(RenderComponent)viewEntity.getComponent(RenderComponent.class);
  if (rcFrame != null) {
    rcFrame.setAttachPoint(null);
  }
}

Fixed version (ground truth):
public void detachView(HUDView2D view){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str" + view);
    logger.finest("String_Node_Str" + this);
  }
  Entity viewEntity=view.getEntity();
  if (viewEntity == null) {
    return;
  }
  entity.removeEntity(viewEntity);
  RenderComponent rcFrame=(RenderComponent)viewEntity.getComponent(RenderComponent.class);
  if (rcFrame != null) {
    rcFrame.setAttachPoint(null);
  }
}
Program: 45690
Project: 45690
Buggy source:
@Override public InputStream getInputStream(){
  try {
    ModuleURI uri=new ArtURI(this.url.toExternalForm());
    Asset asset=AssetManager.getAssetManager().getAsset(uri);
    if (asset == null || AssetManager.getAssetManager().waitForAsset(asset) == false) {
      return null;
    }
    return new FileInputStream(asset.getLocalCacheFile());
  }
 catch (  FileNotFoundException ex) {
    Logger.getLogger(WlaURLConnection.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  URISyntaxException excp) {
    Logger.getLogger(WlaURLConnection.class.getName()).log(Level.SEVERE,null,excp);
  }
  return null;
}

Fixed version (ground truth):
@Override public InputStream getInputStream() throws IOException {
  try {
    ModuleURI uri=new ArtURI(this.url.toExternalForm());
    Asset asset=AssetManager.getAssetManager().getAsset(uri);
    if (asset == null || AssetManager.getAssetManager().waitForAsset(asset) == false) {
      throw new IOException("String_Node_Str" + url);
    }
    return new FileInputStream(asset.getLocalCacheFile());
  }
 catch (  URISyntaxException excp) {
    IOException ioe=new IOException("String_Node_Str");
    ioe.initCause(excp);
    throw ioe;
  }
}
Program: 45691
Project: 45691
Buggy source:
@Override public InputStream getInputStream(){
  try {
    ContentURI uri=new ContentURI(this.url.toExternalForm());
    Asset asset=AssetManager.getAssetManager().getAsset(uri);
    if (asset == null || AssetManager.getAssetManager().waitForAsset(asset) == false) {
      return null;
    }
    return new FileInputStream(asset.getLocalCacheFile());
  }
 catch (  FileNotFoundException ex) {
    Logger.getLogger(WlContentURLConnection.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  URISyntaxException excp) {
    Logger.getLogger(WlContentURLConnection.class.getName()).log(Level.SEVERE,null,excp);
  }
  return null;
}

Fixed version (ground truth):
@Override public InputStream getInputStream() throws IOException {
  try {
    ContentURI uri=new ContentURI(this.url.toExternalForm());
    Asset asset=AssetManager.getAssetManager().getAsset(uri);
    if (asset == null || AssetManager.getAssetManager().waitForAsset(asset) == false) {
      throw new IOException("String_Node_Str" + url);
    }
    return new FileInputStream(asset.getLocalCacheFile());
  }
 catch (  URISyntaxException excp) {
    IOException ioe=new IOException("String_Node_Str");
    ioe.initCause(excp);
    throw ioe;
  }
}