nus-yam/ex-repair huggingface dataset:
Program: 46273
Project: 46273
Buggy source:
/** 
 * Moves this view back into the world.
 */
private void moveToWorld(){
  if (visible) {
    detachFromHud();
    if (!connectedToCell) {
      currentCell.attachView(this,RendererType.RENDERER_JME);
      connectedToCell=true;
    }
  }
  updateHudState();
  entity.getComponent(RenderComponent.class).setOrtho(true);
}

Fixed version (ground truth):
/** 
 * Moves this view back into the world.
 */
private void moveToWorld(){
  if (visible) {
    detachFromHud();
    if (!connectedToCell) {
      currentCell.attachView(this,RendererType.RENDERER_JME);
      connectedToCell=true;
    }
  }
  updateHudState();
  entity.getComponent(RenderComponent.class).setOrtho(false);
}
Program: 46274
Project: 46274
Buggy source:
/** 
 * Actually perform the pick.
 */
private PickInfo pickEventScreenPos(int x,int y){
  if (cameraComp == null)   return null;
  logger.fine("String_Node_Str" + x + "String_Node_Str"+ y);
  Ray pickRayWorld=calcPickRayWorld(x,y);
  return collisionSys.pickAllWorldRay(pickRayWorld,true,false);
}

Fixed version (ground truth):
/** 
 * Actually perform the pick.
 */
private PickInfo pickEventScreenPos(int x,int y){
  if (cameraComp == null)   return null;
  logger.fine("String_Node_Str" + x + "String_Node_Str"+ y);
  Ray pickRayWorld=calcPickRayWorld(x,y);
  return collisionSys.pickAllWorldRay(pickRayWorld,true,false,true,cameraComp);
}
Program: 46275
Project: 46275
Buggy source:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){
  if (inHud) {
    jButton2.setText("String_Node_Str");
    jButton2.setToolTipText("String_Node_Str");
  }
 else {
    jButton2.setText("String_Node_Str");
    jButton2.setToolTipText("String_Node_Str");
  }
  jPanel1.invalidate();
  inHud=!inHud;
  if (container != null) {
    container.setHud(inHud);
  }
}

Fixed version (ground truth):
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){
  inHud=!inHud;
  if (inHud) {
    jButton1.setText("String_Node_Str");
    jButton1.setToolTipText("String_Node_Str");
  }
 else {
    jButton1.setText("String_Node_Str");
    jButton1.setToolTipText("String_Node_Str");
  }
  jPanel1.invalidate();
  if (container != null) {
    container.setHud(inHud);
  }
}
Program: 46277
Project: 46277
Buggy source:
public void mute(boolean isMuted){
  SoftphoneControlImpl.getInstance().mute(isMuted);
}

Fixed version (ground truth):
public void mute(boolean isMuted){
  SoftphoneControlImpl sc=SoftphoneControlImpl.getInstance();
  sc.mute(isMuted);
  session.send(this,new MuteCallMessage(sc.getCallID(),isMuted));
}
Program: 46278
Project: 46278
Buggy source:
/** 
 * Creates new form UserListJFrame 
 */
public UserListJFrame(Point location){
  initComponents();
  setLocation(location);
}

Fixed version (ground truth):
/** 
 * Creates new form UserListJFrame 
 */
public UserListJFrame(Point location){
  initComponents();
  setTitle("String_Node_Str");
  if (location != null) {
    setLocation(location);
  }
}
Program: 46279
Project: 46279
Buggy source:
public void setListData(String[] listData){
  userList.setListData(listData);
}

