nus-yam/ex-repair huggingface dataset:
Program: 45882
Project: 45882
Buggy source:
/** 
 * Load and return an avatar given its configuration information.
 * @param avatarConfigInfo The avatar configuration info
 * @return The Avatar character
 */
private WlAvatarCharacter loadAvatar(AvatarConfigInfo avatarConfigInfo){
  LoadingInfo.startedLoading(cell.getCellID(),username);
  try {
    if (avatarConfigInfo != null) {
      logger.warning("String_Node_Str" + avatarConfigInfo.getAvatarConfigURL() + "String_Node_Str"+ avatarConfigInfo.getLoaderFactoryClassName());
    }
 else {
      logger.warning("String_Node_Str");
    }
    return loadAvatarInternal(avatarConfigInfo);
  }
 catch (  java.lang.Exception excp) {
    logger.log(Level.WARNING,"String_Node_Str" + "String_Node_Str" + avatarConfigInfo.getAvatarConfigURL(),excp);
    return null;
  }
 finally {
    LoadingInfo.finishedLoading(cell.getCellID(),username);
  }
}

Fixed version (ground truth):
/** 
 * Load and return an avatar given its configuration information.
 * @param avatarConfigInfo The avatar configuration info
 * @return The Avatar character
 */
private WlAvatarCharacter loadAvatar(AvatarConfigInfo avatarConfigInfo){
  LoadingInfo.startedLoading(cell.getCellID(),username);
  try {
    if (avatarConfigInfo != null) {
      logger.info("String_Node_Str" + avatarConfigInfo.getAvatarConfigURL() + "String_Node_Str"+ avatarConfigInfo.getLoaderFactoryClassName());
    }
 else {
      logger.info("String_Node_Str");
    }
    return loadAvatarInternal(avatarConfigInfo);
  }
 catch (  java.lang.Exception excp) {
    logger.log(Level.WARNING,"String_Node_Str" + "String_Node_Str" + avatarConfigInfo.getAvatarConfigURL(),excp);
    return null;
  }
 finally {
    LoadingInfo.finishedLoading(cell.getCellID(),username);
  }
}
Program: 45888
Project: 45888
Buggy source:
public WlAvatarContext(Avatar avatar){
  super(avatar);
  for (  ActionInfo actionInfo : getGenericAnimations()) {
    actionMap.put(actionInfo.getAnimationName(),actionInfo);
  }
}

Fixed version (ground truth):
public WlAvatarContext(Avatar avatar){
  super(avatar);
  if (avatar.getCharacterParams().isAnimateBody())   for (  ActionInfo actionInfo : getGenericAnimations()) {
    actionMap.put(actionInfo.getAnimationName(),actionInfo);
  }
}
Program: 45889
Project: 45889
Buggy source:
void playMiscAnimation(String name){
  setMiscAnimation(name);
  triggerReleased(TriggerNames.MiscAction.ordinal());
  triggerPressed(TriggerNames.MiscAction.ordinal());
  triggerReleased(TriggerNames.MiscAction.ordinal());
}

Fixed version (ground truth):
void playMiscAnimation(String name){
  if (getavatar().getCharacterParams().isAnimateBody()) {
    setMiscAnimation(name);
    triggerReleased(TriggerNames.MiscAction.ordinal());
    triggerPressed(TriggerNames.MiscAction.ordinal());
    triggerReleased(TriggerNames.MiscAction.ordinal());
  }
}
Program: 45890
Project: 45890
Buggy source:
/** 
 * Clean up resources.
 */
public void cleanup(){
  Iterator<CellID> it=getProviderCellsLaunched().getIterator();
  while (it.hasNext()) {
    CellID cellID=it.next();
    CellMO cell=CellManagerMO.getCell(cellID);
    if (cell != null) {
      if (!(cell instanceof AppConventionalCellMO)) {
        logger.warning("String_Node_Str");
      }
      ((AppConventionalCellMO)cell).appExitted(-1);
    }
  }
  getProviderCellsLaunched().clear();
}

Fixed version (ground truth):
/** 
 * Clean up resources.
 */
public void cleanup(){
  getProviderCellsLaunched().clear();
}
Program: 45891
Project: 45891
Buggy source:
/** 
 * Called by the provider proxy to report the result of a launch
 */
public void appLaunchResult(AppServerLauncher.LaunchStatus status,CellID cellID,String connInfo){
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + status);
  logger.info("String_Node_Str" + cellID);
  logger.info("String_Node_Str" + connInfo);
  LaunchRequest launchReq=launchesInFlight.get(cellID);
  if (launchReq == null) {
    logger.warning("String_Node_Str" + cellID);
    return;
  }
  launchesInFlight.remove(cellID);
  AppContext.getDataManager().markForUpdate(this);
  CellMO cell=CellManagerMO.getCell(cellID);
  if (cell == null) {
    logger.warning("String_Node_Str" + launchReq);
    return;
  }
  if (!(cell instanceof AppConventionalCellMO)) {
    logger.warning("String_Node_Str" + launchReq);
    return;
  }
  if (status != AppServerLauncher.LaunchStatus.SUCCESS || connInfo == null) {
    logger.warning("String_Node_Str" + status + "String_Node_Str"+ connInfo+ "String_Node_Str"+ launchReq);
    logger.warning("String_Node_Str");
    pendingLaunches.add(launchReq);
    return;
  }
  ((AppConventionalCellMO)cell).appLaunchResult(status,connInfo);
}

Fixed version (ground truth):
/** 
 * Called by the provider proxy to report the result of a launch
 */
