nus-yam/ex-repair huggingface dataset:
Program: 46322
Project: 46322
Buggy source:
@Override public void execute() throws BuildException {
  if (!jar.exists()) {
    throw new BuildException("String_Node_Str" + jar);
  }
  if (dir == null) {
    dir="String_Node_Str";
  }
  if (output == null) {
    output=new File("String_Node_Str");
  }
  boolean changed=false;
  BufferedReader check=null;
  File tmpFile=FILE_UTILS.createTempFile("String_Node_Str","String_Node_Str",jar.getParentFile());
  try {
    JarInputStream in=new JarInputStream(new FileInputStream(jar));
    PrintWriter out=new PrintWriter(new FileWriter(tmpFile));
    if (output.exists()) {
      check=new BufferedReader(new FileReader(output));
    }
 else {
      changed=true;
    }
    Pattern p=Pattern.compile("String_Node_Str" + dir + "String_Node_Str");
    JarEntry je;
    while ((je=in.getNextJarEntry()) != null) {
      Matcher m=p.matcher(je.getName());
      if (m.matches() && m.groupCount() == 1) {
        String line="String_Node_Str" + m.group();
        if (!changed && !line.equals(check.readLine())) {
          changed=true;
          check.close();
        }
        out.println(line);
      }
    }
    out.close();
    if (changed) {
      FILE_UTILS.rename(tmpFile,output);
    }
 else {
      tmpFile.delete();
    }
  }
 catch (  IOException ioe) {
    throw new BuildException(ioe);
  }
}

Fixed version (ground truth):
@Override public void execute() throws BuildException {
  if (!jar.exists()) {
    throw new BuildException("String_Node_Str" + jar);
  }
  if (dir == null) {
    dir="String_Node_Str";
  }
  if (output == null) {
    output=new File("String_Node_Str");
  }
  boolean changed=false;
  BufferedReader check=null;
  File tmpFile=FILE_UTILS.createTempFile("String_Node_Str","String_Node_Str",jar.getParentFile());
  JarInputStream in=null;
  try {
    in=new JarInputStream(new FileInputStream(jar));
    PrintWriter out=new PrintWriter(new FileWriter(tmpFile));
    if (output.exists()) {
      check=new BufferedReader(new FileReader(output));
    }
 else {
      changed=true;
    }
    Pattern p=Pattern.compile("String_Node_Str" + dir + "String_Node_Str");
    JarEntry je;
    while ((je=in.getNextJarEntry()) != null) {
      Matcher m=p.matcher(je.getName());
      if (m.matches() && m.groupCount() == 1) {
        String line="String_Node_Str" + m.group();
        if (!changed && !line.equals(check.readLine())) {
          changed=true;
          check.close();
        }
        out.println(line);
      }
    }
    out.close();
    if (changed) {
      FILE_UTILS.rename(tmpFile,output);
    }
 else {
      tmpFile.delete();
    }
  }
 catch (  IOException ioe) {
    throw new BuildException(ioe);
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException ioe) {
        log("String_Node_Str" + jar,ioe,Project.MSG_WARN);
      }
    }
  }
}
Program: 46323
Project: 46323
Buggy source:
/** 
 * Change whether this is a top-level window or not. A top-level window has an enclosing frame.
 */
public void setTopLevel(boolean topLevel){
  if (this.topLevel == topLevel)   return;
  this.topLevel=topLevel;
  update(Window2DView.CHANGED_VISIBILITY);
}

Fixed version (ground truth):
/** 
 * Change whether this is a top-level window or not. A top-level window has an enclosing frame.
 */
public void setTopLevel(boolean topLevel){
  if (this.topLevel == topLevel)   return;
  this.topLevel=topLevel;
  update(Window2DView.CHANGED_VISIBILITY | Window2DView.CHANGED_TOP_LEVEL);
}
Program: 46324
Project: 46324
Buggy source:
/** 
 * Returns the frame of view. 
 */
FrameWorldDefault getFrame(){
  if (topLevel && frame == null) {
    update(CHANGED_TOP_LEVEL);
  }
  return frame;
}

Fixed version (ground truth):
/** 
 * Returns the frame of view. 
 */
FrameWorldDefault getFrame(){
  update(CHANGED_TOP_LEVEL);
  return frame;
}
Program: 46325
Project: 46325
Buggy source:
/** 
 * {@inheritDoc}"
 */