Fixed version (ground truth):
public void setListData(String[] listData){
  this.listData=listData;
  userList.setListData(listData);
}
Program: 46280
Project: 46280
Buggy source:
public void run(){
  while (!done) {
    VoiceChatMessage chatMessage=new VoiceChatInfoRequestMessage(chatGroup);
    session.send(client,chatMessage);
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (!done) {
    VoiceChatMessage chatMessage=new VoiceChatInfoRequestMessage(chatGroup);
    session.send(client,chatMessage);
    try {
      Thread.sleep(2000);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 46281
Project: 46281
Buggy source:
private void leaveButtonActionPerformed(java.awt.event.ActionEvent evt){
  String chatGroup=chatGroupText.getText();
  if (chatGroup.length() == 0) {
    chatGroup=cellID.toString();
  }
  leaveButton.setEnabled(false);
  busyButton.setEnabled(false);
  VoiceChatMessage chatMessage=new VoiceChatLeaveMessage(chatGroup,cellID.toString());
  session.send(client,chatMessage);
  if (updater != null) {
    updater.done();
  }
  dialogs.remove(chatGroup);
  setVisible(false);
}

Fixed version (ground truth):
private void leaveButtonActionPerformed(java.awt.event.ActionEvent evt){
  String chatGroup=chatGroupText.getText();
  if (chatGroup.length() == 0) {
    chatGroup=cellID.toString();
  }
  leaveButton.setEnabled(false);
  busyButton.setEnabled(false);
  VoiceChatMessage chatMessage=new VoiceChatLeaveMessage(chatGroup,cellID.toString());
  session.send(client,chatMessage);
  if (chatGroupUpdater != null) {
    chatGroupUpdater.done();
  }
  dialogs.remove(chatGroup);
  setVisible(false);
}
Program: 46282
Project: 46282
Buggy source:
private void joinButtonActionPerformed(java.awt.event.ActionEvent evt){
  stopFlasher();
  String caller=callerText.getText();
  String chatters=chatterText.getText();
  chatters.replaceAll("String_Node_Str" + caller,"String_Node_Str");
  chatters=chatters.replaceAll(caller,"String_Node_Str");
  String chatGroup=chatGroupText.getText();
  if (chatGroup.length() == 0) {
    chatGroup=caller + "String_Node_Str" + cellID.toString();
  }
  logger.warning("String_Node_Str" + chatGroup + "String_Node_Str"+ caller+ "String_Node_Str"+ chatters+ "String_Node_Str"+ chatType);
  statusLabel.setText(chatType + "String_Node_Str");
  VoiceChatMessage chatMessage=new VoiceChatJoinMessage(chatGroup,caller,chatters,chatType);
  session.send(client,chatMessage);
  leaveButton.setEnabled(true);
  dialogs.put(chatGroup,this);
  if (updater == null) {
    updater=new Updater(chatGroup);
    updater.start();
  }
}

Fixed version (ground truth):
private void joinButtonActionPerformed(java.awt.event.ActionEvent evt){
  stopFlasher();
  String caller=callerText.getText();
  String chatters=chatterText.getText();
  chatters.replaceAll("String_Node_Str" + caller,"String_Node_Str");
  chatters=chatters.replaceAll(caller,"String_Node_Str");
  String chatGroup=chatGroupText.getText();
  if (chatGroup.length() == 0) {
    chatGroup=caller + "String_Node_Str" + cellID.toString();
  }
  logger.warning("String_Node_Str" + chatGroup + "String_Node_Str"+ caller+ "String_Node_Str"+ chatters+ "String_Node_Str"+ chatType);
  statusLabel.setText(chatType + "String_Node_Str");
  VoiceChatMessage chatMessage=new VoiceChatJoinMessage(chatGroup,caller,chatters,chatType);
  session.send(client,chatMessage);
  leaveButton.setEnabled(true);
  dialogs.put(chatGroup,this);
  if (chatGroupUpdater == null) {
    chatGroupUpdater=new ChatGroupUpdater(chatGroup);
    chatGroupUpdater.start();
  }
}
Program: 46285
Project: 46285
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();
  state.setStatic(false);
  CellID cellID=cell.getCellID();
  CellServerComponentMessage message=CellServerComponentMessage.newAddMessage(cellID,state);
  ResponseMessage response=cell.sendCellMessageAndWait(message);
  if (response == null) {
    logger.warning("String_Node_Str" + cell.getCellID() + "String_Node_Str"+ cell.getName()+ "String_Node_Str");
    return;
  }
  if (response instanceof OKMessage) {
    addComponentToPanelSet(spi,state);
  }
 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=cell.getCellID();
  CellServerComponentMessage message=CellServerComponentMessage.newAddMessage(cellID,state);
  ResponseMessage response=cell.sendCellMessageAndWait(message);
  if (response == null) {
    logger.warning("String_Node_Str" + cell.getCellID() + "String_Node_Str"+ cell.getName()+ "String_Node_Str");
    return;
  }
  if (response instanceof OKMessage) {
    addComponentToPanelSet(spi,state);
  }
 else   if (response instanceof ErrorMessage) {
    logger.log(Level.WARNING,"String_Node_Str",((ErrorMessage)response).getErrorCause());
  }
}
Program: 46286
Project: 46286
Buggy source:
@SuppressWarnings("String_Node_Str") public CellMO loadCellMO(String typeName,Object... args) throws LoadCellMOException {
  try {
    Class<CellMO> clazz=(Class<CellMO>)Class.forName(typeName);
    return createCell(clazz,args);
  }
 catch (  Exception ex) {
    throw new LoadCellMOException("String_Node_Str" + typeName,ex);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public CellMO loadCellMO(String typeName,Object... args) throws LoadCellMOException {
  try {
    Class<CellMO> clazz=(Class<CellMO>)Class.forName(typeName);
    return createCell(clazz,args);
  }
 catch (  java.lang.reflect.InvocationTargetException ite) {
    Throwable throwable=ite.getCause();
    if (throwable instanceof java.lang.RuntimeException) {
      throw ((RuntimeException)throwable);
    }
    throw new LoadCellMOException("String_Node_Str" + typeName,ite);
  }
catch (  java.lang.Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
    throw new LoadCellMOException("String_Node_Str" + typeName,ex);
  }
}
Program: 46287
Project: 46287
Buggy source:
/** 
 * Creates and returns a Node that contains a sphere that represents the resize affordance
 */
private Node createSphereNode(String name){
  Node sphereNode=new Node();
  Sphere sphere=new Sphere(name,30,30,radius);
  sphereNode.attachChild(sphere);
  sphere.setSolidColor(new ColorRGBA(0.0f,0.0f,0.0f,0.5f));
  sphereNode.setRenderState(zbuf);
  RenderManager rm=ClientContextJME.getWorldManager().getRenderManager();
  MaterialState matState=(MaterialState)rm.createRendererState(RenderState.RS_MATERIAL);
  sphereNode.setRenderState(matState);
  matState.setDiffuse(new ColorRGBA(0.0f,0.0f,0.0f,0.5f));
  matState.setEnabled(true);
  matState.setMaterialFace(MaterialState.MaterialFace.FrontAndBack);
  BlendState alphaState=(BlendState)ClientContextJME.getWorldManager().getRenderManager().createRendererState(RenderState.RS_BLEND);
  alphaState.setBlendEnabled(true);
  alphaState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  alphaState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  alphaState.setTestEnabled(true);
  alphaState.setTestFunction(BlendState.TestFunction.GreaterThan);
  alphaState.setEnabled(true);
  sphere.setRenderState(alphaState);
  sphere.updateRenderState();
  sphere.setModelBound(new BoundingSphere());
  sphere.updateModelBound();
  return sphereNode;
}

Fixed version (ground truth):
/** 
 * Creates and returns a Node that contains a sphere that represents the resize affordance
 */
private Node createSphereNode(String name){
  Node sphereNode=new Node();
  Sphere sphere=new Sphere(name,30,30,radius);
  sphereNode.attachChild(sphere);
  sphere.setSolidColor(new ColorRGBA(0.0f,0.0f,0.0f,0.5f));
  sphereNode.setRenderState(zbuf);
  RenderManager rm=ClientContextJME.getWorldManager().getRenderManager();
  MaterialState matState=(MaterialState)rm.createRendererState(RenderState.RS_MATERIAL);
  sphereNode.setRenderState(matState);
  matState.setDiffuse(new ColorRGBA(0.0f,0.0f,0.0f,0.5f));
  matState.setAmbient(new ColorRGBA(0.0f,0.0f,0.0f,0.5f));
  matState.setShininess(128.0f);
  matState.setEmissive(new ColorRGBA(0.0f,0.0f,0.0f,0.5f));
  matState.setEnabled(true);
  BlendState alphaState=(BlendState)ClientContextJME.getWorldManager().getRenderManager().createRendererState(RenderState.RS_BLEND);
  alphaState.setBlendEnabled(true);
  alphaState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  alphaState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  alphaState.setTestEnabled(true);
  alphaState.setTestFunction(BlendState.TestFunction.GreaterThan);
  alphaState.setEnabled(true);
  sphere.setRenderState(alphaState);
  CullState cullState=(CullState)ClientContextJME.getWorldManager().getRenderManager().createRendererState(RenderState.RS_CULL);
  cullState.setCullFace(CullState.Face.Back);
  sphereNode.setRenderState(cullState);
  sphere.setModelBound(new BoundingSphere());
  sphere.updateModelBound();
  return sphereNode;
}
Program: 46288
Project: 46288
Buggy source:
@Override public void setServerState(CellServerState setup){
  super.setServerState(setup);
  this.modelURI=((JmeColladaCellServerState)setup).getModel();
  String model=setup.getProperty("String_Node_Str");
  if (model != null) {
    this.modelURI=model;
  }
  JmeColladaCellServerState jccss=(JmeColladaCellServerState)setup;
  if (jccss.getGeometryTranslation() != null) {
    this.geometryTranslation=new Vector3f((float)jccss.getGeometryTranslation().x,(float)jccss.getGeometryTranslation().y,(float)jccss.getGeometryTranslation().z);
  }
  if (jccss.getGeometryRotation() != null) {
    this.geometryRotation=new Quaternion().fromAngleAxis((float)jccss.getGeometryRotation().angle,new Vector3f((float)jccss.getGeometryRotation().x,(float)jccss.getGeometryRotation().y,(float)jccss.getGeometryRotation().z));
  }
}

Fixed version (ground truth):
@Override public void setServerState(CellServerState setup){
  super.setServerState(setup);
  this.modelURI=((JmeColladaCellServerState)setup).getModel();
  JmeColladaCellServerState jccss=(JmeColladaCellServerState)setup;
  if (jccss.getGeometryTranslation() != null) {
    this.geometryTranslation=new Vector3f((float)jccss.getGeometryTranslation().x,(float)jccss.getGeometryTranslation().y,(float)jccss.getGeometryTranslation().z);
  }
  if (jccss.getGeometryRotation() != null) {
    this.geometryRotation=new Quaternion().fromAngleAxis((float)jccss.getGeometryRotation().angle,new Vector3f((float)jccss.getGeometryRotation().x,(float)jccss.getGeometryRotation().y,(float)jccss.getGeometryRotation().z));
  }
}
Program: 46289
Project: 46289
Buggy source:
@Override protected void sizeChanged(Dimension oldSize,Dimension newSize){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + oldSize);
  System.err.println("String_Node_Str" + newSize);
  if (windowSwing != null) {
    windowSwing.setSize(newSize.width,newSize.height);
  }
}

Fixed version (ground truth):
@Override protected void sizeChanged(Dimension oldSize,Dimension newSize){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + oldSize);
  System.err.println("String_Node_Str" + newSize);
synchronized (this) {
    while (windowSwing == null) {
      try {
        wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  windowSwing.setSize2(newSize.width,newSize.height);
}
Program: 46290
Project: 46290
Buggy source:
void setWindowSwing(WindowSwing windowSwing){
  this.windowSwing=windowSwing;
}

Fixed version (ground truth):
void setWindowSwing(WindowSwing windowSwing){
  this.windowSwing=windowSwing;
synchronized (this) {
    notifyAll();
  }
}
Program: 46291
Project: 46291
Buggy source:
/** 
 * Specify the Swing component displayed in this window 
 */
public void setComponent(Component component){
  if (this.component == component) {
    return;
  }
  this.component=component;
  if (embeddedPeer != null) {
    embeddedPeer.dispose();
    embeddedPeer=null;
  }
  if (component != null) {
    checkContainer();
  }
  component.addMouseListener(new MyAwtEnterListener());
  addWorldEventListener(new MySwingEnterExitListener());
  setSize(size);
  embeddedPeer.repaint();
}

Fixed version (ground truth):
/** 
 * Specify the Swing component displayed in this window 
 */
public void setComponent(Component component){
  if (this.component == component) {
    return;
  }
  this.component=component;
  if (embeddedPeer != null) {
    embeddedPeer.dispose();
    embeddedPeer=null;
  }
  if (component != null) {
    checkContainer();
  }
  addWorldEventListener(new MySwingEnterExitListener());
  embeddedPeer.validate();
}
Program: 46292
Project: 46292
Buggy source:
@Override protected void sizeChanged(Dimension oldSize,Dimension newSize){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + oldSize);
  System.err.println("String_Node_Str" + newSize);
synchronized (this) {
    while (windowSwing == null) {
      try {
        wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  windowSwing.setSize(newSize.width,newSize.height);
}

Fixed version (ground truth):
@Override protected void sizeChanged(Dimension oldSize,Dimension newSize){
synchronized (this) {
    while (windowSwing == null) {
      try {
        wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  windowSwing.setSize(newSize.width,newSize.height);
}
Program: 46293
Project: 46293
Buggy source:
@Override protected void sizeChanged(Dimension oldSize,Dimension newSize){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + oldSize);
  System.err.println("String_Node_Str" + newSize);
synchronized (this) {
    while (windowSwing == null) {
      try {
        wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  windowSwing.setSize2(newSize.width,newSize.height);
}

Fixed version (ground truth):
@Override protected void sizeChanged(Dimension oldSize,Dimension newSize){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + oldSize);
  System.err.println("String_Node_Str" + newSize);
synchronized (this) {
    while (windowSwing == null) {
      try {
        wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  windowSwing.setSize(newSize.width,newSize.height);
}
Program: 46294
Project: 46294
Buggy source:
/** 
 * Specify the Swing component displayed in this window 
 */
public void setComponent(Component component){
  if (this.component == component) {
    return;
  }
  this.component=component;
  if (embeddedPeer != null) {
    embeddedPeer.dispose();
    embeddedPeer=null;
  }
  if (component != null) {
    checkContainer();
  }
  addWorldEventListener(new MySwingEnterExitListener());
  embeddedPeer.validate();
}

Fixed version (ground truth):
/** 
 * Specify the Swing component displayed in this window 
 */
public void setComponent(Component component){
  if (this.component == component) {
    return;
  }
  this.component=component;
  if (embeddedPeer != null) {
    embeddedPeer.dispose();
    embeddedPeer=null;
  }
  if (component != null) {
    checkContainer();
  }
  addWorldEventListener(new MySwingEnterExitListener());
  embeddedPeer.validate();
  embeddedPeer.repaint();
}
Program: 46295
Project: 46295
Buggy source:
public MicrophoneCellServerState(String name,FullVolumeArea fullVolumeArea,ActiveArea activeArea){
  this.name=name;
  this.fullVolumeArea=fullVolumeArea;
  this.activeArea=activeArea;
  logger.finer("String_Node_Str" + fullVolumeArea.areaType + "String_Node_Str"+ fullVolumeArea.xExtent+ "String_Node_Str"+ fullVolumeArea.yExtent+ "String_Node_Str"+ fullVolumeArea.zExtent);
  logger.finer("String_Node_Str" + activeArea.origin + "String_Node_Str"+ activeArea.xExtent+ "String_Node_Str"+ activeArea.yExtent+ "String_Node_Str"+ activeArea.zExtent);
}

Fixed version (ground truth):
public MicrophoneCellServerState(String name,FullVolumeArea fullVolumeArea,ActiveArea activeArea){
  this.name=name;
  this.fullVolumeArea=fullVolumeArea;
  this.activeArea=activeArea;
}
Program: 46296
Project: 46296
Buggy source:
@Override public CellClientState getClientState(CellClientState state,WonderlandClientID clientID,ClientCapabilities capabilities){
  if (state != null)   logger.severe("String_Node_Str");
  CellClientState ret=new ColladaCellClientState(this.modelURI.getServerURL(),geometryTranslation,geometryRotation);
  super.getClientState(ret,clientID,capabilities);
  return ret;
}

Fixed version (ground truth):
@Override public CellClientState getClientState(CellClientState state,WonderlandClientID clientID,ClientCapabilities capabilities){
  if (state != null) {
    logger.severe("String_Node_Str");
  }
  CellClientState ret=new ColladaCellClientState(this.modelURI.toExternalForm(),geometryTranslation,geometryRotation);
  super.getClientState(ret,clientID,capabilities);
  return ret;
}
Program: 46297
Project: 46297
Buggy source:
/** 
 * Configure this runner.  This method sets values to the default for the Darkstar server.
 * @param props the properties to deploy with
 * @throws RunnerConfigurationException if there is an error configuringthe runner
 */
@Override public void configure(Properties props) throws RunnerConfigurationException {
  super.configure(props);
  if (!props.containsKey("String_Node_Str")) {
    setName(DEFAULT_NAME);
  }
  webserverURL=props.getProperty("String_Node_Str");
  try {
    File wfsFile=new File(getRunDir(),SELECTED_WFS_FILE);
    if (wfsFile.exists()) {
      wfsName=restoreWFSName(SELECTED_WFS_FILE);
    }
 else {
      wfsName=System.getProperty(DEFAULT_WORLD_PROP,DEFAULT_WORLD);
    }
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,"String_Node_Str",ioe);
  }
}

Fixed version (ground truth):
/** 
 * Configure this runner.  This method sets values to the default for the Darkstar server.
 * @param props the properties to deploy with
 * @throws RunnerConfigurationException if there is an error configuringthe runner
 */
@Override public void configure(Properties props) throws RunnerConfigurationException {
  super.configure(props);
  if (!props.containsKey("String_Node_Str")) {
    setName(DEFAULT_NAME);
  }
  webserverURL=props.getProperty("String_Node_Str");
  try {
    File wfsFile=new File(getBaseDir(),SELECTED_WFS_FILE);
    if (wfsFile.exists()) {
      wfsName=restoreWFSName(SELECTED_WFS_FILE);
    }
 else {
      wfsName=System.getProperty(DEFAULT_WORLD_PROP,DEFAULT_WORLD);
    }
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,"String_Node_Str",ioe);
  }
}
Program: 46298
Project: 46298
Buggy source:
/** 
 * Save the current WFS name to disk
 * @param wfsName the name to save
 * @param fileName the file name to save to
 */
protected void saveWFSName(String wfsName,String fileName) throws IOException {
  File wfsFile=new File(getRunDir(),fileName);
  PrintWriter out=new PrintWriter(new FileWriter(wfsFile));
  if (wfsName != null) {
    out.println(wfsName);
  }
  out.close();
}

Fixed version (ground truth):
/** 
 * Save the current WFS name to disk
 * @param wfsName the name to save
 * @param fileName the file name to save to
 */
protected void saveWFSName(String wfsName,String fileName) throws IOException {
  File wfsFile=new File(getBaseDir(),fileName);
  PrintWriter out=new PrintWriter(new FileWriter(wfsFile));
  if (wfsName != null) {
    out.println(wfsName);
  }
  out.close();
}
Program: 46299
Project: 46299
Buggy source:
/** 
 * Restore a WFS URL from disk
 * @param fileName the file name to read from
 * @return the current URL, or null if no URL is set
 */
protected String restoreWFSName(String fileName) throws IOException {
  File wfsFile=new File(getRunDir(),fileName);
  if (!wfsFile.exists()) {
    return null;
  }
  BufferedReader br=new BufferedReader(new FileReader(wfsFile));
  return br.readLine();
}

Fixed version (ground truth):
/** 
 * Restore a WFS URL from disk
 * @param fileName the file name to read from
 * @return the current URL, or null if no URL is set
 */
protected String restoreWFSName(String fileName) throws IOException {
  File wfsFile=new File(getBaseDir(),fileName);
  if (!wfsFile.exists()) {
    return null;
  }
  BufferedReader br=new BufferedReader(new FileReader(wfsFile));
  return br.readLine();
}
Program: 46300
Project: 46300
Buggy source:
/** 
 * Transform the vector ret by this transform. ret is modified and returned.
 * @param ret
 */
public Vector3f transform(Vector3f ret){
  ret=rotation.mult(ret);
  ret=scale.mult(ret);
  ret.addLocal(translation);
  return ret;
}

Fixed version (ground truth):
/** 
 * Transform the vector ret by this transform. ret is modified and returned.
 * @param ret
 */
public Vector3f transform(Vector3f ret){
  rotation.multLocal(ret);
  scale.multLocal(ret);
  ret.addLocal(translation);
  return ret;
}
Program: 46301
Project: 46301
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellClientState configData){
  App2DCellConfig appConfigData=(App2DCellConfig)configData;
  pixelScale=appConfigData.getPixelScale();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellClientState clientState){
  App2DCellClientState appClientState=(App2DCellClientState)clientState;
  pixelScale=appClientState.getPixelScale();
}
Program: 46302
Project: 46302
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellClientState configData){
  super.setClientState(configData);
  AppConventionalCellConfig config=(AppConventionalCellConfig)configData;
  masterHost=config.getMasterHost();
  appName=config.getAppName();
  pixelScale=config.getPixelScale();
  connectionInfo=config.getConnectionInfo();
  if (masterHost.equals(NetworkAddress.getDefaultHostAddress())) {
    boolean bestView=config.isBestView();
    if (config.isUserLaunched()) {
      UUID appId=config.getAppId();
      App appToAttach=AppConventional.findDisembodiedApp(appId);
      if (appToAttach == null) {
        logger.severe("String_Node_Str");
        return;
      }
      app=appToAttach;
      AppConventional.removeDisembodiedApp(appId);
      ((AppConventional)app).setInitInBestView(bestView);
      appToAttach.setCell(this);
      return;
    }
 else {
      startMaster(config.getCommand(),false);
    }
  }
 else {
    startSlave();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellClientState clientState){
  super.setClientState(clientState);
  AppConventionalCellClientState state=(AppConventionalCellClientState)clientState;
  masterHost=state.getMasterHost();
  appName=state.getAppName();
  pixelScale=state.getPixelScale();
  connectionInfo=state.getConnectionInfo();
  if (masterHost.equals(NetworkAddress.getDefaultHostAddress())) {
    boolean bestView=state.isBestView();
    if (state.isUserLaunched()) {
      UUID appId=state.getAppId();
      App appToAttach=AppConventional.findDisembodiedApp(appId);
      if (appToAttach == null) {
        logger.severe("String_Node_Str");
        return;
      }
      app=appToAttach;
      AppConventional.removeDisembodiedApp(appId);
      ((AppConventional)app).setInitInBestView(bestView);
      appToAttach.setCell(this);
      return;
    }
 else {
      startMaster(state.getCommand(),false);
    }
  }
 else {
    startSlave();
  }
}
Program: 46303
Project: 46303
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected CellClientState getCellClientState(CellClientState cellClientState,WonderlandClientID clientID,ClientCapabilities capabilities){
  if (cellClientState == null) {
    cellClientState=new AppCellConfig();
  }
  return super.getCellClientState(cellClientState,clientID,capabilities);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected CellClientState getCellClientState(CellClientState cellClientState,WonderlandClientID clientID,ClientCapabilities capabilities){
  if (cellClientState == null) {
    cellClientState=new AppCellClientState();
  }
  return super.getCellClientState(cellClientState,clientID,capabilities);
}
Program: 46304
Project: 46304
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void setCellServerState(CellServerState setupData){
  super.setCellServerState(setupData);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void setCellServerState(CellServerState serverState){
  super.setCellServerState(serverState);
}
Program: 46306
Project: 46306
Buggy source:
private Space createSpace(Vector3f point,int x,int y,int z){
  Vector3f center=new Vector3f((x * SPACE_SIZE * 2) + SPACE_SIZE,(y * SPACE_SIZE * 2) + SPACE_SIZE,(z * SPACE_SIZE * 2) + SPACE_SIZE);
  BoundingBox gridBounds=new BoundingBox(center,SPACE_SIZE * fudge,SPACE_SIZE * fudge,SPACE_SIZE * fudge);
  String bindingName=getSpaceBindingName(x,y,z);
  Space space=new Space(gridBounds,bindingName);
synchronized (spaces) {
    spaces.put(bindingName,space);
  }
  return space;
}

Fixed version (ground truth):
private Space createSpace(int x,int y,int z){
  Vector3f center=new Vector3f((x * SPACE_SIZE * 2) + SPACE_SIZE,(y * SPACE_SIZE * 2) + SPACE_SIZE,(z * SPACE_SIZE * 2) + SPACE_SIZE);
  BoundingBox gridBounds=new BoundingBox(center,SPACE_SIZE * fudge,SPACE_SIZE * fudge,SPACE_SIZE * fudge);
  String bindingName=getSpaceBindingName(x,y,z);
  Space space=new Space(gridBounds,bindingName);
synchronized (spaces) {
    spaces.put(bindingName,space);
  }
  return space;
}
Program: 46307
Project: 46307
Buggy source:
/** 
 * Return the space that encloses this point, if the space does not exist, create it
 * @param position
 * @return
 */
public Iterable<Space> getEnclosingSpace(BoundingVolume volume){
  ArrayList retList=new ArrayList();
  Vector3f point=volume.getCenter();
  int x=(int)(point.x / (SPACE_SIZE * 2));
  int y=(int)(point.y / (SPACE_SIZE * 2));
  int z=(int)(point.z / (SPACE_SIZE * 2));
  if (point.x < 0)   x-=1;
  if (point.y < 0)   y-=1;
  if (point.z < 0)   z-=1;
  Space sp=getEnclosingSpaceImpl(x,y,z);
  if (sp == null) {
    sp=createSpace(point,x,y,z);
  }
  if (!sp.getWorldBounds().contains(point))   throw new RuntimeException("String_Node_Str" + sp.getWorldBounds() + "String_Node_Str"+ point+ "String_Node_Str"+ getSpaceBindingName(x,y,z));
  retList.add(sp);
  float radius;
  if (volume instanceof BoundingBox) {
    radius=((BoundingBox)volume).xExtent;
  }
 else   if (volume instanceof BoundingSphere) {
    radius=((BoundingSphere)volume).getRadius();
  }
 else   throw new RuntimeException("String_Node_Str" + volume.getClass().getName());
  int step=(int)(radius / (SPACE_SIZE * 2));
  for (int xs=-step; xs <= step; xs++) {
    for (int ys=-step; ys <= step; ys++) {
      for (int zs=-step; zs <= step; zs++) {
        sp=getEnclosingSpaceImpl(x + xs,y + ys,z + zs);
        if (sp != null && sp.getWorldBounds().intersects(volume)) {
          retList.add(sp);
        }
      }
    }
  }
  return retList;
}

Fixed version (ground truth):
/** 
 * Return the space that encloses this point, if the space does not exist, create it
 * @param position
 * @return
 */
public Iterable<Space> getEnclosingSpace(BoundingVolume volume){
  ArrayList retList=new ArrayList();
  Vector3f point=volume.getCenter();
  int x=(int)(point.x / (SPACE_SIZE * 2));
  int y=(int)(point.y / (SPACE_SIZE * 2));
  int z=(int)(point.z / (SPACE_SIZE * 2));
  if (point.x < 0)   x-=1;
  if (point.y < 0)   y-=1;
  if (point.z < 0)   z-=1;
  Space sp=getEnclosingSpaceImpl(x,y,z);
  if (sp == null) {
    sp=createSpace(x,y,z);
  }
  if (!sp.getWorldBounds().contains(point))   throw new RuntimeException("String_Node_Str" + sp.getWorldBounds() + "String_Node_Str"+ point+ "String_Node_Str"+ getSpaceBindingName(x,y,z));
  retList.add(sp);
  float radius;
  if (volume instanceof BoundingBox) {
    radius=((BoundingBox)volume).xExtent;
  }
 else   if (volume instanceof BoundingSphere) {
    radius=((BoundingSphere)volume).getRadius();
  }
 else   throw new RuntimeException("String_Node_Str" + volume.getClass().getName());
  int step=(int)(radius / (SPACE_SIZE * 2));
  for (int xs=-step; xs <= step; xs++) {
    for (int ys=-step; ys <= step; ys++) {
      for (int zs=-step; zs <= step; zs++) {
        sp=getEnclosingSpaceImpl(x + xs,y + ys,z + zs);
        if (sp == null) {
          sp=createSpace(x + xs,y + ys,z + zs);
        }
        if (sp != null && sp.getWorldBounds().intersects(volume)) {
          retList.add(sp);
        }
      }
    }
  }
  System.err.println("String_Node_Str" + retList.size() + "String_Node_Str");
  return retList;
}
Program: 46308
Project: 46308
Buggy source:
@Override public void setStatus(CellStatus status){
switch (status) {
case DISK:
    if (msgReceiver != null) {
      channelComp.removeMessageReceiver(getMessageClass());
      msgReceiver=null;
    }
  break;
case BOUNDS:
{
  if (msgReceiver == null) {
    msgReceiver=new ChannelComponent.ComponentMessageReceiver(){
      public void messageReceived(      CellMessage message){
        if (message.getSenderID() != cell.getCellCache().getSession().getID()) {
          serverMoveRequest((MovableMessage)message);
        }
      }
    }
;
    channelComp.addMessageReceiver(getMessageClass(),msgReceiver);
  }
}
}
}

Fixed version (ground truth):
@Override public void setStatus(CellStatus status){
switch (status) {
case DISK:
    if (msgReceiver != null) {
      channelComp.removeMessageReceiver(getMessageClass());
      msgReceiver=null;
    }
  break;
case BOUNDS:
{
  if (msgReceiver == null) {
    msgReceiver=new ChannelComponent.ComponentMessageReceiver(){
      public void messageReceived(      CellMessage message){
        BigInteger senderID=message.getSenderID();
        if (senderID == null) {
          senderID=BigInteger.ZERO;
        }
        if (!senderID.equals(cell.getCellCache().getSession().getID())) {
          serverMoveRequest((MovableMessage)message);
        }
      }
    }
;
    channelComp.addMessageReceiver(getMessageClass(),msgReceiver);
  }
}
}
}
Program: 46309
Project: 46309
Buggy source:
public void messageReceived(CellMessage message){
  if (message.getSenderID() != cell.getCellCache().getSession().getID()) {
    serverMoveRequest((MovableMessage)message);
  }
}

Fixed version (ground truth):
public void messageReceived(CellMessage message){
  BigInteger senderID=message.getSenderID();
  if (senderID == null) {
    senderID=BigInteger.ZERO;
  }
  if (!senderID.equals(cell.getCellCache().getSession().getID())) {
    serverMoveRequest((MovableMessage)message);
  }
}
Program: 46310
Project: 46310
Buggy source:
/** 
 * Create all of the Swing windows - and the 3D window
 */
private void createUI(WorldManager wm){
  ViewManager.initialize(width,height);
  frame=new MainFrameImpl(wm,width,height);
  frame.getFrame().setLocationRelativeTo(null);
  frame.getFrame().setVisible(true);
  ViewManager.getViewManager().attachViewCanvas(frame.getCanvas3DPanel());
  CameraComponent cameraComp=ViewManager.getViewManager().getCameraComponent();
  InputManager inputManager=ClientContext.getInputManager();
  inputManager.initialize(frame.getCanvas(),cameraComp);
  inputManager.addKeyMouseFocus(inputManager.getGlobalFocusEntity());
  InputManager3D.getInputManager().addGlobalEventListener(new EventClassFocusListener(){
    private final Logger logger=Logger.getLogger("String_Node_Str");
    public Class[] eventClassesToConsume(){
      return new Class[]{KeyEvent3D.class,MouseEvent3D.class};
    }
    public void commitEvent(    Event event){
      if (event instanceof KeyEvent3D) {
        if (((KeyEvent3D)event).isPressed()) {
          logger.fine("String_Node_Str" + event);
        }
      }
 else {
        logger.fine("String_Node_Str" + event);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create all of the Swing windows - and the 3D window
 */
private void createUI(WorldManager wm){
  ViewManager.initialize(width,height);
  frame=new MainFrameImpl(wm,width,height);
  frame.getFrame().setLocationRelativeTo(null);
  frame.getFrame().setVisible(true);
  ViewManager.getViewManager().attachViewCanvas(frame.getCanvas3DPanel());
  CameraComponent cameraComp=ViewManager.getViewManager().getCameraComponent();
  InputManager inputManager=ClientContext.getInputManager();
  inputManager.initialize(frame.getCanvas(),cameraComp);
  inputManager.addKeyMouseFocus(inputManager.getGlobalFocusEntity());
}
Program: 46312
Project: 46312
Buggy source:
protected WindowSwingEmbeddedPeer(JComponent parent,Component embedded,WindowSwingEmbeddedToolkit toolkit){
  super(parent,embedded);
  this.toolkit=toolkit;
  painterThread=new PainterThread();
  painterThread.start();
}

Fixed version (ground truth):
protected WindowSwingEmbeddedPeer(JComponent parent,Component embedded,WindowSwingEmbeddedToolkit toolkit){
  super(parent,embedded);
  this.toolkit=toolkit;
}
Program: 46313
Project: 46313
Buggy source:
private void paintOnWindow(WindowSwing window){
  painterThread.enqueuePaint(this,window);
}

Fixed version (ground truth):
private void paintOnWindow(final WindowSwing window){
  EventQueue.invokeLater(new Runnable(){
    public void run(){
      DrawingSurface drawingSurface=window.getSurface();
      Graphics2D gDst=drawingSurface.getGraphics();
      paint(gDst);
    }
  }
);
}
Program: 46315
Project: 46315
Buggy source:
/** 
 * Creates new form MainFrame 
 */
public MainFrameImpl(WorldManager wm,int width,int height){
  try {
    UIManager.setLookAndFeel("String_Node_Str");
  }
 catch (  Exception ex) {
    logger.warning("String_Node_Str" + ex);
  }
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  initComponents();
  HelpSystem helpSystem=new HelpSystem();
  JMenu helpMenu=helpSystem.getHelpJMenu();
  mainMenuBar.add(helpMenu);
  wm.getRenderManager().setFrameRateListener(new FrameRateListener(){
    public void currentFramerate(    float framerate){
      fpsLabel.setText("String_Node_Str" + framerate);
    }
  }
,100);
  setTitle(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  centerPanel.setMinimumSize(new Dimension(width,height));
  centerPanel.setPreferredSize(new Dimension(width,height));
  serverField.getDocument().addDocumentListener(new DocumentListener(){
    public void insertUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void removeUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void changedUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void checkButtons(){
      String cur=serverField.getText();
      if (cur != null && cur.length() > 0 && !cur.equals(serverURL)) {
        goButton.setEnabled(true);
      }
 else {
        goButton.setEnabled(false);
      }
    }
  }
);
  pack();
}

Fixed version (ground truth):
/** 
 * Creates new form MainFrame 
 */
public MainFrameImpl(WorldManager wm,int width,int height){
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  initComponents();
  HelpSystem helpSystem=new HelpSystem();
  JMenu helpMenu=helpSystem.getHelpJMenu();
  mainMenuBar.add(helpMenu);
  wm.getRenderManager().setFrameRateListener(new FrameRateListener(){
    public void currentFramerate(    float framerate){
      fpsLabel.setText("String_Node_Str" + framerate);
    }
  }
,100);
  setTitle(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  centerPanel.setMinimumSize(new Dimension(width,height));
  centerPanel.setPreferredSize(new Dimension(width,height));
  serverField.getDocument().addDocumentListener(new DocumentListener(){
    public void insertUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void removeUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void changedUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void checkButtons(){
      String cur=serverField.getText();
      if (cur != null && cur.length() > 0 && !cur.equals(serverURL)) {
        goButton.setEnabled(true);
      }
 else {
        goButton.setEnabled(false);
      }
    }
  }
);
  pack();
}
Program: 46316
Project: 46316
Buggy source:
/** 
 * Creates new form MainFrame 
 */
public MainFrameImpl(WorldManager wm,int width,int height){
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  initComponents();
  HelpSystem helpSystem=new HelpSystem();
  JMenu helpMenu=helpSystem.getHelpJMenu();
  mainMenuBar.add(helpMenu);
  wm.getRenderManager().setFrameRateListener(new FrameRateListener(){
    public void currentFramerate(    float framerate){
      fpsLabel.setText("String_Node_Str" + framerate);
    }
  }
,100);
  setTitle(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  centerPanel.setMinimumSize(new Dimension(width,height));
  centerPanel.setPreferredSize(new Dimension(width,height));
  serverField.getDocument().addDocumentListener(new DocumentListener(){
    public void insertUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void removeUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void changedUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void checkButtons(){
      String cur=serverField.getText();
      if (cur != null && cur.length() > 0 && !cur.equals(serverURL)) {
        goButton.setEnabled(true);
      }
 else {
        goButton.setEnabled(false);
      }
    }
  }
);
  pack();
}

Fixed version (ground truth):
/** 
 * Creates new form MainFrame 
 */
public MainFrameImpl(WorldManager wm,int width,int height){
  try {
    UIManager.setLookAndFeel("String_Node_Str");
  }
 catch (  Exception ex) {
    logger.warning("String_Node_Str" + ex);
  }
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  initComponents();
  HelpSystem helpSystem=new HelpSystem();
  JMenu helpMenu=helpSystem.getHelpJMenu();
  mainMenuBar.add(helpMenu);
  wm.getRenderManager().setFrameRateListener(new FrameRateListener(){
    public void currentFramerate(    float framerate){
      fpsLabel.setText("String_Node_Str" + framerate);
    }
  }
,100);
  setTitle(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  centerPanel.setMinimumSize(new Dimension(width,height));
  centerPanel.setPreferredSize(new Dimension(width,height));
  serverField.getDocument().addDocumentListener(new DocumentListener(){
    public void insertUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void removeUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void changedUpdate(    DocumentEvent e){
      checkButtons();
    }
    public void checkButtons(){
      String cur=serverField.getText();
      if (cur != null && cur.length() > 0 && !cur.equals(serverURL)) {
        goButton.setEnabled(true);
      }
 else {
        goButton.setEnabled(false);
      }
    }
  }
);
  pack();
}
Program: 46318
Project: 46318
Buggy source:
public void commitEvent(Event event){
  CellTransform transform=getLocalTransform();
  if (event instanceof MouseButtonEvent3D) {
    MouseButtonEvent3D buttonEvent=(MouseButtonEvent3D)event;
    if (buttonEvent.isPressed()) {
      MouseEvent awtButtonEvent=(MouseEvent)buttonEvent.getAwtEvent();
      dragStartScreen=new Point(awtButtonEvent.getX(),awtButtonEvent.getY());
      dragStartWorld=buttonEvent.getIntersectionPointWorld();
      translationOnPress=transform.getTranslation(null);
      dragging=true;
    }
 else {
      dragging=false;
    }
    return;
  }
  if (!dragging || !(event instanceof MouseDraggedEvent3D)) {
    return;
  }
  MouseDraggedEvent3D dragEvent=(MouseDraggedEvent3D)event;
  Vector3f dragVector=dragEvent.getDragVectorWorld(dragStartWorld,dragStartScreen,new Vector3f());
  Vector3f newTranslation=translationOnPress.add(dragVector);
  transform.setTranslation(newTranslation);
  movableComp.localMoveRequest(transform);
}

Fixed version (ground truth):
public void commitEvent(Event event){
  CellTransform transform=getLocalTransform();
  if (event instanceof MouseButtonEvent3D) {
    MouseButtonEvent3D buttonEvent=(MouseButtonEvent3D)event;
    if (buttonEvent.isPressed()) {
      MouseEvent awtButtonEvent=(MouseEvent)buttonEvent.getAwtEvent();
      dragStartScreen=new Point(awtButtonEvent.getX(),awtButtonEvent.getY());
      dragStartWorld=buttonEvent.getIntersectionPointWorld();
      translationOnPress=transform.getTranslation(null);
    }
    return;
  }
  if (!(event instanceof MouseDraggedEvent3D)) {
    return;
  }
  MouseDraggedEvent3D dragEvent=(MouseDraggedEvent3D)event;
  Vector3f dragVector=dragEvent.getDragVectorWorld(dragStartWorld,dragStartScreen,new Vector3f());
  Vector3f newTranslation=translationOnPress.add(dragVector);
  transform.setTranslation(newTranslation);
  movableComp.localMoveRequest(transform);
}
Program: 46319
Project: 46319
Buggy source:
@Override protected String getClientCellClassName(ClientSession clientSession,ClientCapabilities capabilities){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override protected String getClientCellClassName(WonderlandClientID clientID,ClientCapabilities capabilities){
  return "String_Node_Str";
}
Program: 46320
Project: 46320
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void detachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  getEntity().removeEntity(viewWorld.getEntity());
  FrameWorldDefault frame=viewWorld.getFrame();
  if (frame != null) {
    getEntity().removeEntity(frame.getEntity());
    frame.setParentEntity(null);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void detachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  FrameWorldDefault frame=viewWorld.getFrame();
  if (frame != null) {
    frame.setParentEntity(null);
    getEntity().removeEntity(frame.getEntity());
  }
  viewWorld.setParentEntity(null);
  getEntity().removeEntity(viewWorld.getEntity());
}
Program: 46321
Project: 46321
Buggy source:
@Override public Popup getPopup(EmbeddedPeer peer,Component contents,int x,int y){
  System.err.println("String_Node_Str" + x + "String_Node_Str"+ y);
  JmeClientMain.getFrame().getCanvas3DPanel().add(contents);
  contents.validate();
  System.err.println("String_Node_Str" + contents.getWidth());
  System.err.println("String_Node_Str" + contents.getHeight());
  int width=200;
  int height=200;
  if (!(peer instanceof WindowSwingEmbeddedPeer)) {
    throw new RuntimeException("String_Node_Str");
  }
  WindowSwing winOwner=((WindowSwingEmbeddedPeer)peer).getWindowSwing();
  WindowSwing winPopup=null;
  try {
    winPopup=new WindowSwing(winOwner.getApp(),width,height,false,winOwner.getPixelScale());
    winPopup.setComponent(contents);
  }
 catch (  InstantiationException ex) {
    logger.warning("String_Node_Str");
    return null;
  }
  final WindowSwing popup=winPopup;
  winPopup.positionRelativeTo(winOwner,x,y);
  return new Popup(){
    @Override public void show(){
      popup.setVisible(true);
    }
    @Override public void hide(){
      popup.setVisible(false);
    }
  }
;
}

Fixed version (ground truth):
@Override public Popup getPopup(EmbeddedPeer peer,Component contents,int x,int y){
  System.err.println("String_Node_Str" + x + "String_Node_Str"+ y);
  int width=(int)contents.getPreferredSize().getWidth();
  int height=(int)contents.getPreferredSize().getHeight();
  if (!(peer instanceof WindowSwingEmbeddedPeer)) {
    throw new RuntimeException("String_Node_Str");
  }
  WindowSwing winOwner=((WindowSwingEmbeddedPeer)peer).getWindowSwing();
  WindowSwing winPopup=null;
  try {
    winPopup=new WindowSwing(winOwner.getApp(),width,height,false,winOwner.getPixelScale());
    winPopup.setComponent(contents);
  }
 catch (  InstantiationException ex) {
    logger.warning("String_Node_Str");
    return null;
  }
  final WindowSwing popup=winPopup;
  winPopup.positionRelativeTo(winOwner,x,y);
  return new Popup(){
    @Override public void show(){
      popup.setVisible(true);
    }
    @Override public void hide(){
      popup.setVisible(false);
    }
  }
;
}