public void appLaunchResult(AppServerLauncher.LaunchStatus status,CellID cellID,String connInfo){
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + status);
  logger.info("String_Node_Str" + cellID);
  logger.info("String_Node_Str" + connInfo);
  LaunchRequest launchReq=launchesInFlight.get(cellID);
  if (launchReq == null) {
    logger.warning("String_Node_Str" + cellID);
    return;
  }
  launchesInFlight.remove(cellID);
  AppContext.getDataManager().markForUpdate(this);
  CellMO cell=CellManagerMO.getCell(cellID);
  if (cell == null) {
    logger.warning("String_Node_Str" + launchReq);
    return;
  }
  if (!(cell instanceof AppConventionalCellMO)) {
    logger.warning("String_Node_Str" + launchReq);
    return;
  }
  if (status != AppServerLauncher.LaunchStatus.SUCCESS || connInfo == null) {
    logger.warning("String_Node_Str" + status + "String_Node_Str"+ connInfo+ "String_Node_Str"+ launchReq);
    logger.warning("String_Node_Str");
    pendingLaunches.add(launchReq);
    return;
  }
  runningLaunches.add(launchReq);
  ((AppConventionalCellMO)cell).appLaunchResult(status,connInfo);
}
Program: 45892
Project: 45892
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object appLaunch(AppConventionalCellMO cell,String executionCapability,String appName,String command) throws InstantiationException {
  logger.info("String_Node_Str" + command);
  CellID cellID=cell.getCellID();
  LaunchRequest launchReq=new LaunchRequest(cellID,executionCapability,appName,command);
  LinkedList<ProviderProxy> providers=execCapToProviderList.get(executionCapability);
  if (providers == null || providers.size() <= 0) {
    logger.warning("String_Node_Str" + executionCapability + "String_Node_Str");
    logger.warning("String_Node_Str");
    pendingLaunches.add(launchReq);
    AppContext.getDataManager().markForUpdate(this);
    return new SasLaunchInfo(cell,executionCapability,null);
  }
  ProviderProxy provider=providers.getFirst();
  if (provider == null) {
    throw new InstantiationException("String_Node_Str" + executionCapability);
  }
  launchesInFlight.put(cellID,launchReq);
  provider.tryLaunch(cellID,executionCapability,appName,command);
  return new SasLaunchInfo(cell,executionCapability,provider);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object appLaunch(AppConventionalCellMO cell,String executionCapability,String appName,String command) throws InstantiationException {
  logger.info("String_Node_Str" + command);
  CellID cellID=cell.getCellID();
  LaunchRequest launchReq=new LaunchRequest(cellID,executionCapability,appName,command);
  LinkedList<ProviderProxy> providers=execCapToProviderList.get(executionCapability);
  if (providers == null || providers.size() <= 0) {
    logger.warning("String_Node_Str" + executionCapability + "String_Node_Str");
    logger.warning("String_Node_Str");
    pendingLaunches.add(launchReq);
    AppContext.getDataManager().markForUpdate(this);
    return new SasLaunchInfo(cell,executionCapability,null);
  }
  ProviderProxy provider=providers.getFirst();
  if (provider == null) {
    throw new InstantiationException("String_Node_Str" + executionCapability);
  }
  launchReq.setProvider(provider);
  launchesInFlight.put(cellID,launchReq);
  provider.tryLaunch(cellID,executionCapability,appName,command);
  return new SasLaunchInfo(cell,executionCapability,provider);
}
Program: 45893
Project: 45893
Buggy source:
/** 
 * Called when provider client disconnects from the SAS server.
 */
ProviderProxy providerDisconnected(WonderlandClientSender sender,WonderlandClientID clientID){
  logger.info("String_Node_Str" + clientID);
  ProviderProxy providerToRemove=null;
  String execCap="String_Node_Str";
  LinkedList<ProviderProxy> providers=execCapToProviderList.get(execCap);
  if (providers != null) {
    for (    ProviderProxy provider : providers) {
      if (provider.getClientID().equals(clientID)) {
        providerToRemove=provider;
        provider.cleanup();
        break;
      }
    }
    if (providerToRemove != null) {
      providers.remove(providerToRemove);
    }
    if (providers.size() <= 0) {
      execCapToProviderList.remove(execCap);
    }
  }
  AppContext.getDataManager().markForUpdate(this);
  return providerToRemove;
}

Fixed version (ground truth):
/** 
 * Called when provider client disconnects from the SAS server.
 */
ProviderProxy providerDisconnected(WonderlandClientSender sender,WonderlandClientID clientID){
  logger.info("String_Node_Str" + clientID);
  ProviderProxy providerToRemove=null;
  String execCap="String_Node_Str";
  LinkedList<ProviderProxy> providers=execCapToProviderList.get(execCap);
  if (providers != null) {
    for (    ProviderProxy provider : providers) {
      if (provider.getClientID().equals(clientID)) {
        providerToRemove=provider;
        provider.cleanup();
        persistProviderApps(provider,execCap);
        break;
      }
    }
    if (providerToRemove != null) {
      providers.remove(providerToRemove);
    }
    if (providers.size() <= 0) {
      execCapToProviderList.remove(execCap);
    }
  }
  AppContext.getDataManager().markForUpdate(this);
  return providerToRemove;
}
Program: 45894
Project: 45894
Buggy source:
/** 
 * {@inheritDoc}
 */
public void appStop(Object launchInfo){
  SasLaunchInfo sasLaunchInfo=(SasLaunchInfo)launchInfo;
  CellID cellID=sasLaunchInfo.cell.getCellID();
  launchesInFlight.remove(cellID);
  AppContext.getDataManager().markForUpdate(this);
  pendingLaunches.remove(cellID,sasLaunchInfo.executionCapability);
  AppContext.getDataManager().markForUpdate(this);
  if (sasLaunchInfo.provider != null) {
    sasLaunchInfo.provider.appStop(sasLaunchInfo.cell);
  }
 else {
    LinkedList<ProviderProxy> providers=execCapToProviderList.get(sasLaunchInfo.executionCapability);
    if (providers != null) {
      for (      ProviderProxy provider : providers) {
        provider.appStop(sasLaunchInfo.cell);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void appStop(Object launchInfo){
  SasLaunchInfo sasLaunchInfo=(SasLaunchInfo)launchInfo;
  CellID cellID=sasLaunchInfo.cell.getCellID();
  launchesInFlight.remove(cellID);
  runningLaunches.remove(cellID,sasLaunchInfo.executionCapability);
  pendingLaunches.remove(cellID,sasLaunchInfo.executionCapability);
  AppContext.getDataManager().markForUpdate(this);
  if (sasLaunchInfo.provider != null) {
    sasLaunchInfo.provider.appStop(sasLaunchInfo.cell);
  }
 else {
    LinkedList<ProviderProxy> providers=execCapToProviderList.get(sasLaunchInfo.executionCapability);
    if (providers != null) {
      for (      ProviderProxy provider : providers) {
        provider.appStop(sasLaunchInfo.cell);
      }
    }
  }
}
Program: 45895
Project: 45895
Buggy source:
private void tryPendingLaunches(String executionCapability) throws InstantiationException {
  LinkedList<LaunchRequest> reqs=pendingLaunches.getPendingLaunches(executionCapability);
  if (reqs == null) {
    return;
  }
  LinkedList<LaunchRequest> reqsForTraversal=(LinkedList<LaunchRequest>)reqs.clone();
  for (  LaunchRequest req : reqsForTraversal) {
    LinkedList<ProviderProxy> providers=execCapToProviderList.get(executionCapability);
    if (providers == null || providers.size() <= 0) {
      continue;
    }
    ProviderProxy provider=providers.getFirst();
    reqs.remove(req);
    launchesInFlight.put(req.cellID,req);
    provider.tryLaunch(req.cellID,req.executionCapability,req.appName,req.command);
  }
}

Fixed version (ground truth):
private void tryPendingLaunches(String executionCapability) throws InstantiationException {
  LinkedList<LaunchRequest> reqs=pendingLaunches.getLaunches(executionCapability);
  if (reqs == null) {
    return;
  }
  LinkedList<LaunchRequest> reqsForTraversal=(LinkedList<LaunchRequest>)reqs.clone();
  for (  LaunchRequest req : reqsForTraversal) {
    LinkedList<ProviderProxy> providers=execCapToProviderList.get(executionCapability);
    if (providers == null || providers.size() <= 0) {
      continue;
    }
    ProviderProxy provider=providers.getFirst();
    reqs.remove(req);
    launchesInFlight.put(req.cellID,req);
    provider.tryLaunch(req.cellID,req.executionCapability,req.appName,req.command);
  }
}
Program: 45896
Project: 45896
Buggy source:
private void downloadButtonActionPerformed(java.awt.event.ActionEvent evt){
  JFileChooser chooser=new JFileChooser("String_Node_Str");
  chooser.setFileFilter(new FileFilter(){
    @Override public boolean accept(    File f){
      return f.isDirectory();
    }
    @Override public String getDescription(){
      return BUNDLE.getString("String_Node_Str");
    }
  }
);
  chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  chooser.setDialogType(JFileChooser.SAVE_DIALOG);
  int returnVal=chooser.showOpenDialog(this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    String fileName=tableSelectedNode.getName();
    File out=new File(chooser.getSelectedFile(),fileName);
    try {
      ContentResource r=(ContentResource)tableSelectedNode;
      r.get(out);
    }
 catch (    java.lang.Exception cre) {
      logger.log(Level.WARNING,"String_Node_Str" + fileName,cre);
      String msg="String_Node_Str" + fileName + "String_Node_Str"+ "String_Node_Str";
      String title="String_Node_Str";
      JOptionPane.showMessageDialog(this,msg,title,JOptionPane.ERROR_MESSAGE);
    }
  }
}

Fixed version (ground truth):
private void downloadButtonActionPerformed(java.awt.event.ActionEvent evt){
  JFileChooser chooser=new JFileChooser();
  chooser.setFileFilter(new FileFilter(){
    @Override public boolean accept(    File f){
      return f.isDirectory();
    }
    @Override public String getDescription(){
      return BUNDLE.getString("String_Node_Str");
    }
  }
);
  chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  chooser.setDialogType(JFileChooser.SAVE_DIALOG);
  int returnVal=chooser.showOpenDialog(this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    String fileName=tableSelectedNode.getName();
    File out=new File(chooser.getSelectedFile(),fileName);
    try {
      ContentResource r=(ContentResource)tableSelectedNode;
      r.get(out);
    }
 catch (    java.lang.Exception cre) {
      logger.log(Level.WARNING,"String_Node_Str" + fileName,cre);
      String msg="String_Node_Str" + fileName + "String_Node_Str"+ "String_Node_Str";
      String title="String_Node_Str";
      JOptionPane.showMessageDialog(this,msg,title,JOptionPane.ERROR_MESSAGE);
    }
  }
}
Program: 45897
Project: 45897
Buggy source:
private void showAddUserPanel(boolean showPanel,boolean showPrivacy){
  if (addPhoneUserPanel != null) {
    addPhoneUserPanel.setVisible(false);
  }
  if (addUserPanel == null) {
    addUserPanel=new AddUserPanel(client,session,myPresenceInfo,caller,group);
    addUserPanel.addUserListSelectionListener(new javax.swing.event.ListSelectionListener(){
      public void valueChanged(      javax.swing.event.ListSelectionEvent e){
        addUserListValueChanged(e);
      }
    }
);
  }
  addUserPanel.setVisible(showPanel,mode);
  if (showPanel) {
    add(addUserPanel,BorderLayout.CENTER);
  }
  addUserPanel.showPrivacyPanel(showPrivacy);
}

Fixed version (ground truth):
private void showAddUserPanel(boolean showPanel,boolean showPrivacy){
  if (addPhoneUserPanel != null) {
    addPhoneUserPanel.setVisible(false);
  }
  if (addUserPanel == null) {
    addUserPanel=new AddUserPanel(client,session,myPresenceInfo,caller,group,Mode.ADD);
    addUserPanel.addUserListSelectionListener(new javax.swing.event.ListSelectionListener(){
      public void valueChanged(      javax.swing.event.ListSelectionEvent e){
        addUserListValueChanged(e);
      }
    }
);
  }
  addUserPanel.setVisible(showPanel,mode);
  if (showPanel) {
    add(addUserPanel,BorderLayout.CENTER);
  }
  addUserPanel.showPrivacyPanel(showPrivacy);
}
Program: 45898
Project: 45898
Buggy source:
/** 
 * Create a cell based upon the uri of the content and the file extension of the uploaded file.
 * @param uri The URI of the uploaded content
 * @param extension The file extension of the content
 */
public void createCell(String uri){
  String extension=getFileExtension(uri);
  if (extension == null) {
    logger.warning("String_Node_Str" + uri);
    return;
  }
  CellRegistry registry=CellRegistry.getCellRegistry();
  Set<CellFactorySPI> factories=registry.getCellFactoriesByExtension(extension);
  if (factories == null) {
    final JFrame frame=JmeClientMain.getFrame().getFrame();
    logger.warning("String_Node_Str" + extension);
    JOptionPane.showMessageDialog(frame,"String_Node_Str" + uri,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return;
  }
  CellFactorySPI factory=factories.iterator().next();
  Properties props=new Properties();
  props.put("String_Node_Str",uri);
  CellServerState state=factory.getDefaultCellServerState(props);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + uri,excp);
  }
}

Fixed version (ground truth):
/** 
 * Create a cell based upon the uri of the content and the file extension of the uploaded file.
 * @param uri The URI of the uploaded content
 * @param extension The file extension of the content
 */
public void createCell(String uri){
  String extension=getFileExtension(uri);
  if (extension == null) {
    logger.warning("String_Node_Str" + uri);
    return;
  }
  CellSelectionSPI spi=CellSelectionRegistry.getCellSelectionSPI();
  if (spi == null) {
    final JFrame frame=JmeClientMain.getFrame().getFrame();
    logger.warning("String_Node_Str");
    JOptionPane.showMessageDialog(frame,"String_Node_Str" + uri,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return;
  }
  CellFactorySPI factory=null;
  try {
    factory=spi.getCellSelection(extension);
  }
 catch (  CellCreationException excp) {
    final JFrame frame=JmeClientMain.getFrame().getFrame();
    logger.log(Level.WARNING,"String_Node_Str" + extension,excp);
    JOptionPane.showMessageDialog(frame,"String_Node_Str" + uri,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return;
  }
  if (factory == null) {
    return;
  }
  Properties props=new Properties();
  props.put("String_Node_Str",uri);
  CellServerState state=factory.getDefaultCellServerState(props);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + uri,excp);
  }
}
Program: 45899
Project: 45899
Buggy source:
public void drop(DropTargetDropEvent dtde){
  List<DataFlavor> flavorList=dtde.getCurrentDataFlavorsAsList();
  List<DataFlavor> supportedFlavors=new LinkedList();
  for (  DataFlavor dataFlavor : flavorList) {
    DataFlavorHandlerSPI handler=getDataFlavorHandler(dataFlavor);
    if (handler != null) {
      supportedFlavors.add(dataFlavor);
    }
  }
  if (supportedFlavors.isEmpty() == true) {
    dtde.rejectDrop();
    return;
  }
  dtde.acceptDrop(DnDConstants.ACTION_MOVE);
  Transferable transferable=dtde.getTransferable();
  Point location=dtde.getLocation();
  for (  DataFlavor dataFlavor : supportedFlavors) {
    DataFlavorHandlerSPI handler=getDataFlavorHandler(dataFlavor);
    if (handler.accept(transferable,dataFlavor) == true) {
      handler.handleDrop(transferable,dataFlavor,location);
      dtde.dropComplete(true);
      return;
    }
  }
  dtde.dropComplete(false);
}

Fixed version (ground truth):
public void drop(DropTargetDropEvent dtde){
  logger.warning("String_Node_Str");
  logger.warning("String_Node_Str" + dtde.getCurrentDataFlavors().length);
  for (  DataFlavor flavor : dtde.getCurrentDataFlavors()) {
    logger.warning("String_Node_Str" + flavor.toString());
  }
  List<DataFlavor> flavorList=dtde.getCurrentDataFlavorsAsList();
  for (  DataFlavor flavor : flavorList) {
    logger.warning("String_Node_Str" + flavor.toString());
  }
  List<DataFlavor> supportedFlavors=new LinkedList();
  for (  DataFlavor dataFlavor : flavorList) {
    DataFlavorHandlerSPI handler=getDataFlavorHandler(dataFlavor);
    if (handler != null) {
      logger.warning("String_Node_Str" + dataFlavor.toString());
      supportedFlavors.add(dataFlavor);
    }
  }
  if (supportedFlavors.isEmpty() == true) {
    dtde.rejectDrop();
    return;
  }
  dtde.acceptDrop(DnDConstants.ACTION_MOVE);
  Transferable transferable=dtde.getTransferable();
  Point location=dtde.getLocation();
  for (  DataFlavor dataFlavor : supportedFlavors) {
    DataFlavorHandlerSPI handler=getDataFlavorHandler(dataFlavor);
    if (handler.accept(transferable,dataFlavor) == true) {
      handler.handleDrop(transferable,dataFlavor,location);
      dtde.dropComplete(true);
      return;
    }
  }
  dtde.dropComplete(false);
}
Program: 45900
Project: 45900
Buggy source:
/** 
 * Launches a cell based upon a given URL. This method assumes the URL refers to some generally-available web content that all clients can fetch
 * @param url The URL to launch a Cell with
 */
public static void launchCellFromURL(URL url){
  String extension=DragAndDropManager.getFileExtension(url.getFile());
  CellRegistry registry=CellRegistry.getCellRegistry();
  Set<CellFactorySPI> factories=registry.getCellFactoriesByExtension(extension);
  if (factories == null) {
    logger.warning("String_Node_Str" + extension);
    JFrame frame=JmeClientMain.getFrame().getFrame();
    JOptionPane.showMessageDialog(frame,"String_Node_Str" + url.toExternalForm());
    return;
  }
  CellFactorySPI factory=factories.iterator().next();
  Properties props=new Properties();
  props.put("String_Node_Str",url.toExternalForm());
  CellServerState state=factory.getDefaultCellServerState(props);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + url,excp);
  }
}

Fixed version (ground truth):
/** 
 * Launches a cell based upon a given URL. This method assumes the URL refers to some generally-available web content that all clients can fetch
 * @param url The URL to launch a Cell with
 */
public static void launchCellFromURL(URL url){
  String extension=DragAndDropManager.getFileExtension(url.getFile());
  CellSelectionSPI spi=CellSelectionRegistry.getCellSelectionSPI();
  if (spi == null) {
    final JFrame frame=JmeClientMain.getFrame().getFrame();
    logger.warning("String_Node_Str");
    JOptionPane.showMessageDialog(frame,"String_Node_Str" + url.toExternalForm(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return;
  }
  CellFactorySPI factory=null;
  try {
    factory=spi.getCellSelection(extension);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + extension,excp);
    JFrame frame=JmeClientMain.getFrame().getFrame();
    JOptionPane.showMessageDialog(frame,"String_Node_Str" + url.toExternalForm());
    return;
  }
  if (factory == null) {
    return;
  }
  Properties props=new Properties();
  props.put("String_Node_Str",url.toExternalForm());
  CellServerState state=factory.getDefaultCellServerState(props);
  try {
    CellUtils.createCell(state);
  }
 catch (  CellCreationException excp) {
    logger.log(Level.WARNING,"String_Node_Str" + url,excp);
  }
}
Program: 45901
Project: 45901
Buggy source:
/** 
 * Called when the user cancels the load
 */
void loadCancelled(ImportedModel model){
  if (editingRow >= 0) {
    ImportedModel imp=imports.get(editingRow);
    Node tg=imp.getRootBG();
    Vector3f rot=imp.getOrientation();
    tg.setLocalRotation(calcRotationMatrix(rot.x,rot.y,rot.z));
    tg.setLocalTranslation(imp.getTranslation());
  }
  if (model != null)   ClientContextJME.getWorldManager().removeEntity(model.getEntity());
}

Fixed version (ground truth):
/** 
 * Called when the user cancels the load
 */
void loadCancelled(ImportedModel model){
  if (editingRow >= 0 && imports.contains(model)) {
    final ImportedModel imp=model;
    final Node tg=imp.getRootBG();
    final Vector3f rot=imp.getOrientation();
    ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater(){
      public void update(      Object arg0){
        tg.setLocalRotation(calcRotationMatrix(rot.x,rot.y,rot.z));
        tg.setLocalTranslation(imp.getTranslation());
        ClientContextJME.getWorldManager().addToUpdateList(tg);
      }
    }
,null);
  }
  if (model != null)   ClientContextJME.getWorldManager().removeEntity(model.getEntity());
}
Program: 45903
Project: 45903
Buggy source:
public void run(){
  JFileChooser chooser=new JFileChooser();
  FileNameExtensionFilter filter=new FileNameExtensionFilter(LoaderManager.getLoaderManager().getLoaderExtensions());
  chooser.setFileFilter(filter);
  int returnVal=chooser.showOpenDialog(ModelImporterFrame.this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    try {
      importModel(chooser.getSelectedFile(),false);
    }
 catch (    FileNotFoundException ex) {
      Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ex);
    }
catch (    IOException ioe) {
      Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ioe);
    }
    setVisible(true);
    lastModelDir=chooser.getSelectedFile().getParentFile();
  }
}