@Override public void update(int changeMask){
  if ((changeMask & CHANGED_VISIBILITY) != 0) {
    updateVisibility();
    if (visible && geometryObj == null) {
      changeMask|=CHANGED_SIZE;
    }
  }
  if ((changeMask & CHANGED_SIZE) != 0) {
    try {
      updateGeometrySize();
      updateTexture();
    }
 catch (    InstantiationException ex) {
      logger.warning("String_Node_Str");
      ex.printStackTrace();
      return;
    }
  }
  if ((changeMask & CHANGED_STACK) != 0) {
    updateStack();
  }
  if ((changeMask & (CHANGED_TRANSFORM | CHANGED_STACK)) != 0) {
    updateTransform();
  }
  if ((changeMask & CHANGED_TOP_LEVEL) != 0) {
    if (topLevel) {
      if (frame == null) {
        frame=(FrameWorldDefault)window.getApp().getAppType().getGuiFactory().createFrame(this);
      }
    }
 else {
      if (frame != null) {
        frame.cleanup();
        frame=null;
      }
    }
  }
  if ((changeMask & CHANGED_TITLE) != 0) {
    if (frame != null) {
      frame.setTitle(((Window2D)window).getTitle());
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}"
 */
@Override public void update(int changeMask){
  if ((changeMask & CHANGED_VISIBILITY) != 0) {
    updateVisibility();
    if (visible && geometryObj == null) {
      changeMask|=CHANGED_SIZE;
    }
  }
  if ((changeMask & CHANGED_TOP_LEVEL) != 0) {
    if (topLevel) {
      if (frame == null) {
        frame=(FrameWorldDefault)window.getApp().getAppType().getGuiFactory().createFrame(this);
      }
    }
 else {
      if (frame != null) {
        frame.cleanup();
        frame=null;
      }
    }
  }
  if ((changeMask & CHANGED_SIZE) != 0) {
    try {
      updateGeometrySize();
      updateTexture();
    }
 catch (    InstantiationException ex) {
      logger.warning("String_Node_Str");
      ex.printStackTrace();
      return;
    }
  }
  if ((changeMask & CHANGED_STACK) != 0) {
    updateStack();
  }
  if ((changeMask & (CHANGED_TRANSFORM | CHANGED_STACK)) != 0) {
    updateTransform();
  }
  if ((changeMask & CHANGED_TITLE) != 0) {
    if (frame != null) {
      frame.setTitle(((Window2D)window).getTitle());
    }
  }
}
Program: 46326
Project: 46326
Buggy source:
/** 
 * Update the view's geometry (for a size change) 
 */
protected void updateGeometrySize() throws InstantiationException {
  if (!visible)   return;
  Window2D window2D=(Window2D)window;
  Vector2f pixelScale=window2D.getPixelScale();
  width=pixelScale.x * (float)window2D.getWidth();
  height=pixelScale.y * (float)window2D.getHeight();
  if (geometryObj == null) {
    setGeometry(new ViewGeometryObjectDefault(this));
  }
 else {
    geometryObj.updateSize();
  }
  if (frame != null) {
    frame.update();
  }
}

Fixed version (ground truth):
/** 
 * Update the view's geometry (for a size change) 
 */
protected void updateGeometrySize() throws InstantiationException {
  Window2D window2D=(Window2D)window;
  Vector2f pixelScale=window2D.getPixelScale();
  width=pixelScale.x * (float)window2D.getWidth();
  height=pixelScale.y * (float)window2D.getHeight();
  if (geometryObj == null) {
    setGeometry(new ViewGeometryObjectDefault(this));
  }
 else {
    geometryObj.updateSize();
  }
  if (frame != null) {
    frame.update();
  }
}
Program: 46327
Project: 46327
Buggy source:
/** 
 * Main method that has a simple command-line interface to test the database. The usage is: java AssetDB [COMMAND] [ARGS], where COMMAND can be: <p> LIST: Lists all of the entries in the database ADD: Add an entry to the database, followed by the required data fields
 */
public static void main(String[] args) throws URISyntaxException {
  AssetDB db=new AssetDB();
  logger.fine("String_Node_Str" + db.getDatabaseLocation());
  logger.fine("String_Node_Str" + db.getDatabaseUrl());
  logger.fine("String_Node_Str" + db.isConnected());
  db.listAssets();
  db.disconnect();
}

Fixed version (ground truth):
/** 
 * Main method that has a simple command-line interface to test the database. The usage is: java AssetDB [COMMAND] [ARGS], where COMMAND can be: <p> LIST: Lists all of the entries in the database ADD: Add an entry to the database, followed by the required data fields
 */
public static void main(String[] args) throws URISyntaxException {
  AssetDB db=new AssetDB();
  logger.warning("String_Node_Str" + db.getDatabaseLocation());
  logger.warning("String_Node_Str" + db.getDatabaseUrl());
  logger.warning("String_Node_Str" + db.isConnected());
  db.listAssets();
  db.disconnect();
}
Program: 46328
Project: 46328
Buggy source:
/** 
 * Prints out all of the assets to stdout
 */
public void listAssets(){
  try {
    Statement queryStatement=dbConnection.createStatement();
    ResultSet result=queryStatement.executeQuery(strGetListEntries);
    logger.fine("String_Node_Str");
    while (result.next()) {
      StringBuilder sb=new StringBuilder();
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getLong("String_Node_Str") + "String_Node_Str");
      sb.append(result.getLong("String_Node_Str") + "String_Node_Str");
      logger.fine(sb.toString());
    }
    logger.fine("String_Node_Str");
  }
 catch (  SQLException sqle) {
    sqle.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Prints out all of the assets to stdout
 */
public void listAssets(){
  try {
    Statement queryStatement=dbConnection.createStatement();
    ResultSet result=queryStatement.executeQuery(strGetListEntries);
    logger.warning("String_Node_Str");
    while (result.next()) {
      StringBuilder sb=new StringBuilder();
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getString("String_Node_Str") + "String_Node_Str");
      sb.append(result.getLong("String_Node_Str") + "String_Node_Str");
      sb.append(result.getLong("String_Node_Str") + "String_Node_Str");
      logger.warning(sb.toString());
    }
    logger.warning("String_Node_Str");
  }
 catch (  SQLException sqle) {
    sqle.printStackTrace();
  }
}
Program: 46329
Project: 46329
Buggy source:
@Override public int hashCode(){
  int hash=7;
  hash=29 * hash + (this.assetURI != null ? this.assetURI.getURI().hashCode() : 0);
  hash=29 * hash + (this.checksum != null ? this.checksum.hashCode() : 0);
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hash=7;
  hash=29 * hash + (this.assetURI != null ? this.assetURI.hashCode() : 0);
  hash=29 * hash + (this.checksum != null ? this.checksum.hashCode() : 0);
  return hash;
}
Program: 46330
Project: 46330
Buggy source:
/** 
 * Returns true if the given asset ID equals this ID, false if not. Asset IDs are equal if both assets have the same URI and checksum
 */
@Override public boolean equals(Object obj){
  if (!(obj instanceof AssetID)) {
    return false;
  }
  AssetID assetID=(AssetID)obj;
  if (this == assetID) {
    return true;
  }
  if (this.assetURI.getURI().equals(this.getResourceURI().getURI()) == false) {
    return false;
  }
  if (this.checksum == null && assetID.checksum != null) {
    return false;
  }
 else   if (this.checksum == null && assetID.checksum == null) {
    return true;
  }
  if (this.checksum.equals(assetID.checksum) == false) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Returns true if the given asset ID equals this ID, false if not. Asset IDs are equal if both assets have the same URI and checksum
 */
@Override public boolean equals(Object obj){
  if (!(obj instanceof AssetID)) {
    return false;
  }
  AssetID assetID=(AssetID)obj;
  if (this == assetID) {
    return true;
  }
  if (this.assetURI.equals(this.getResourceURI()) == false) {
    return false;
  }
  if (this.checksum == null && assetID.checksum != null) {
    return false;
  }
 else   if (this.checksum == null && assetID.checksum == null) {
    return true;
  }
  if (this.checksum.equals(assetID.checksum) == false) {
    return false;
  }
  return true;
}
Program: 46331
Project: 46331
Buggy source:
/** 
 * Given the unique ID for the asset, return the name of its cache file. This method accounts for the structure of the cache imposed because of different sorts of uri's. For example, all assets part of some module should be cached in a subdirectory pertaining only to that module, so that the file does not conflict with similarly-named files in other modules.
 */
private String getAssetCacheFileName(AssetID assetID){
  String basePath=cacheDir.getAbsolutePath();
  String relativePath=assetID.getResourceURI().getRelativeCachePath();
  String checksum=assetID.getChecksum();
  return basePath + File.separator + relativePath+ "String_Node_Str"+ checksum;
}

Fixed version (ground truth):
/** 
 * Given the unique ID for the asset, return the name of its cache file. This method accounts for the structure of the cache imposed because of different sorts of uri's. For example, all assets part of some module should be cached in a subdirectory pertaining only to that module, so that the file does not conflict with similarly-named files in other modules.
 */
private String getAssetCacheFileName(AssetID assetID){
  String basePath=cacheDir.getAbsolutePath();
  String relativePath=assetID.getResourceURI().getRelativeCachePath();
  String checksum=assetID.getChecksum();
  return basePath + File.separator + relativePath+ File.separator+ checksum;
}
Program: 46333
Project: 46333
Buggy source:
/** 
 * Set up the classloader with module jar URLs for this server
 * @param serverURL the URL of the server to connect to
 * @return the classloader setup with this server's URLs
 */
private ClassLoader setupClassLoader(String serverURL){
  ModulePluginList list=ModuleUtils.fetchPluginJars(serverURL);
  List<URL> urls=new ArrayList<URL>();
  if (list == null) {
    logger.warning("String_Node_Str" + "String_Node_Str");
    return getClass().getClassLoader();
  }
  for (  JarURI uri : list.getJarURIs()) {
    try {
      urls.add(uri.getURI().toURL());
    }
 catch (    Exception excp) {
      excp.printStackTrace();
    }
  }
  return new URLClassLoader(urls.toArray(new URL[0]),getClass().getClassLoader());
}

Fixed version (ground truth):
/** 
 * Set up the classloader with module jar URLs for this server
 * @param serverURL the URL of the server to connect to
 * @return the classloader setup with this server's URLs
 */
private ClassLoader setupClassLoader(String serverURL){
  ModulePluginList list=ModuleUtils.fetchPluginJars(serverURL);
  List<URL> urls=new ArrayList<URL>();
  if (list == null) {
    logger.warning("String_Node_Str" + "String_Node_Str");
    return getClass().getClassLoader();
  }
  for (  JarURI uri : list.getJarURIs()) {
    try {
      urls.add(uri.toURL());
    }
 catch (    Exception excp) {
      excp.printStackTrace();
    }
  }
  return new URLClassLoader(urls.toArray(new URL[0]),getClass().getClassLoader());
}
Program: 46334
Project: 46334
Buggy source:
/** 
 * Constructor which takes the module name, relative path and server name/port
 */
public AssetURI(String moduleName,String path,String server) throws URISyntaxException {
  super("String_Node_Str" + moduleName + "String_Node_Str"+ server+ "String_Node_Str"+ path);
}

Fixed version (ground truth):
/** 
 * Constructor which takes the module name, host name/port, and asset path. The host name/port is given as: <host name>:<port>
 */
public AssetURI(String moduleName,String hostNameAndPort,String assetPath){
  super("String_Node_Str",moduleName,hostNameAndPort,assetPath);
}
Program: 46335
Project: 46335
Buggy source:
/** 
 * Annotates this URI with a <server name>:<port>. Returns a new instance of AssetURI with this annotation
 * @param server The <server name>:<port>
 * @return A new AssetURI with annotated with the <server name>:<port>
 * @throw URISyntaxException If the URI is not properly formed
 */
public AssetURI getAnnotatedURI(String server) throws URISyntaxException {
  return new AssetURI(this.getModuleName(),this.getRawPath(),server);
}

Fixed version (ground truth):
/** 
 * Annotates this URI with a <server name>:<port>. Returns a new instance of AssetURI with this annotation
 * @param hostNameAndPort The <server name>:<port>
 * @return A new AssetURI with annotated with the <server name>:<port>
 * @throw URISyntaxException If the URI is not properly formed
 */
public AssetURI getAnnotatedURI(String hostNameAndPort) throws URISyntaxException {
  return new AssetURI(this.getModuleName(),hostNameAndPort,this.getAssetPath());
}
Program: 46336
Project: 46336
Buggy source:
/** 
 * Returns the relative path of the resource specified by the URI. The relative path does not being with any forward "/".
 * @return The relative path within the URI
 */
public String getRelativePath(){
  return "String_Node_Str" + this.getURI().getPath();
}

Fixed version (ground truth):
/** 
 * Returns the relative path of the resource specified by the URI. The relative path does not being with any forward "/".
 * @return The relative path within the URI
 */
public String getRelativePath(){
  return "String_Node_Str" + this.getAssetPath();
}
Program: 46337
Project: 46337
Buggy source:
/** 
 * Constructor takes the name of the server session 
 */
public AssetURIAdapter(String serverName){
  this.serverName=serverName;
}

Fixed version (ground truth):
/** 
 * Constructor takes the host name and port as: <host name>:<port>
 */
public AssetURIAdapter(String hostNameAndPort){
  this.hostNameAndPort=hostNameAndPort;
}
Program: 46338
Project: 46338
Buggy source:
@Override public AssetURI unmarshal(String uri) throws Exception {
  AssetURI assetURI=new AssetURI(uri);
  if (uri != null) {
    String moduleName=assetURI.getModuleName();
    String rawPath=assetURI.getRawPath();
    assetURI=new AssetURI(moduleName,rawPath,serverName);
  }
  return assetURI;
}

Fixed version (ground truth):
@Override public AssetURI unmarshal(String uri) throws Exception {
  AssetURI assetURI=new AssetURI(uri);
  if (uri != null) {
    String moduleName=assetURI.getModuleName();
    String assetPath=assetURI.getAssetPath();
    assetURI=new AssetURI(moduleName,hostNameAndPort,assetPath);
  }
  return assetURI;
}
Program: 46339
Project: 46339
Buggy source:
/** 
 * Constructor which takes the module name, relative path and server name/port
 */
public JarURI(String moduleName,String path,String server) throws URISyntaxException {
  super("String_Node_Str" + moduleName + "String_Node_Str"+ server+ "String_Node_Str"+ path);
}

Fixed version (ground truth):
/** 
 * Constructor which takes the module name, host name and host port, and asset path. This host name and port is given as: <host name>:<port>
 */
public JarURI(String moduleName,String hostNameAndPort,String assetPath){
  super("String_Node_Str",moduleName,hostNameAndPort,assetPath);
}
Program: 46340
Project: 46340
Buggy source:
/** 
 * Returns the relative path of the resource specified by the URI. The relative path does not being with any forward "/".
 * @return The relative path within the URI
 */
public String getRelativePath(){
  String relativePath=this.getURI().getPath();
  if (relativePath.startsWith("String_Node_Str") == true) {
    relativePath=relativePath.substring(1);
  }
  return relativePath;
}

Fixed version (ground truth):
/** 
 * Returns the relative path of the resource specified by the URI. The relative path does not being with any forward "/".
 * @return The relative path within the URI
 */
public String getRelativePath(){
  return this.getAssetPath();
}
Program: 46341
Project: 46341
Buggy source:
@Override public JarURI unmarshal(String uri) throws Exception {
  JarURI jarURI=new JarURI(uri);
  if (uri != null) {
    String moduleName=jarURI.getModuleName();
    String rawPath=jarURI.getRawPath();
    jarURI=new JarURI(moduleName,rawPath,serverName);
  }
  return jarURI;
}

Fixed version (ground truth):
@Override public JarURI unmarshal(String uri) throws Exception {
  JarURI jarURI=new JarURI(uri);
  if (uri != null) {
    String moduleName=jarURI.getModuleName();
    String assetPath=jarURI.getAssetPath();
    jarURI=new JarURI(moduleName,hostNameAndPort,assetPath);
  }
  return jarURI;
}
Program: 46342
Project: 46342
Buggy source:
/** 
 * Constructor takes the name of the server session 
 */
public JarURIAdapter(String serverName){
  this.serverName=serverName;
}

Fixed version (ground truth):
/** 
 * Constructor takes the host name and port as: <host name>:<port>
 */
public JarURIAdapter(String hostNameAndPort){
  this.hostNameAndPort=hostNameAndPort;
}
Program: 46344
Project: 46344
Buggy source:
@Override public AssetURI unmarshal(String uri) throws Exception {
  AssetURI assetURI=new AssetURI(uri);
  if (uri != null) {
    String moduleName=assetURI.getModuleName();
    String rawPath=assetURI.getRawPath();
    assetURI=new AssetURI(moduleName,serverName,rawPath);
  }
  return assetURI;
}

Fixed version (ground truth):
@Override public AssetURI unmarshal(String uri) throws Exception {
  AssetURI assetURI=new AssetURI(uri);
  if (uri != null) {
    String moduleName=assetURI.getModuleName();
    String rawPath=assetURI.getRawPath();
    assetURI=new AssetURI(moduleName,rawPath,serverName);
  }
  return assetURI;
}
Program: 46345
Project: 46345
Buggy source:
public void viewEnterExit(boolean entered,Cell cell,BoundingVolume proximityVolume,int proximityIndex){
  logger.warning("String_Node_Str" + cell + "String_Node_Str"+ entered);
  ConeOfSilenceEnterCellMessage message=new ConeOfSilenceEnterCellMessage(cell.getCellID(),entered);
  channelComp.send(message);
}

Fixed version (ground truth):
public void viewEnterExit(boolean entered,Cell cell,BoundingVolume proximityVolume,int proximityIndex){
  logger.warning("String_Node_Str" + cell + "String_Node_Str"+ entered);
  ConeOfSilenceEnterCellMessage message=new ConeOfSilenceEnterCellMessage(coneOfSilenceCell.getCellID(),cell.getCellID(),entered);
  channelComp.send(message);
}
Program: 46346
Project: 46346
Buggy source:
public ConeOfSilenceEnterCellMessage(CellID cellID,boolean entered){
  super(cellID);
  this.entered=entered;
}

Fixed version (ground truth):
public ConeOfSilenceEnterCellMessage(CellID coneCellID,CellID avatarCellID,boolean entered){
  super(coneCellID);
  this.avatarCellID=avatarCellID;
  this.entered=entered;
}
Program: 46347
Project: 46347
Buggy source:
public ConeOfSilenceCellMO(Vector3f center,float size){
  super(new BoundingBox(new Vector3f(),size,size,size),new CellTransform(null,center));
  if (initialized == false) {
    addComponent(new ChannelComponentMO(this));
  }
}

Fixed version (ground truth):
public ConeOfSilenceCellMO(Vector3f center,float size){
  super(new BoundingBox(new Vector3f(),size,size,size),new CellTransform(null,center));
  addComponent(new ChannelComponentMO(this));
}
Program: 46348
Project: 46348
Buggy source:
@Override public void setupCell(BasicCellSetup setup){
  super.setupCell(setup);
  ConeOfSilenceCellSetup css=(ConeOfSilenceCellSetup)setup;
  if (initialized == false) {
    new ConeOfSilenceMessageHandler(this,css.getName());
    initialized=true;
  }
}

Fixed version (ground truth):
@Override public void setupCell(BasicCellSetup setup){
  super.setupCell(setup);
  ConeOfSilenceCellSetup css=(ConeOfSilenceCellSetup)setup;
  if (haveMessageHandler == false) {
    haveMessageHandler=true;
    new ConeOfSilenceMessageHandler(this,css.getName());
  }
}
Program: 46349
Project: 46349
Buggy source:
public ConeOfSilenceMessageHandler(ConeOfSilenceCellMO coneOfSilenceCellMO,String name){
  this.name=name;
  coneOfSilenceCellMORef=AppContext.getDataManager().createReference((ConeOfSilenceCellMO)CellManagerMO.getCell(coneOfSilenceCellMO.getCellID()));
  ChannelComponentMO channelComponent=(ChannelComponentMO)coneOfSilenceCellMO.getComponent(ChannelComponentMO.class);
  if (channelComponent == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  channelComponentRef=AppContext.getDataManager().createReference(channelComponent);
  channelComponent.addMessageReceiver(ConeOfSilenceEnterCellMessage.class,this);
}

Fixed version (ground truth):
public ConeOfSilenceMessageHandler(ConeOfSilenceCellMO coneOfSilenceCellMO,String name){
  this.name=name;
  coneOfSilenceCellMORef=AppContext.getDataManager().createReference((ConeOfSilenceCellMO)CellManagerMO.getCell(coneOfSilenceCellMO.getCellID()));
  ChannelComponentMO channelComponent=(ChannelComponentMO)coneOfSilenceCellMO.getComponent(ChannelComponentMO.class);
  if (channelComponent == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  channelComponent.addMessageReceiver(ConeOfSilenceEnterCellMessage.class,this);
  channelComponentRef=AppContext.getDataManager().createReference(channelComponent);
}
Program: 46350
Project: 46350
Buggy source:
public void cellEntered(ConeOfSilenceEnterCellMessage msg){
  String callId=msg.getCellID().toString();
  ConeOfSilenceCellSetup setup=(ConeOfSilenceCellSetup)coneOfSilenceCellMORef.get().getCellMOSetup();
  logger.warning(callId + "String_Node_Str" + name);
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  Player player=vm.getPlayer(callId);
  AudioGroup audioGroup=vm.getAudioGroup(name);
  audioGroup.addPlayer(player,new AudioGroupPlayerInfo(true,AudioGroupPlayerInfo.ChatType.SECRET));
  player.attenuateOtherGroups(audioGroup,0,0);
}

Fixed version (ground truth):
public void cellEntered(ConeOfSilenceEnterCellMessage msg){
  String callId=msg.getAvatarCellID().toString();
  ConeOfSilenceCellSetup setup=(ConeOfSilenceCellSetup)coneOfSilenceCellMORef.get().getCellMOSetup();
  logger.warning(callId + "String_Node_Str" + name);
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  Player player=vm.getPlayer(callId);
  if (player == null) {
    logger.warning("String_Node_Str" + callId);
    return;
  }
  AudioGroup audioGroup=vm.getAudioGroup(name);
  if (audioGroup == null) {
    AudioGroupSetup ags=new AudioGroupSetup();
    audioGroup=vm.createAudioGroup(name,ags);
  }
  audioGroup.addPlayer(player,new AudioGroupPlayerInfo(true,AudioGroupPlayerInfo.ChatType.SECRET));
  player.attenuateOtherGroups(audioGroup,0,0);
}
Program: 46351
Project: 46351
Buggy source:
public void cellExited(ConeOfSilenceEnterCellMessage msg){
  String callId=msg.getCellID().toString();
  logger.warning(callId + "String_Node_Str" + name);
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  AudioGroup audioGroup=vm.getAudioGroup(name);
  if (audioGroup == null) {
    logger.warning("String_Node_Str" + name);
    return;
  }
  Player player=vm.getPlayer(callId);
  audioGroup.removePlayer(player);
  player.attenuateOtherGroups(audioGroup,AudioGroup.DEFAULT_SPEAKING_ATTENUATION,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
}

Fixed version (ground truth):
public void cellExited(ConeOfSilenceEnterCellMessage msg){
  String callId=msg.getAvatarCellID().toString();
  logger.warning(callId + "String_Node_Str" + name);
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  AudioGroup audioGroup=vm.getAudioGroup(name);
  if (audioGroup == null) {
    logger.warning("String_Node_Str" + name);
    return;
  }
  Player player=vm.getPlayer(callId);
  if (player == null) {
    logger.warning("String_Node_Str" + callId);
    return;
  }
  audioGroup.removePlayer(player);
  if (audioGroup.getPlayers().size() == 0) {
    vm.removeAudioGroup(name);
  }
  player.attenuateOtherGroups(audioGroup,AudioGroup.DEFAULT_SPEAKING_ATTENUATION,AudioGroup.DEFAULT_LISTEN_ATTENUATION);
}
Program: 46352
Project: 46352
Buggy source:
public PhoneCellMO(Vector3f center,float size){
  super(new BoundingBox(new Vector3f(),size,size,size),new CellTransform(null,center));
  if (initialized == false) {
    addComponent(new ChannelComponentMO(this));
    new PhoneMessageHandler(this);
    initialized=true;
  }
}

Fixed version (ground truth):
public PhoneCellMO(Vector3f center,float size){
  super(new BoundingBox(new Vector3f(),size,size,size),new CellTransform(null,center));
  addComponent(new ChannelComponentMO(this));
  new PhoneMessageHandler(this);
}
Program: 46353
Project: 46353
Buggy source:
public void cellEntered(ConeOfSilenceEnterCellMessage msg){
  String callId=msg.getAvatarCellID().toString();
  ConeOfSilenceCellSetup setup=(ConeOfSilenceCellSetup)coneOfSilenceCellMORef.get().getCellMOSetup();
  logger.warning(callId + "String_Node_Str" + name);
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  Player player=vm.getPlayer(callId);
  if (player == null) {
    logger.warning("String_Node_Str" + callId);
    return;
  }
  AudioGroup audioGroup=vm.getAudioGroup(name);
  if (audioGroup == null) {
    AudioGroupSetup ags=new AudioGroupSetup();
    audioGroup=vm.createAudioGroup(name,ags);
  }
  audioGroup.addPlayer(player,new AudioGroupPlayerInfo(true,AudioGroupPlayerInfo.ChatType.SECRET));
  player.attenuateOtherGroups(audioGroup,0,0);
}

Fixed version (ground truth):
public void cellEntered(ConeOfSilenceEnterCellMessage msg){
  String callId=msg.getAvatarCellID().toString();
  ConeOfSilenceCellSetup setup=(ConeOfSilenceCellSetup)coneOfSilenceCellMORef.get().getCellMOSetup();
  logger.warning(callId + "String_Node_Str" + name);
  VoiceManager vm=AppContext.getManager(VoiceManager.class);
  Player player=vm.getPlayer(callId);
  if (player == null) {
    logger.warning("String_Node_Str" + callId);
    return;
  }
  AudioGroup audioGroup=vm.getAudioGroup(name);
  if (audioGroup == null) {
    AudioGroupSetup ags=new AudioGroupSetup();
    ags.spatializer=new FullVolumeSpatializer();
    ags.spatializer.setAttenuator(DefaultSpatializer.DEFAULT_MAXIMUM_VOLUME);
    audioGroup=vm.createAudioGroup(name,ags);
  }
  audioGroup.addPlayer(player,new AudioGroupPlayerInfo(true,AudioGroupPlayerInfo.ChatType.SECRET));
  player.attenuateOtherGroups(audioGroup,0,0);
}
Program: 46354
Project: 46354
Buggy source:
public void createCell(CellMO cellMO){
  final BigInteger cellCacheId=(cellMO instanceof ViewCellMO) ? AppContext.getDataManager().createReference(((ViewCellMO)cellMO).getCellCache()).getId() : null;
  final Identity identity=proxy.getCurrentOwner();
  scheduleChange(new Change(cellMO.getCellID(),cellMO.getLocalBounds(),cellMO.getLocalTransform(null)){
    public void run(){
      SpatialCell sc=universe.createSpatialCell(cellID,cellCacheId,identity);
      sc.setLocalBounds(localBounds);
      sc.setLocalTransform(localTransform,identity);
    }
  }
);
}

Fixed version (ground truth):
public void createCell(CellMO cellMO){
  final Class cellClazz=cellMO.getClass();
  final Identity identity=proxy.getCurrentOwner();
  final BigInteger dsID=AppContext.getDataManager().createReference(cellMO).getId();
  scheduleChange(new Change(cellMO.getCellID(),cellMO.getLocalBounds(),cellMO.getLocalTransform(null)){
    public void run(){
      SpatialCell sc=universe.createSpatialCell(cellID,dsID,cellClazz);
      sc.setLocalBounds(localBounds);
      sc.setLocalTransform(localTransform,identity);
    }
  }
);
}
Program: 46355
Project: 46355
Buggy source:
public void removeRootSpatialCell(SpatialCellImpl cell){
synchronized (rootCells) {
    rootCells.remove(cell);
  }
synchronized (viewCaches) {
    cell.removeViewCache(viewCaches,this);
    for (    ViewCache cache : viewCaches)     cache.rootCellRemoved(cell);
  }
}

Fixed version (ground truth):
public void removeRootSpatialCell(SpatialCellImpl cell){
  logger.fine("String_Node_Str" + cell.getCellID() + "String_Node_Str"+ getName());
synchronized (rootCells) {
    rootCells.remove(cell);
  }
synchronized (viewCaches) {
    cell.removeViewCache(viewCaches,this);
    for (    ViewCache cache : viewCaches)     cache.rootCellRemoved(cell);
  }
}
Program: 46356
Project: 46356
Buggy source:
public void addRootSpatialCell(SpatialCellImpl cell){
synchronized (rootCells) {
    rootCells.add(cell);
  }
synchronized (viewCaches) {
    cell.addViewCache(viewCaches,this);
    for (    ViewCache cache : viewCaches)     cache.rootCellAdded(cell);
  }
}

Fixed version (ground truth):
public void addRootSpatialCell(SpatialCellImpl cell){
  logger.fine("String_Node_Str" + cell.getCellID() + "String_Node_Str"+ getName());
synchronized (rootCells) {
    rootCells.add(cell);
  }
synchronized (viewCaches) {
    cell.addViewCache(viewCaches,this);
    for (    ViewCache cache : viewCaches)     cache.rootCellAdded(cell);
  }
}
Program: 46358
Project: 46358
Buggy source:
public SpatialCellImpl(CellID id){
  this.cellID=id;
}

Fixed version (ground truth):
public SpatialCellImpl(CellID id,BigInteger dsID){
  this.cellID=id;
  this.dsID=dsID;
}
Program: 46359
Project: 46359
Buggy source:
/** 
 * Compute the world bounds for this node from the local bounds and world transform
 */
private void computeWorldBounds(){
  worldBounds=localBounds.clone(worldBounds);
  worldTransform.transform(worldBounds);
}

Fixed version (ground truth):
/** 
 * Compute the world bounds for this node from the local bounds and world transform
 */
private void computeWorldBounds(){
  worldBounds=localBounds.clone(worldBounds);
  worldTransform.transform(worldBounds);
  if (isRoot) {
    Iterable<Space> it=UniverseImpl.getUniverse().getSpaceManager().getEnclosingSpace(worldBounds);
    for (    Space s : it) {
      if (!spaces.contains(s)) {
        s.addRootSpatialCell(this);
        spaces.add(s);
      }
    }
  }
}
Program: 46360
Project: 46360
Buggy source:
public void destroy(){
  acquireRootWriteLock();
  SpatialCellImpl root=(SpatialCellImpl)getRoot();
  if (root == null)   return;
  Iterable<ViewCache> caches=root.viewCache.keySet();
  for (  ViewCache cache : caches) {
    cache.cellDestroyed(this);
  }
  releaseRootWriteLock();
}

Fixed version (ground truth):
public void destroy(){
  acquireRootWriteLock();
  SpatialCellImpl root=(SpatialCellImpl)getRoot();
  if (root == null)   return;
  Iterable<ViewCache> caches=root.viewCache.keySet();
  for (  ViewCache cache : caches) {
    cache.cellDestroyed(this);
  }
  if (isRoot) {
    for (    Space space : spaces) {
      space.removeRootSpatialCell(this);
    }
  }
  releaseRootWriteLock();
}
Program: 46361
Project: 46361
Buggy source:
/** 
 * Set the root for this node and all it's children
 * @param root
 */
void setRoot(SpatialCell root,Identity identity){
  if (root == this) {
    readWriteLock=new ReentrantReadWriteLock(true);
    viewCache=new HashMap();
    worldTransform=localTransform.clone(null);
    computeWorldBounds();
    if (children != null) {
      for (      SpatialCellImpl s : children)       worldBounds.mergeLocal(s.updateWorldTransform(identity));
    }
  }
  this.rootNode=(SpatialCellImpl)root;
  acquireRootWriteLock();
  if (children != null) {
    for (    SpatialCellImpl s : children)     s.setRoot(root,identity);
  }
  releaseRootWriteLock();
}

Fixed version (ground truth):
/** 
 * Set the root for this node and all it's children
 * @param root
 */
void setRoot(SpatialCell root,Identity identity){
  this.rootNode=(SpatialCellImpl)root;
  if (root == this) {
    readWriteLock=new ReentrantReadWriteLock(true);
    viewCache=new HashMap();
    isRoot=true;
    spaces=new HashSet();
    acquireRootWriteLock();
    worldTransform=localTransform.clone(null);
    computeWorldBounds();
    if (children != null) {
      for (      SpatialCellImpl s : children)       worldBounds.mergeLocal(s.updateWorldTransform(identity));
    }
  }
  if (isRoot) {
    if (root == null) {
      for (      Space s : spaces) {
        s.removeRootSpatialCell(this);
      }
      spaces.clear();
    }
  }
  if (children != null) {
    for (    SpatialCellImpl s : children)     s.setRoot(root,identity);
  }
  if (root == this) {
    releaseRootWriteLock();
  }
}
Program: 46362
Project: 46362
Buggy source:
/** 
 * Create a Spatial cell
 * @param id
 * @param cellCacheId the id of the view cell cache if the cell is a ViewCell, otherwise null
 * @param identity
 * @return
 */
public SpatialCell createSpatialCell(CellID id,BigInteger cellCacheId,Identity identity);

Fixed version (ground truth):
/** 
 * Create a Spatial cell
 * @param id
 * @param cellCacheId the id of the view cell cache if the cell is a ViewCell, otherwise null
 * @param identity
 * @return
 */
public SpatialCell createSpatialCell(CellID id,BigInteger dsID,Class cellClass);
Program: 46363
Project: 46363
Buggy source:
public void removeRootSpatialCell(CellID cellID,Identity identity){
  logger.fine("String_Node_Str" + cellID);
  SpatialCellImpl cellImpl=(SpatialCellImpl)getSpatialCell(cellID);
  if (cellImpl == null) {
    logger.warning("String_Node_Str" + cellID);
    return;
  }
  cellImpl.setRoot(null,identity);
  cellImpl.acquireRootReadLock();
  Iterable<Space> it=spaceManager.getEnclosingSpace(cellImpl.getWorldBounds());
  for (  Space s : it) {
    s.removeRootSpatialCell(cellImpl);
  }
  cellImpl.releaseRootReadLock();
}

Fixed version (ground truth):
public void removeRootSpatialCell(CellID cellID,Identity identity){
  logger.fine("String_Node_Str" + cellID);
  SpatialCellImpl cellImpl=(SpatialCellImpl)getSpatialCell(cellID);
  if (cellImpl == null) {
    logger.warning("String_Node_Str" + cellID);
    return;
  }
  cellImpl.setRoot(null,identity);
}
Program: 46364
Project: 46364
Buggy source:
public void addRootSpatialCell(CellID cellID,Identity identity){
  SpatialCellImpl cellImpl=(SpatialCellImpl)getSpatialCell(cellID);
  cellImpl.setRoot(cellImpl,identity);
  cellImpl.acquireRootReadLock();
  System.out.println("String_Node_Str" + cellImpl.getWorldBounds());
  Iterable<Space> it=spaceManager.getEnclosingSpace(cellImpl.getWorldBounds());
  for (  Space s : it) {
    System.out.println("String_Node_Str" + s.getName());
    s.addRootSpatialCell(cellImpl);
  }
  cellImpl.releaseRootReadLock();
}

Fixed version (ground truth):
public void addRootSpatialCell(CellID cellID,Identity identity){
  SpatialCellImpl cellImpl=(SpatialCellImpl)getSpatialCell(cellID);
  cellImpl.setRoot(cellImpl,identity);
}
Program: 46365
Project: 46365
Buggy source:
public void viewLogin(CellID viewCellId,BigInteger cellCacheId,Identity identity){
  ViewCellImpl viewCell;
synchronized (cells) {
    viewCell=(ViewCellImpl)cells.get(viewCellId);
  }
  System.err.println("String_Node_Str" + viewCell + "String_Node_Str"+ viewCellId);
  ViewCache viewCache=new ViewCache(viewCell,spaceManager,identity,cellCacheId);
  viewCell.setViewCache(viewCache);
  viewCache.login();
}

Fixed version (ground truth):
public void viewLogin(CellID viewCellID,BigInteger cellCacheId,Identity identity){
  ViewCellImpl viewCell;
synchronized (cells) {
    viewCell=(ViewCellImpl)cells.get(viewCellID);
  }
  logger.fine("String_Node_Str" + viewCell + "String_Node_Str"+ viewCellID);
  ViewCache viewCache=new ViewCache(viewCell,spaceManager,identity,cellCacheId);
  viewCell.setViewCache(viewCache);
  viewCache.login();
}
Program: 46366
Project: 46366
Buggy source:
public void viewLogout(CellID viewCellId){
  ViewCellImpl viewCell;
synchronized (cells) {
    viewCell=(ViewCellImpl)cells.get(viewCellId);
  }
  viewCell.getViewCache().logout();
}

Fixed version (ground truth):
public void viewLogout(CellID viewCellID){
  logger.fine("String_Node_Str" + viewCellID);
  ViewCellImpl viewCell;
synchronized (cells) {
    viewCell=(ViewCellImpl)cells.get(viewCellID);
  }
  viewCell.getViewCache().logout();
}
Program: 46367
Project: 46367
Buggy source:
public SpatialCell createSpatialCell(CellID id,BigInteger cellCacheId,Identity identity){
  logger.fine("String_Node_Str" + id);
  SpatialCellImpl ret;
  if (cellCacheId != null) {
    ret=new ViewCellImpl(id,spaceManager,identity,cellCacheId);
  }
 else   ret=new SpatialCellImpl(id);
synchronized (cells) {
    cells.put(id,ret);
  }
  return ret;
}

Fixed version (ground truth):
public SpatialCell createSpatialCell(CellID id,BigInteger dsID,Class cellClass){
  logger.fine("String_Node_Str" + id + "String_Node_Str"+ dsID);
  SpatialCellImpl ret;
  if (ViewCellMO.class.isAssignableFrom(cellClass)) {
    ret=new ViewCellImpl(id,spaceManager,dsID);
  }
 else   ret=new SpatialCellImpl(id,dsID);
synchronized (cells) {
    cells.put(id,ret);
  }
  return ret;
}
Program: 46368
Project: 46368
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected Node createSceneGraph(Entity entity){
  System.err.println("String_Node_Str" + cell.getLocalTransform());
  return rootNode;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected Node createSceneGraph(Entity entity){
  RenderComponent rc=ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(rootNode);
  entity.addComponent(RenderComponent.class,rc);
  rc.setEntity(entity);
  return rootNode;
}
Program: 46369
Project: 46369
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void attachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  getEntity().addEntity(viewWorld.getEntity());
  FrameWorldDefault frame=viewWorld.getFrame();
  if (frame != null) {
    getEntity().addEntity(frame.getEntity());
    frame.setParentEntity(getEntity());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void attachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  getEntity().addEntity(viewWorld.getEntity());
  viewWorld.setParentEntity(getEntity());
  AppCell cell=viewWorld.getCell();
  applyTransform(rootNode,cell.getLocalTransform());
  FrameWorldDefault frame=viewWorld.getFrame();
  if (frame != null) {
    getEntity().addEntity(frame.getEntity());
    frame.setParentEntity(getEntity());
  }
}
Program: 46370
Project: 46370
Buggy source:
static void printEntitySceneGraphs(Entity entity,int indentLevel){
  System.err.println("String_Node_Str");
  printIndentLevel(indentLevel);
  System.err.println("String_Node_Str" + entity);
  printIndentLevel(indentLevel);
  System.err.print("String_Node_Str");
  RenderComponent rc=(RenderComponent)entity.getComponent(RenderComponent.class);
  if (rc == null) {
    System.err.println("String_Node_Str");
  }
 else {
    Node sceneRoot=rc.getSceneRoot();
    System.err.println(sceneRoot);
    if (sceneRoot != null) {
      GraphicsUtils.printNode(sceneRoot);
    }
  }
  int numChildren=entity.numEntities();
  for (int i=0; i < numChildren; i++) {
    Entity child=entity.getEntity(i);
    printIndentLevel(indentLevel);
    System.err.println("String_Node_Str");
    printIndentLevel(indentLevel);
    System.err.println("String_Node_Str" + i + "String_Node_Str"+ child);
    printEntitySceneGraphs(child,indentLevel + 1);
    printIndentLevel(indentLevel);
    System.err.println("String_Node_Str");
  }
}

Fixed version (ground truth):
static void printEntitySceneGraphs(Entity entity,int indentLevel){
  printIndentLevel(indentLevel);
  System.err.println("String_Node_Str" + entity);
  printIndentLevel(indentLevel);
  System.err.print("String_Node_Str");
  RenderComponent rc=(RenderComponent)entity.getComponent(RenderComponent.class);
  if (rc == null) {
    System.err.println("String_Node_Str");
  }
 else {
    Node sceneRoot=rc.getSceneRoot();
    System.err.println(sceneRoot);
    if (sceneRoot != null) {
      GraphicsUtils.printNode(sceneRoot);
    }
  }
  int numChildren=entity.numEntities();
  for (int i=0; i < numChildren; i++) {
    Entity child=entity.getEntity(i);
    printIndentLevel(indentLevel);
    System.err.println("String_Node_Str");
    printIndentLevel(indentLevel);
    System.err.println("String_Node_Str" + i + "String_Node_Str"+ child);
    printEntitySceneGraphs(child,indentLevel + 1);
    printIndentLevel(indentLevel);
    System.err.println("String_Node_Str");
  }
}
Program: 46371
Project: 46371
Buggy source:
private static void appendSceneGraph(StringBuffer sb,int indentLevel,Node node){
  System.err.println("String_Node_Str");
  if (node == null)   return;
  appendLine(sb,indentLevel,node.toString());
  List<Spatial> childSpatials=node.getChildren();
  if (childSpatials == null)   return;
  for (  Spatial child : childSpatials) {
    appendLine(sb,indentLevel,"String_Node_Str");
    if (child instanceof Node) {
      appendLine(sb,indentLevel,"String_Node_Str" + child.toString());
      appendSceneGraph(sb,indentLevel + 1,(Node)child);
    }
 else {
      appendLine(sb,indentLevel,"String_Node_Str" + child.toString());
    }
    appendLine(sb,indentLevel,"String_Node_Str");
  }
}

Fixed version (ground truth):
private static void appendSceneGraph(StringBuffer sb,int indentLevel,Node node){
  if (node == null)   return;
  appendLine(sb,indentLevel,node.toString());
  List<Spatial> childSpatials=node.getChildren();
  if (childSpatials == null)   return;
  for (  Spatial child : childSpatials) {
    appendLine(sb,indentLevel,"String_Node_Str");
    if (child instanceof Node) {
      appendLine(sb,indentLevel,"String_Node_Str" + child.toString());
      appendSceneGraph(sb,indentLevel + 1,(Node)child);
    }
 else {
      appendLine(sb,indentLevel,"String_Node_Str" + child.toString());
    }
    appendLine(sb,indentLevel,"String_Node_Str");
  }
}
Program: 46372
Project: 46372
Buggy source:
/** 
 * Specify the parent entity of this component.
 */
public void setParentEntity(Entity parentEntity){
  if (parentEntity != null) {
    detachFromParentEntity();
  }
  this.parentEntity=parentEntity;
  if (this.parentEntity != null) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + this);
    System.err.println("String_Node_Str" + parentEntity);
    attachToParentEntity();
  }
}

Fixed version (ground truth):
/** 
 * Specify the parent entity of this component.
 */
public void setParentEntity(Entity parentEntity){
  if (parentEntity != null) {
    detachFromParentEntity();
  }
  this.parentEntity=parentEntity;
  if (this.parentEntity != null) {
    attachToParentEntity();
  }
}
Program: 46373
Project: 46373
Buggy source:
/** 
 * Construct this component's scene graph. This consists of the following nodes. parentEntity attachPoint -> localToCellNode -> Geometry (subclass provided)
 */
protected void initSceneGraph(){
  localToCellNode=new Node("String_Node_Str" + name);
  RenderComponent rc=ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(localToCellNode);
  entity.addComponent(RenderComponent.class,rc);
  rc.setEntity(entity);
  System.err.println("String_Node_Str" + rc);
  System.err.println("String_Node_Str" + getEntity());
  Geometry[] geoms=getGeometries();
  for (  Geometry geom : geoms) {
    localToCellNode.attachChild(geom);
  }
}

Fixed version (ground truth):
/** 
 * Construct this component's scene graph. This consists of the following nodes. parentEntity attachPoint -> localToCellNode -> Spatial, Spatial, etc. (subclass provided)
 */
protected void initSceneGraph(){
  localToCellNode=new Node("String_Node_Str" + name);
  RenderComponent rc=ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(localToCellNode);
  entity.addComponent(RenderComponent.class,rc);
  rc.setEntity(entity);
  Spatial[] spatials=getSpatials();
  for (  Spatial spatial : spatials) {
    localToCellNode.attachChild(spatial);
  }
}
Program: 46374
Project: 46374
Buggy source:
/** 
 * Attach this component's entity to its parent entity.
 */
protected void attachToParentEntity(){
  if (parentEntity != null) {
    parentEntity.addEntity(entity);
    RenderComponent rcParentEntity=(RenderComponent)parentEntity.getComponent(RenderComponent.class);
    RenderComponent rcEntity=(RenderComponent)entity.getComponent(RenderComponent.class);
    System.err.println("String_Node_Str" + rcEntity);
    System.err.println("String_Node_Str" + rcEntity.getEntity());
    ClientContextJME.getWorldManager().addEntity(rcEntity.getEntity());
    if (rcParentEntity != null && rcParentEntity.getSceneRoot() != null && rcEntity != null) {
      rcEntity.setAttachPoint(rcParentEntity.getSceneRoot());
    }
  }
}

Fixed version (ground truth):
/** 
 * Attach this component's entity to its parent entity.
 */
protected void attachToParentEntity(){
  if (parentEntity != null) {
    parentEntity.addEntity(entity);
    RenderComponent rcParentEntity=(RenderComponent)parentEntity.getComponent(RenderComponent.class);
    RenderComponent rcEntity=(RenderComponent)entity.getComponent(RenderComponent.class);
    if (rcParentEntity != null && rcParentEntity.getSceneRoot() != null && rcEntity != null) {
      rcEntity.setAttachPoint(rcParentEntity.getSceneRoot());
    }
  }
}