Fixed version (ground truth):
public void run(){
  JFileChooser chooser=new JFileChooser();
  FileNameExtensionFilter filter=new FileNameExtensionFilter(LoaderManager.getLoaderManager().getLoaderExtensions());
  chooser.setFileFilter(filter);
  if (lastModelDir != null)   chooser.setCurrentDirectory(lastModelDir);
  int returnVal=chooser.showOpenDialog(ModelImporterFrame.this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    try {
      importModel(chooser.getSelectedFile(),false);
    }
 catch (    FileNotFoundException ex) {
      Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ex);
    }
catch (    IOException ioe) {
      Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ioe);
    }
    setVisible(true);
    lastModelDir=chooser.getSelectedFile().getParentFile();
  }
}
Program: 45904
Project: 45904
Buggy source:
private void okBActionPerformed(java.awt.event.ActionEvent evt){
  if (avatarMoveCB.isSelected()) {
    ViewManager.getViewManager().getPrimaryViewCell().removeTransformChangeListener(userMotionListener);
  }
  setVisible(false);
  Vector3f translation=new Vector3f((Float)translationXTF.getValue(),(Float)translationYTF.getValue(),(Float)translationZTF.getValue());
  Vector3f orientation=new Vector3f((Float)rotationXTF.getValue(),(Float)rotationYTF.getValue(),(Float)rotationZTF.getValue());
  sessionFrame.loadCompleted(importedModel);
}

Fixed version (ground truth):
private void okBActionPerformed(java.awt.event.ActionEvent evt){
  if (avatarMoveCB.isSelected()) {
    ViewManager.getViewManager().getPrimaryViewCell().removeTransformChangeListener(userMotionListener);
  }
  setVisible(false);
  Vector3f translation=new Vector3f((Float)translationXTF.getValue(),(Float)translationYTF.getValue(),(Float)translationZTF.getValue());
  Vector3f orientation=new Vector3f((Float)rotationXTF.getValue(),(Float)rotationYTF.getValue(),(Float)rotationZTF.getValue());
  importedModel.setWonderlandName(modelNameTF.getText());
  sessionFrame.loadCompleted(importedModel);
}
Program: 45905
Project: 45905
Buggy source:
/** 
 * Set the spinners to the rotation, translation and scale local coords of this node
 * @param node
 */
private void setSpinners(Node modelBG,Node rootBG){
  Vector3f translation=rootBG.getLocalTranslation();
  Quaternion quat=modelBG.getLocalRotation();
  float[] angles=quat.toAngles(new float[3]);
  Vector3f scale=modelBG.getLocalScale();
  translationXTF.setValue(translation.x);
  translationYTF.setValue(translation.y);
  translationZTF.setValue(translation.z);
  rotationXTF.setValue((float)Math.toDegrees(angles[0]));
  rotationYTF.setValue((float)Math.toDegrees(angles[1]));
  rotationZTF.setValue((float)Math.toDegrees(angles[2]));
  scaleTF.setValue(scale.x);
}

Fixed version (ground truth):
/** 
 * Set the spinners to the rotation, translation and scale local coords of this node
 * @param node
 */
private void setSpinners(Node modelBG,Node rootBG){
  Vector3f translation=rootBG.getLocalTranslation();
  Quaternion quat=modelBG.getLocalRotation();
  float[] angles=quat.toAngles(new float[3]);
  Vector3f scale=modelBG.getLocalScale();
  translationXTF.setValue(translation.x);
  translationYTF.setValue(translation.y);
  translationZTF.setValue(translation.z);
  rotationXTF.setValue((float)Math.toDegrees(angles[0]));
  rotationYTF.setValue((float)Math.toDegrees(angles[1]));
  rotationZTF.setValue((float)Math.toDegrees(angles[2]));
  scaleTF.setValue(scale.x);
  importedModel.setTranslation(translation);
  importedModel.setOrientation(new Vector3f((float)Math.toDegrees(angles[0]),(float)Math.toDegrees(angles[1]),(float)Math.toDegrees(angles[2])));
  importedModel.setScale(new Vector3f(scale.x,scale.x,scale.x));
}
Program: 45906
Project: 45906
Buggy source:
void chooseFile(){
  texturePrefixTF.setText("String_Node_Str");
  modelNameTF.setText("String_Node_Str");
  modelX3dTF.setText("String_Node_Str");
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      JFileChooser chooser=new JFileChooser();
      FileNameExtensionFilter filter=new FileNameExtensionFilter(LoaderManager.getLoaderManager().getLoaderExtensions());
      chooser.setFileFilter(filter);
      int returnVal=chooser.showOpenDialog(ModelImporterFrame.this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        try {
          importModel(chooser.getSelectedFile(),false);
        }
 catch (        FileNotFoundException ex) {
          Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ex);
        }
catch (        IOException ioe) {
          Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ioe);
        }
        setVisible(true);
        lastModelDir=chooser.getSelectedFile().getParentFile();
      }
    }
  }
);
}

Fixed version (ground truth):
void chooseFile(){
  texturePrefixTF.setText("String_Node_Str");
  modelNameTF.setText("String_Node_Str");
  modelX3dTF.setText("String_Node_Str");
  importedModel=null;
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      JFileChooser chooser=new JFileChooser();
      FileNameExtensionFilter filter=new FileNameExtensionFilter(LoaderManager.getLoaderManager().getLoaderExtensions());
      chooser.setFileFilter(filter);
      if (lastModelDir != null)       chooser.setCurrentDirectory(lastModelDir);
      int returnVal=chooser.showOpenDialog(ModelImporterFrame.this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        try {
          importModel(chooser.getSelectedFile(),false);
        }
 catch (        FileNotFoundException ex) {
          Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ex);
        }
catch (        IOException ioe) {
          Logger.getLogger(ModelImporterFrame.class.getName()).log(Level.SEVERE,null,ioe);
        }
        setVisible(true);
        lastModelDir=chooser.getSelectedFile().getParentFile();
      }
    }
  }
);
}
Program: 45907
Project: 45907
Buggy source:
public void transformChanged(Cell cell,ChangeSource source){
  CellTransform t=cell.getWorldTransform();
  t.getLookAt(pos,look);
  System.err.println(pos + "String_Node_Str" + look);
  look.mult(3);
  pos.addLocal(look);
  currentTranslation.set(pos);
  ((SpinnerNumberModel)translationXTF.getModel()).setValue(new Float(pos.x));
  ((SpinnerNumberModel)translationYTF.getModel()).setValue(new Float(pos.y));
  ((SpinnerNumberModel)translationZTF.getModel()).setValue(new Float(pos.z));
  if (transformProcessor != null)   transformProcessor.setTransform(currentRotation,currentTranslation);
}

Fixed version (ground truth):
public void transformChanged(Cell cell,ChangeSource source){
  CellTransform t=cell.getWorldTransform();
  t.getLookAt(pos,look);
  look.mult(3);
  pos.addLocal(look);
  currentTranslation.set(pos);
  ((SpinnerNumberModel)translationXTF.getModel()).setValue(new Float(pos.x));
  ((SpinnerNumberModel)translationYTF.getModel()).setValue(new Float(pos.y));
  ((SpinnerNumberModel)translationZTF.getModel()).setValue(new Float(pos.z));
  if (transformProcessor != null)   transformProcessor.setTransform(currentRotation,currentTranslation);
}
Program: 45908
Project: 45908
Buggy source:
/** 
 * Edit a model that has already been imported
 * @param model
 */
void editModel(ImportedModel model){
  modelX3dTF.setText(model.getOriginalURL().toExternalForm());
  currentTranslation.set(model.getTranslation());
  currentRotationValues.set(model.getOrientation());
  calcCurrentRotationMatrix();
  ((SpinnerNumberModel)rotationXTF.getModel()).setValue(model.getOrientation().x);
  ((SpinnerNumberModel)rotationYTF.getModel()).setValue(model.getOrientation().y);
  ((SpinnerNumberModel)rotationZTF.getModel()).setValue(model.getOrientation().z);
  ((SpinnerNumberModel)translationXTF.getModel()).setValue(model.getTranslation().x);
  ((SpinnerNumberModel)translationYTF.getModel()).setValue(model.getTranslation().y);
  ((SpinnerNumberModel)translationZTF.getModel()).setValue(model.getTranslation().x);
  avatarMoveCB.setSelected(false);
  populateTextureList(model.getRootBG());
  processBounds(model.getModelBG());
}

Fixed version (ground truth):
/** 
 * Edit a model that has already been imported
 * @param model
 */
void editModel(ImportedModel model){
  modelX3dTF.setText(model.getOriginalURL().toExternalForm());
  modelNameTF.setText(model.getWonderlandName());
  currentTranslation.set(model.getTranslation());
  currentRotationValues.set(model.getOrientation());
  calcCurrentRotationMatrix();
  ((SpinnerNumberModel)rotationXTF.getModel()).setValue(model.getOrientation().x);
  ((SpinnerNumberModel)rotationYTF.getModel()).setValue(model.getOrientation().y);
  ((SpinnerNumberModel)rotationZTF.getModel()).setValue(model.getOrientation().z);
  ((SpinnerNumberModel)translationXTF.getModel()).setValue(model.getTranslation().x);
  ((SpinnerNumberModel)translationYTF.getModel()).setValue(model.getTranslation().y);
  ((SpinnerNumberModel)translationZTF.getModel()).setValue(model.getTranslation().x);
  ((SpinnerNumberModel)scaleTF.getModel()).setValue(model.getScale().x);
  avatarMoveCB.setSelected(false);
  populateTextureList(model.getRootBG());
  processBounds(model.getModelBG());
}
Program: 45909
Project: 45909
Buggy source:
public void stateChanged(ChangeEvent e){
  float x=(Float)((SpinnerNumberModel)scaleTF.getModel()).getValue();
  if (x != currentScale.x) {
    currentScale.set(x,x,x);
    if (transformProcessor != null)     transformProcessor.setTransform(currentRotation,currentTranslation,currentScale);
  }
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  float x=(Float)((SpinnerNumberModel)scaleTF.getModel()).getValue();
  if (x != currentScale.x) {
    currentScale.set(x,x,x);
    importedModel.setScale(currentScale);
    if (transformProcessor != null)     transformProcessor.setTransform(currentRotation,currentTranslation,currentScale);
  }
}
Program: 45910
Project: 45910
Buggy source:
public void setOrientation(Vector3f orientation){
  this.orientation=orientation;
}

Fixed version (ground truth):
public void setOrientation(Vector3f orientation){
  this.orientation.set(orientation);
}
Program: 45911
Project: 45911
Buggy source:
public Vector3f getOrientation(){
  return orientation;
}

Fixed version (ground truth):
public Vector3f getOrientation(){
  return orientation.clone();
}
Program: 45912
Project: 45912
Buggy source:
public void setTranslation(Vector3f translation){
  this.translation=translation;
}

Fixed version (ground truth):
public void setTranslation(Vector3f translation){
  this.translation.set(translation);
}
Program: 45913
Project: 45913
Buggy source:
public Vector3f getTranslation(){
  return translation;
}

Fixed version (ground truth):
public Vector3f getTranslation(){
  return translation.clone();
}
Program: 45914
Project: 45914
Buggy source:
public void appLaunchResult(AppServerLauncher.LaunchStatus status,String connInfo){
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + status);
  logger.info("String_Node_Str" + connInfo);
  if (status == AppServerLauncher.LaunchStatus.FAIL) {
    logger.warning("String_Node_Str" + serverState.getAppName());
    destroy();
    return;
  }
  SetConnectionInfoTask scit=new SetConnectionInfoTask(this,connInfo);
  AppContext.getTaskManager().scheduleTask(scit,2000);
}

Fixed version (ground truth):
public void appLaunchResult(AppServerLauncher.LaunchStatus status,String connInfo){
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + status);
  logger.info("String_Node_Str" + connInfo);
  if (status == AppServerLauncher.LaunchStatus.FAIL) {
    logger.warning("String_Node_Str" + serverState.getAppName());
    destroy();
    return;
  }
  setConnectionInfo(connInfo);
}
Program: 45917
Project: 45917
Buggy source:
public void selectForInput(boolean selected){
  selectedForInput=selected;
  enableInputListeners(selected);
}

Fixed version (ground truth):
public void selectForInput(boolean selected){
  if (selectedForInput == selected)   return;
  selectedForInput=selected;
  if (avatarCharacter != null) {
    WorldManager wm=ClientContextJME.getWorldManager();
    ((WlAvatarContext)avatarCharacter.getContext()).getBehaviorManager().setEnable(false);
    if (controlScheme == null && selectedForInput) {
      controlScheme=new DefaultCharacterControls(ClientContextJME.getWorldManager());
      ((AvatarControls)wm.getUserData(AvatarControls.class)).setDefault(controlScheme);
      avatarCharacter.selectForInput();
      controlScheme.addCharacterToTeam(avatarCharacter);
      controlScheme.setCharacter(avatarCharacter);
    }
    if (selectedForInput) {
      avatarCharacter.getContext().getController().addCharacterMotionListener(characterMotionListener);
      avatarCharacter.getContext().addGameContextListener(gameContextListener);
      avatarCharacter.selectForInput();
      controlScheme.addCharacterToTeam(avatarCharacter);
      controlScheme.setCharacter(avatarCharacter);
      ProcessorCollectionComponent pcc=avatarCharacter.getComponent(ProcessorCollectionComponent.class);
      ProcessorComponent characterProcessor=null;
      ProcessorComponent characterAnimationProcessor=null;
      for (      ProcessorComponent pc : pcc.getProcessors()) {
        if (pc instanceof CharacterProcessor)         characterProcessor=pc;
 else         if (pc instanceof CharacterAnimationProcessor) {
          characterAnimationProcessor=pc;
          break;
        }
      }
      cameraChainedProcessor=null;
      if (characterAnimationProcessor != null) {
        cameraChainedProcessor=characterAnimationProcessor;
      }
 else       if (characterProcessor != null)       cameraChainedProcessor=characterProcessor;
      if (cameraChainedProcessor != null) {
        cameraChainedProcessor.addToChain(ViewManager.getViewManager().getCameraProcessor());
        cameraChainedProcessor.setRunInRenderer(true);
      }
    }
 else {
      avatarCharacter.getContext().getController().removeCharacterMotionListener(characterMotionListener);
      avatarCharacter.getContext().removeGameContextListener(gameContextListener);
      if (controlScheme != null) {
        controlScheme.clearCharacterTeam();
      }
      if (cameraChainedProcessor != null) {
        cameraChainedProcessor.removeFromChain(ViewManager.getViewManager().getCameraProcessor());
        cameraChainedProcessor=null;
      }
    }
  }
 else {
  }
}
Program: 45919
Project: 45919
Buggy source:
/** 
 * Remove a cell from the world
 * @param cell the cell to remove
 */
public void removeCellFromWorld(CellMO cell){
  cell.setLive(false);
  UniverseManagerFactory.getUniverseManager().removeRootFromUniverse(cell);
  getRootCellsForUpdate().remove(cell.getCellID());
}

Fixed version (ground truth):
/** 
 * Remove a cell from the world
 * @param cell the cell to remove
 */
public void removeCellFromWorld(CellMO cell){
  cell.setLive(false);
  getRootCellsForUpdate().remove(cell.getCellID());
}
Program: 45920
Project: 45920
Buggy source:
public void removeRootFromUniverse(CellMO rootCellMO){
  final Identity identity=txnProxy.getCurrentOwner();
  scheduleChange(new Change(rootCellMO.getCellID(),null,null){
    public void run(){
      if (logger.isLoggable(Level.FINE))       logger.log(Level.FINE,"String_Node_Str");
      universe.removeRootSpatialCell(cellID,identity);
    }
  }
);
}

Fixed version (ground truth):
public void removeRootFromUniverse(CellMO rootCellMO){
  scheduleChange(new Change(rootCellMO.getCellID(),null,null){
    public void run(){
      if (logger.isLoggable(Level.FINE))       logger.log(Level.FINE,"String_Node_Str");
      universe.removeCell(cellID);
    }
  }
);
}
Program: 45921
Project: 45921
Buggy source:
/** 
 * Update the world transform of this node and all it's children iterating down the graph, then coming back up set the world bounds correctly Return the world bounds
 * @return
 */
private BoundingVolume updateWorldTransform(Identity identity){
  CellTransform oldWorld;
  boolean transformChanged=false;
  if (worldTransform == null)   oldWorld=null;
 else   oldWorld=worldTransform.clone(null);
  if (parent != null) {
    CellTransform parentWorld=parent.worldTransform;
    worldTransform=parentWorld.mul(localTransform);
  }
 else {
    worldTransform=localTransform.clone(null);
  }
  if (!worldTransform.equals(oldWorld)) {
    if (worldTransformChangeListener != null)     worldTransformChangeListener.transformChanged(this);
    transformChanged=true;
  }
  computeWorldBounds();
  if (children != null) {
    for (    SpatialCellImpl s : children) {
      worldBounds.mergeLocal(s.updateWorldTransform(identity));
    }
  }
  if (transformChanged) {
    notifyViewCaches(worldTransform);
    notifyTransformChangeListeners(identity);
  }
  return worldBounds;
}

Fixed version (ground truth):
/** 
 * Update the world transform of this node and all it's children iterating down the graph, then coming back up set the world bounds correctly Return the world bounds
 * @return
 */
private BoundingVolume updateWorldTransform(Identity identity){
  CellTransform oldWorld;
  boolean transformChanged=false;
  if (worldTransform == null)   oldWorld=null;
 else   oldWorld=worldTransform.clone(null);
  if (parent != null) {
    CellTransform parentWorld=parent.worldTransform.clone(null);
    worldTransform=parentWorld.mul(localTransform);
  }
 else {
    worldTransform=localTransform.clone(null);
  }
  if (!worldTransform.equals(oldWorld)) {
    if (worldTransformChangeListener != null)     worldTransformChangeListener.transformChanged(this);
    transformChanged=true;
  }
  computeWorldBounds();
  if (children != null) {
    for (    SpatialCellImpl s : children) {
      worldBounds.mergeLocal(s.updateWorldTransform(identity));
    }
  }
  if (transformChanged) {
    notifyViewCaches(worldTransform);
    notifyTransformChangeListeners(identity);
  }
  return worldBounds;
}
Program: 45922
Project: 45922
Buggy source:
/** 
 * Set the root for this node and all it's children
 * @param root
 */
void setRoot(SpatialCell root,ViewCacheSet viewCacheSet,Identity identity){
  this.rootNode=(SpatialCellImpl)root;
  try {
    if (isRoot) {
      if (root == null) {
        for (        Space s : spaces) {
          s.removeRootSpatialCell(this);
        }
        spaces.clear();
        isRoot=false;
        readWriteLock=null;
        this.viewCacheSet=null;
        spaces=null;
      }
    }
    if (root == this) {
      if (!isRoot) {
        readWriteLock=new ReentrantReadWriteLock(true);
        this.viewCacheSet=new ViewCacheSet();
        isRoot=true;
        spaces=new HashSet();
      }
      acquireRootWriteLock();
      updateWorldTransform(identity);
    }
 else {
      this.viewCacheSet=viewCacheSet;
    }
    if (children != null) {
      for (      SpatialCellImpl s : children)       s.setRoot(root,this.viewCacheSet,identity);
    }
  }
  finally {
    if (root == this) {
      releaseRootWriteLock();
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the root for this node and all it's children
 * @param root
 */
void setRoot(SpatialCell root,ViewCacheSet viewCacheSet,Identity identity){
  this.rootNode=(SpatialCellImpl)root;
  try {
    if (isRoot) {
      if (root == null) {
        for (        Space s : spaces) {
          s.removeRootSpatialCell(this);
        }
        spaces.clear();
        isRoot=false;
        readWriteLock=null;
        this.viewCacheSet=null;
        spaces=null;
        return;
      }
    }
    if (root == this) {
      if (!isRoot) {
        readWriteLock=new ReentrantReadWriteLock(true);
        this.viewCacheSet=new ViewCacheSet();
        isRoot=true;
        spaces=new HashSet();
      }
      acquireRootWriteLock();
      updateWorldTransform(identity);
    }
 else {
      this.viewCacheSet=viewCacheSet;
    }
    if (children != null) {
      for (      SpatialCellImpl s : children)       s.setRoot(root,this.viewCacheSet,identity);
    }
  }
  finally {
    if (root == this) {
      releaseRootWriteLock();
    }
  }
}
Program: 45923
Project: 45923
Buggy source:
Iterable<SpatialCellImpl> getChildren(){
  return children;
}

Fixed version (ground truth):
/** 
 * Return the children, or null
 * @return
 */
Iterable<SpatialCellImpl> getChildren(){
  return children;
}
Program: 45924
Project: 45924
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,null,identity);
}

Fixed version (ground truth):
public void removeRootSpatialCell(CellID cellID,Identity identity){
}
Program: 45925
Project: 45925
Buggy source:
public void removeCell(CellID id){
  logger.fine("String_Node_Str" + id);
  SpatialCellImpl cell=(SpatialCellImpl)getSpatialCell(id);
  if (cell.getParent() != null) {
    cell.getParent().removeChild(cell);
  }
  cell.destroy();
synchronized (cells) {
    cells.remove(id);
  }
}

Fixed version (ground truth):
public void removeCell(CellID id){
  logger.fine("String_Node_Str" + id);
  SpatialCellImpl cell=(SpatialCellImpl)getSpatialCell(id);
  if (cell.getParent() != null) {
    cell.getParent().removeChild(cell);
  }
  Iterable<SpatialCellImpl> children=cell.getChildren();
  if (children != null) {
    for (    SpatialCellImpl child : cell.getChildren())     removeCell(child.getCellID());
  }
  cell.destroy();
synchronized (cells) {
    cells.remove(id);
  }
}
Program: 45926
Project: 45926
Buggy source:
void cellDestroyed(SpatialCell cell){
  Logger.getAnonymousLogger().warning("String_Node_Str");
}

Fixed version (ground truth):
void cellDestroyed(SpatialCell cell){
  CellID cellID=((SpatialCellImpl)cell).getCellID();
  removeViewUpdateListener(cellID,null);
}
Program: 45927
Project: 45927
Buggy source:
void login(){
  cellMoved(viewCell,viewCell.getWorldTransform());
  UniverseImpl.getUniverse().scheduleTransaction(new KernelRunnable(){
    public String getBaseTaskType(){
      return ViewCache.class.getName() + "String_Node_Str";
    }
    public void run() throws Exception {
synchronized (viewUpdateListeners) {
        for (        ViewUpdateListenerContainer cont : viewUpdateListeners)         cont.notifyListenersLogin();
      }
    }
  }
,identity);
}

Fixed version (ground truth):
void login(){
  cellMoved(viewCell,viewCell.getWorldTransform());
  UniverseImpl.getUniverse().scheduleTransaction(new KernelRunnable(){
    public String getBaseTaskType(){
      return ViewCache.class.getName() + "String_Node_Str";
    }
    public void run() throws Exception {
synchronized (viewUpdateListeners) {
        for (        ViewUpdateListenerContainer cont : viewUpdateListeners.values())         cont.notifyListenersLogin();
      }
    }
  }
,identity);
}