nus-yam/ex-repair huggingface dataset:
Program: 45837
Project: 45837
Buggy source:
/** 
 * {@inheritDoc}
 */
public void HUDObjectChanged(HUDEvent event){
  logger.fine("String_Node_Str" + event);
  if (event.getObject() instanceof HUDComponent2D) {
    HUDComponent2D comp=(HUDComponent2D)event.getObject();
switch (event.getEventType()) {
case ADDED:
      addComponent(comp);
    break;
case REMOVED:
  removeComponent(comp);
break;
case APPEARED:
componentVisible(comp);
break;
case APPEARED_WORLD:
componentWorldVisible(comp);
break;
case DISAPPEARED:
componentInvisible(comp);
break;
case DISAPPEARED_WORLD:
componentWorldInvisible(comp);
break;
case CHANGED_MODE:
componentViewChanged(comp);
break;
case MOVED:
componentMoved(comp);
break;
case MOVED_WORLD:
componentMovedWorld(comp);
break;
case RESIZED:
componentResized(comp);
break;
case MINIMIZED:
componentMinimized(comp);
break;
case MAXIMIZED:
componentMaximized(comp);
break;
case ENABLED:
break;
case DISABLED:
break;
case CHANGED_TRANSPARENCY:
componentTransparencyChanged(comp);
break;
case CLOSED:
componentClosed(comp);
break;
default :
logger.info("String_Node_Str" + event.getEventType());
break;
}
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void HUDObjectChanged(HUDEvent event){
  logger.fine("String_Node_Str" + event);
  if (event.getObject() instanceof HUDComponent2D) {
    handleHUDComponentChanged(event);
  }
 else   if (event.getObject() instanceof HUD) {
    handleHUDChanged(event);
  }
}
Program: 45838
Project: 45838
Buggy source:
private void hudResized(HUD hud){
  logger.info("String_Node_Str" + hud);
  if ((hud != null) && huds.containsValue(hud)) {
    relayout(hud);
  }
}

Fixed version (ground truth):
private void hudResized(HUD hud){
  logger.fine("String_Node_Str" + hud);
  if ((hud != null) && huds.containsValue(hud)) {
    relayout(hud);
  }
}
Program: 45839
Project: 45839
Buggy source:
/** 
 * {@inheritDoc}
 */
public void relayout(HUD hud){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void relayout(HUD hud){
  if (layout != null) {
    layout.relayout();
  }
}
Program: 45840
Project: 45840
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void setViewCell(ViewCell viewCell){
  super.setViewCell(viewCell);
  ClientContextJME.getViewManager().register(viewCell);
  ClientContextJME.getViewManager().setPrimaryViewCell(viewCell);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void setViewCell(ViewCell viewCell){
  super.setViewCell(viewCell);
  ClientContextJME.getViewManager().register(viewCell,getSession());
  ClientContextJME.getViewManager().setPrimaryViewCell(viewCell);
}
Program: 45841
Project: 45841
Buggy source:
/** 
 * @{inheritDoc }
 */
public void apply(){
  CellServerState cellServerState=editor.getCellServerState();
  AudioTreatmentComponentServerState state=(AudioTreatmentComponentServerState)cellServerState.getComponentServerState(AudioTreatmentComponentServerState.class);
  if (state == null) {
    return;
  }
  state.setGroupId(audioGroupIdTextField.getText());
  String treatments=fileTextField.getText();
  treatments=treatments.replaceAll("String_Node_Str","String_Node_Str");
  treatments=treatments.replaceAll("String_Node_Str","String_Node_Str");
  String urls=urlTextField.getText();
  urls=urls.replaceAll("String_Node_Str","String_Node_Str");
  urls=urls.replaceAll("String_Node_Str","String_Node_Str");
  if (urls.length() > 0) {
    if (treatments.length() > 0) {
      treatments+="String_Node_Str" + urls.split("String_Node_Str");
    }
 else {
      treatments=urls;
    }
  }
  state.setTreatments(treatments.split("String_Node_Str"));
  state.setVolume(VolumeUtil.getServerVolume(volumeSlider.getValue()));
  state.setPlayWhen(playWhen);
  state.setExtent((Double)extentRadiusModel.getValue());
  state.setFullVolumeAreaPercent((Double)fullVolumeAreaPercentModel.getValue());
  state.setDistanceAttenuated(distanceAttenuated);
  state.setFalloff(falloffSlider.getValue());
  editor.addToUpdateList(state);
}

Fixed version (ground truth):
/** 
 * @{inheritDoc }
 */
public void apply(){
  CellServerState state=editor.getCellServerState();
  AudioTreatmentComponentServerState compState=(AudioTreatmentComponentServerState)state.getComponentServerState(AudioTreatmentComponentServerState.class);
  if (state == null) {
    return;
  }
  compState.setGroupId(audioGroupIdTextField.getText());
  String treatments=fileTextField.getText();
  treatments=treatments.replaceAll("String_Node_Str","String_Node_Str");
  treatments=treatments.replaceAll("String_Node_Str","String_Node_Str");
  String urls=urlTextField.getText();
  urls=urls.replaceAll("String_Node_Str","String_Node_Str");
  urls=urls.replaceAll("String_Node_Str","String_Node_Str");
  if (urls.length() > 0) {
    if (treatments.length() > 0) {
      treatments+="String_Node_Str" + urls.split("String_Node_Str");
    }
 else {
      treatments=urls;
    }
  }
  compState.setTreatments(treatments.split("String_Node_Str"));
  compState.setVolume(VolumeUtil.getServerVolume(volumeSlider.getValue()));
  compState.setPlayWhen(playWhen);
  compState.setExtent((Double)extentRadiusModel.getValue());
  compState.setFullVolumeAreaPercent((Double)fullVolumeAreaPercentModel.getValue());
  compState.setDistanceAttenuated(distanceAttenuated);
  compState.setFalloff(falloffSlider.getValue());
  editor.addToUpdateList(compState);
}
Program: 45843
Project: 45843
Buggy source:
/** 
 */
public void textMessage(String message,String fromUser,String toUser){
  if (toUser == null || toUser.equals("String_Node_Str")) {
    WeakReference<HUDComponent> ref=textChatHUDRefMap.get("String_Node_Str");
    if (ref == null) {
      return;
    }
    HUDComponent textChatHUDComponent=ref.get();
    TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
    textChatPanel.appendTextMessage(message,fromUser);
    return;
  }
synchronized (textChatHUDRefMap) {
    WeakReference<HUDComponent> ref=textChatHUDRefMap.get(fromUser);
    if (ref != null) {
      HUDComponent textChatHUDComponent=ref.get();
      TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
      textChatPanel.appendTextMessage(message,fromUser);
      return;
    }
    HUDComponent textChatHUDComponent=createTextChatHUD(fromUser);
    String name=BUNDLE.getString("String_Node_Str");
    name=MessageFormat.format(name,fromUser);
    textChatHUDComponent.setName(name);
    textChatHUDRefMap.put(fromUser,new WeakReference(textChatHUDComponent));
    TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
    textChatPanel.setActive(textChatConnection,toUser,fromUser);
    textChatPanel.appendTextMessage(message,fromUser);
    textChatHUDComponent.setVisible(true);
  }
}

Fixed version (ground truth):
/** 
 */
public void textMessage(final String message,final String fromUser,final String toUser){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      if (toUser == null || toUser.equals("String_Node_Str") == true) {
        WeakReference<HUDComponent> ref=textChatHUDRefMap.get("String_Node_Str");
        if (ref == null) {
          return;
        }
        HUDComponent textChatHUDComponent=ref.get();
        TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
        textChatPanel.appendTextMessage(message,fromUser);
        return;
      }
      WeakReference<HUDComponent> ref=textChatHUDRefMap.get(fromUser);
      if (ref != null) {
        HUDComponent textChatHUDComponent=ref.get();
        TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
        textChatPanel.appendTextMessage(message,fromUser);
        return;
      }
      HUDComponent hud=createTextChatHUD(fromUser,true);
      String name=BUNDLE.getString("String_Node_Str");
      name=MessageFormat.format(name,fromUser);
      hud.setName(name);
      TextChatPanel panel=textChatPanelRefMap.get(hud).get();
      panel.setActive(textChatConnection,toUser,fromUser);
      panel.appendTextMessage(message,fromUser);
      hud.setVisible(true);
    }
  }
);
}
Program: 45844
Project: 45844
Buggy source:
/** 
 * Unregister and menus we have created, etc.
 */
public void unregister(){
  for (  Map.Entry<String,WeakReference<HUDComponent>> entry : textChatHUDRefMap.entrySet()) {
    HUDComponent component=entry.getValue().get();
    component.setVisible(false);
  }
  textChatHUDRefMap.clear();
  loginInfo.removeLifecycleListener(sessionListener);
  JmeClientMain.getFrame().removeFromWindowMenu(textChatMenuItem);
}

Fixed version (ground truth):
/** 
 * Unregister and menus we have created, etc.
 */
public void unregister(){
  textChatConnection.removeTextChatListener(this);
  JmeClientMain.getFrame().removeFromWindowMenu(textChatMenuItem);
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      String name : textChatHUDRefMap.keySet()) {
        HUDComponent component=textChatHUDRefMap.get(name).get();
        component.setVisible(false);
      }
      textChatHUDRefMap.clear();
      textChatPanelRefMap.clear();
      textChatConnection.disconnect();
    }
  }
);
}
Program: 45845
Project: 45845
Buggy source:
/** 
 * Re-activates the text chat given the remote user's name, if such a frame exists. Displays a message in the window and turns on its GUI.
 */
public void reactivateChat(String remoteUser){
synchronized (textChatHUDRefMap) {
    WeakReference<HUDComponent> ref=textChatHUDRefMap.get(remoteUser);
    if (ref == null) {
      return;
    }
    HUDComponent textChatHUDComponent=ref.get();
    TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
    textChatPanel.reactivate();
  }
}

Fixed version (ground truth):
/** 
 * Re-activates the text chat given the remote user's name, if such a frame exists. Displays a message in the window and turns on its GUI.
 */
public void reactivateChat(final String remoteUser){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      WeakReference<HUDComponent> ref=textChatHUDRefMap.get(remoteUser);
      if (ref == null) {
        return;
      }
      HUDComponent textChatHUDComponent=ref.get();
      TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
      textChatPanel.reactivate();
    }
  }
);
}
Program: 45846
Project: 45846
Buggy source:
private HUDComponent createTextChatHUD(final String userKey){
  final TextChatPanel textChatPanel=new TextChatPanel();
  HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
  HUDComponent textChatHUDComponent=mainHUD.createComponent(textChatPanel);
  textChatHUDComponent.setIcon(new ImageIcon(getClass().getResource("String_Node_Str" + "String_Node_Str")));
  textChatHUDComponent.setPreferredLocation(Layout.SOUTHWEST);
  mainHUD.addComponent(textChatHUDComponent);
  textChatHUDComponent.addEventListener(new HUDEventListener(){
    public void HUDObjectChanged(    HUDEvent e){
      if (e.getEventType() == HUDEventType.CLOSED) {
synchronized (textChatHUDRefMap) {
          e.getObject().setVisible(false);
          WeakReference<HUDComponent> ref=textChatHUDRefMap.get(userKey);
          if (ref != null) {
            HUDComponent textChatHUDComponent=ref.get();
            textChatHUDRefMap.remove(userKey);
            textChatPanelRefMap.remove(textChatHUDComponent);
          }
        }
      }
    }
  }
);
  textChatPanelRefMap.put(textChatHUDComponent,new WeakReference(textChatPanel));
  return textChatHUDComponent;
}

Fixed version (ground truth):
/** 
 * Creates and returns a new text chat component, given the name of the remote user for which the text chat is assigned. If the "handleClose" argument is true, then the HUD Component is removed from the Maps when destroyed. NOTE: This method assumes it is being called on the AWT Event Thread
 */
private HUDComponent createTextChatHUD(final String userKey,boolean handleClose){
  final TextChatPanel textChatPanel=new TextChatPanel();
  HUD mainHUD=HUDManagerFactory.getHUDManager().getHUD("String_Node_Str");
  HUDComponent hudComponent=mainHUD.createComponent(textChatPanel);
  hudComponent.setIcon(new ImageIcon(getClass().getResource("String_Node_Str" + "String_Node_Str")));
  hudComponent.setPreferredLocation(Layout.SOUTHWEST);
  mainHUD.addComponent(hudComponent);
  if (handleClose == true) {
    hudComponent.addEventListener(new HUDEventListener(){
      public void HUDObjectChanged(      final HUDEvent e){
        if (e.getEventType() == HUDEventType.CLOSED) {
          SwingUtilities.invokeLater(new Runnable(){
            public void run(){
              e.getObject().setVisible(false);
              WeakReference<HUDComponent> ref=textChatHUDRefMap.get(userKey);
              if (ref != null) {
                HUDComponent hud=ref.get();
                textChatHUDRefMap.remove(userKey);
                textChatPanelRefMap.remove(hud);
              }
            }
          }
);
        }
      }
    }
);
  }
  textChatPanelRefMap.put(hudComponent,new WeakReference(textChatPanel));
  textChatHUDRefMap.put(userKey,new WeakReference(hudComponent));
  return hudComponent;
}
Program: 45847
Project: 45847
Buggy source:
public void actionPerformed(ActionEvent e){
  HUDComponent textChatHUDComponent=hudPanelRef.get();
  boolean show=!textChatHUDComponent.isVisible();
  textChatMenuItem.setState(show);
  textChatHUDComponent.setVisible(show);
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  HUDComponent hud=textChatHUDRefMap.get("String_Node_Str").get();
  boolean show=!hud.isVisible();
  textChatMenuItem.setState(show);
  hud.setVisible(show);
}
Program: 45848
Project: 45848
Buggy source:
public void HUDObjectChanged(HUDEvent e){
  if (e.getEventType() == HUDEventType.CLOSED) {
synchronized (textChatHUDRefMap) {
      e.getObject().setVisible(false);
      WeakReference<HUDComponent> ref=textChatHUDRefMap.get(userKey);
      if (ref != null) {
        HUDComponent textChatHUDComponent=ref.get();
        textChatHUDRefMap.remove(userKey);
        textChatPanelRefMap.remove(textChatHUDComponent);
      }
    }
  }
}

Fixed version (ground truth):
public void HUDObjectChanged(final HUDEvent e){
  if (e.getEventType() == HUDEventType.CLOSED) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        e.getObject().setVisible(false);
        WeakReference<HUDComponent> ref=textChatHUDRefMap.get(userKey);
        if (ref != null) {
          HUDComponent hud=ref.get();
          textChatHUDRefMap.remove(userKey);
          textChatPanelRefMap.remove(hud);
        }
      }
    }
);
  }
}
Program: 45849
Project: 45849
Buggy source:
/** 
 * Creates a new text chat window, given the remote participants user name and displays it.
 * @param remoteUser The remote participants user name
 */
public void startChat(String remoteUser){
synchronized (textChatHUDRefMap) {
    WeakReference<HUDComponent> ref=textChatHUDRefMap.get(remoteUser);
    if (ref != null) {
      return;
    }
    HUDComponent textChatHUDComponent=createTextChatHUD(remoteUser);
    String name=BUNDLE.getString("String_Node_Str");
    name=MessageFormat.format(name,remoteUser);
    textChatHUDComponent.setName(name);
    textChatHUDRefMap.put(remoteUser,new WeakReference(textChatHUDComponent));
    TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
    textChatPanel.setActive(textChatConnection,localUserName,remoteUser);
    textChatHUDComponent.setVisible(true);
  }
}

Fixed version (ground truth):
/** 
 * Creates a new text chat window, given the remote participants user name and displays it.
 * @param remoteUser The remote participants user name
 */
public void startChat(final String remoteUser){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      WeakReference<HUDComponent> ref=textChatHUDRefMap.get(remoteUser);
      if (ref != null) {
        return;
      }
      HUDComponent hud=createTextChatHUD(remoteUser,true);
      String name=BUNDLE.getString("String_Node_Str");
      name=MessageFormat.format(name,remoteUser);
      hud.setName(name);
      TextChatPanel panel=textChatPanelRefMap.get(hud).get();
      panel.setActive(textChatConnection,localUserName,remoteUser);
      hud.setVisible(true);
    }
  }
);
}
Program: 45850
Project: 45850
Buggy source:
/** 
 * Deactivates the text chat given the remote user's name, if such a frame exists. Displays a message in the window and turns off its GUI.
 * @param remoteUser The remote participants user name
 */
public void deactivateChat(String remoteUser){
synchronized (textChatHUDRefMap) {
    WeakReference<HUDComponent> ref=textChatHUDRefMap.get(remoteUser);
    if (ref == null) {
      return;
    }
    HUDComponent textChatHUDComponent=ref.get();
    TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
    textChatPanel.deactivate();
  }
}

Fixed version (ground truth):
/** 
 * Deactivates the text chat given the remote user's name, if such a frame exists. Displays a message in the window and turns off its GUI.
 * @param remoteUser The remote participants user name
 */
public void deactivateChat(final String remoteUser){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      WeakReference<HUDComponent> ref=textChatHUDRefMap.get(remoteUser);
      if (ref == null) {
        return;
      }
      HUDComponent textChatHUDComponent=ref.get();
      TextChatPanel textChatPanel=textChatPanelRefMap.get(textChatHUDComponent).get();
      textChatPanel.deactivate();
    }
  }
);
}
Program: 45851
Project: 45851
Buggy source:
private ChatManager(){
  textChatHUDRefMap=new HashMap();
  textChatPanelRefMap=new HashMap();
  HUDComponent textChatHUDComponent=createTextChatHUD("String_Node_Str");
  textChatHUDComponent.setName(BUNDLE.getString("String_Node_Str"));
  final WeakReference<HUDComponent> hudPanelRef=new WeakReference(textChatHUDComponent);
  textChatHUDRefMap.put("String_Node_Str",new WeakReference(textChatHUDComponent));
  textChatMenuItem=new JCheckBoxMenuItem(BUNDLE.getString("String_Node_Str"));
  textChatMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      HUDComponent textChatHUDComponent=hudPanelRef.get();
      boolean show=!textChatHUDComponent.isVisible();
      textChatMenuItem.setState(show);
      textChatHUDComponent.setVisible(show);
    }
  }
);
  textChatMenuItem.setEnabled(false);
  JmeClientMain.getFrame().addToWindowMenu(textChatMenuItem,2);
  sessionListener=new SessionLifecycleListener(){
    public void sessionCreated(    WonderlandSession session){
    }
    public void primarySession(    WonderlandSession session){
      setPrimarySession(session);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Private constructor, singelton pattern
 */
private ChatManager(){
  textChatHUDRefMap=new HashMap();
  textChatPanelRefMap=new HashMap();
  textChatMenuItem=new JCheckBoxMenuItem(BUNDLE.getString("String_Node_Str"));
  textChatMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      HUDComponent hud=textChatHUDRefMap.get("String_Node_Str").get();
      boolean show=!hud.isVisible();
      textChatMenuItem.setState(show);
      hud.setVisible(show);
    }
  }
);
  textChatMenuItem.setEnabled(false);
}
Program: 45852
Project: 45852
Buggy source:
/** 
 * Registers the primary session
 */
public void register(ServerSessionManager loginInfo){
  this.loginInfo=loginInfo;
  loginInfo.addLifecycleListener(sessionListener);
  if (loginInfo.getPrimarySession() != null) {
    setPrimarySession(loginInfo.getPrimarySession());
  }
}

Fixed version (ground truth):
/** 
 * Registers the primary session
 */
public void register(WonderlandSession session){
  localUserName=session.getUserID().getUsername();
  textChatConnection=new TextChatConnection();
  textChatConnection.addTextChatListener(this);
  try {
    textChatConnection.connect(session);
  }
 catch (  ConnectionFailureException excp) {
    LOGGER.log(Level.WARNING,"String_Node_Str" + "String_Node_Str",excp);
    return;
  }
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      HUDComponent hud=createTextChatHUD("String_Node_Str",false);
      hud.setName("String_Node_Str");
      TextChatPanel panel=textChatPanelRefMap.get(hud).get();
      panel.setActive(textChatConnection,localUserName,"String_Node_Str");
      textChatMenuItem.setEnabled(true);
      textChatMenuItem.setSelected(true);
      hud.setVisible(true);
      hud.addEventListener(new HUDEventListener(){
        public void HUDObjectChanged(        HUDEvent event){
          if (event.getEventType() == HUDEventType.CLOSED) {
            SwingUtilities.invokeLater(new Runnable(){
              public void run(){
                textChatMenuItem.setSelected(false);
              }
            }
);
          }
        }
      }
);
      JmeClientMain.getFrame().addToWindowMenu(textChatMenuItem,2);
    }
  }
);
}
Program: 45853
Project: 45853
Buggy source:
/** 
 * Apply the model transform the modelBG node
 */
public void applyModelTransform(Node modelBG){
  modelBG.setLocalScale(modelBGScale);
  modelBG.setLocalTranslation(modelBGTranslation);
  modelBG.setLocalRotation(modelBGRotation);
}

Fixed version (ground truth):
/** 
 * Apply the model transform the modelBG node
 */
public void applyModelTransform(Node modelBG){
  if (getModelScale() != null)   modelBG.setLocalScale(getModelScale());
  if (getModelTranslation() != null)   modelBG.setLocalTranslation(getModelTranslation());
  if (getModelRotation() != null)   modelBG.setLocalRotation(getModelRotation());
}
Program: 45854
Project: 45854
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellClientState clientState){
  super.setClientState(clientState);
  App2DCellClientState state=(App2DCellClientState)clientState;
  pixelScale=state.getPixelScale();
  logger.info("String_Node_Str" + state.isInitialPlacementDone());
  if (App2D.doAppInitialPlacement && !state.isInitialPlacementDone()) {
    logger.info("String_Node_Str" + state.getCreatorViewTransform());
    fvi=new FirstVisibleInitializerCell(this,state.getCreatorViewTransform(),initialPlacementSize);
    logger.info("String_Node_Str" + fvi);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellClientState clientState){
  super.setClientState(clientState);
  App2DCellClientState state=(App2DCellClientState)clientState;
  pixelScale=state.getPixelScale();
  logger.info("String_Node_Str" + state.isInitialPlacementDone());
  if (App2D.doAppInitialPlacement && !state.isInitialPlacementDone()) {
    CellTransform creatorViewTransform=state.getCreatorViewTransform();
    logger.info("String_Node_Str" + creatorViewTransform);
    if (creatorViewTransform != null) {
      fvi=new FirstVisibleInitializerCell(this,creatorViewTransform,initialPlacementSize);
    }
    logger.info("String_Node_Str" + fvi);
  }
}
Program: 45855
Project: 45855
Buggy source:
public void triggerGoto(Vector3f position,Quaternion look){
  CharacterController cc=avatarCharacter.getContext().getController();
  PPolygonModelInstance body=cc.getModelInstance();
  PMatrix newPosition=new PMatrix(body.getTransform().getLocalMatrix(false));
  newPosition.setTranslation(position);
  newPosition.setRotation(look);
  body.getTransform().getLocalMatrix(true).set(newPosition);
  cc.notifyTransfromUpdate(position,newPosition);
}

Fixed version (ground truth):
public void triggerGoto(Vector3f position,Quaternion look){
  CellTransform transform=new CellTransform();
  transform.setRotation(look);
  transform.setTranslation(position);
  cell.getComponent(MovableComponent.class).localMoveRequest(transform);
  avatarCharacter.getModelInst().setTransform(new PTransform(look,position,new Vector3f(1,1,1)));
}
Program: 45856
Project: 45856
Buggy source:
/** 
 * Actually removes the given cell factory from the maps. This method assumed synchronized access.
 */
private void removeFactory(CellFactorySPI factory){
  String[] extensions=factory.getExtensions();
  if (extensions != null) {
    for (    String extension : extensions) {
      extension=extension.toLowerCase();
      Set<CellFactorySPI> factories=cellFactoryExtensionMap.get(extension);
      if (factories != null) {
        factories.remove(factory);
        if (factories.isEmpty()) {
          cellFactoryExtensionMap.remove(factories);
        }
      }
    }
  }
  cellFactorySet.remove(factory);
}

Fixed version (ground truth):
/** 
 * Actually removes the given cell factory from the maps. This method assumed synchronized access.
 */
private void removeFactory(CellFactorySPI factory){
  String[] extensions=factory.getExtensions();
  if (extensions != null) {
    for (    String extension : extensions) {
      extension=extension.toLowerCase();
      Set<CellFactorySPI> factories=cellFactoryExtensionMap.get(extension);
      if (factories != null) {
        factories.remove(factory);
        if (factories.isEmpty() == true) {
          cellFactoryExtensionMap.remove(extension);
        }
      }
    }
  }
  cellFactorySet.remove(factory);
}
Program: 45857
Project: 45857
Buggy source:
public Node loadDeployedModel(DeployedModel model){
  try {
    load(AssetUtils.getAssetURL(model.getModelURL()));
  }
 catch (  IOException ex) {
    Logger.getLogger(JmeColladaLoader.class.getName()).log(Level.SEVERE,null,ex);
  }
  return null;
}

Fixed version (ground truth):
public Node loadDeployedModel(DeployedModel model){
  String baseURL=null;
  try {
    baseURL=AssetUtils.getAssetURL(model.getModelURL().substring(0,model.getModelURL().lastIndexOf('/') + 1)).toExternalForm();
  }
 catch (  MalformedURLException ex) {
    Logger.getLogger(MtgLoader.class.getName()).log(Level.SEVERE,null,ex);
  }
  ClientContextJME.getWorldManager().setConfigBaseURL(baseURL.substring(0,baseURL.length() - 1));
  try {
    load(AssetUtils.getAssetURL(model.getModelURL()));
  }
 catch (  IOException ex) {
    Logger.getLogger(JmeColladaLoader.class.getName()).log(Level.SEVERE,null,ex);
  }
  return new Node("String_Node_Str");
}
Program: 45858
Project: 45858
Buggy source:
private void startTheSlave(String connectionInfo){
  app=startSlave(connectionInfo,fvi);
  if (app != null) {
    slaveStarted=true;
    logger.info("String_Node_Str" + connectionInfo);
  }
 else {
    slaveStarted=false;
    logger.warning("String_Node_Str" + connectionInfo);
  }
}

Fixed version (ground truth):
private void startTheSlave(String connectionInfo){
  logger.info("String_Node_Str");
  app=startSlave(connectionInfo,fvi);
  if (app != null) {
    slaveStarted=true;
    logger.info("String_Node_Str" + connectionInfo);
  }
 else {
    slaveStarted=false;
    logger.warning("String_Node_Str" + connectionInfo);
  }
}
Program: 45859
Project: 45859
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void setStatus(CellStatus status,boolean increasing){
  super.setStatus(status,increasing);
  if (status == CellStatus.INACTIVE && increasing) {
    AppConventionalMessageReceiver mr=new AppConventionalMessageReceiver();
    channel.addMessageReceiver(AppConventionalCellSetConnectionInfoMessage.class,mr);
    channel.addMessageReceiver(AppConventionalCellAppExittedMessage.class,mr);
  }
 else   if (status == CellStatus.INACTIVE && !increasing) {
    channel.removeMessageReceiver(AppConventionalCellSetConnectionInfoMessage.class);
    channel.removeMessageReceiver(AppConventionalCellAppExittedMessage.class);
  }
  if (status == CellStatus.VISIBLE && increasing && !appStarted) {
    if (launchLocation.equalsIgnoreCase("String_Node_Str") && launchUser.equals(cellCacheSession.getUserID().getUsername())) {
      StartMasterReturnInfo ret=startMaster(appName,command,fvi);
      if (ret == null || ret.connInfo == null) {
        logger.warning("String_Node_Str" + appName);
        return;
      }
      connectionInfo=ret.connInfo;
      logger.info("String_Node_Str" + getCellID() + "String_Node_Str"+ connectionInfo);
      AppConventionalCellSetConnectionInfoMessage msg=new AppConventionalCellSetConnectionInfoMessage(getCellID(),connectionInfo);
      channel.send(msg);
      this.app=ret.app;
    }
 else {
      if (connectionInfo != null) {
        logger.info("String_Node_Str");
        startTheSlave(connectionInfo);
      }
    }
    appStarted=true;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void setStatus(CellStatus status,boolean increasing){
  super.setStatus(status,increasing);
  if (status == CellStatus.INACTIVE && increasing) {
    AppConventionalMessageReceiver mr=new AppConventionalMessageReceiver();
    channel.addMessageReceiver(AppConventionalCellSetConnectionInfoMessage.class,mr);
    channel.addMessageReceiver(AppConventionalCellAppExittedMessage.class,mr);
  }
 else   if (status == CellStatus.INACTIVE && !increasing) {
    channel.removeMessageReceiver(AppConventionalCellSetConnectionInfoMessage.class);
    channel.removeMessageReceiver(AppConventionalCellAppExittedMessage.class);
  }
  if (status == CellStatus.ACTIVE) {
    if (increasing) {
      cellRendererExists=true;
    }
 else {
      cellRendererExists=false;
    }
    startSlaveIfReady();
  }
  if (status == CellStatus.VISIBLE && increasing) {
    startSlaveIfReady();
  }
}
Program: 45860
Project: 45860
Buggy source:
/** 
 * This is called when the server sends the connection info.
 */
synchronized void setConnectionInfo(String connInfo){
  if (connectionInfo != null) {
    return;
  }
  if (slaveStarted)   return;
  if (connInfo != null) {
    connectionInfo=connInfo;
    logger.info("String_Node_Str");
    startTheSlave(connectionInfo);
  }
}

Fixed version (ground truth):
/** 
 * This is called when the server sends the connection info.
 */
synchronized void setConnectionInfo(String connInfo){
  if (connectionInfo != null) {
    return;
  }
  if (slaveStarted)   return;
  connectionInfo=connInfo;
  startSlaveIfReady();
}
Program: 45862
Project: 45862
Buggy source:
/** 
 * Deploy the dae files to the server, source[0] is the primary file.
 * @param moduleArtRootDir
 */
protected void deployModels(File targetDir,String moduleName,DeployedModel deployedModel,ImportedModel importedModel,HashMap<String,String> deploymentMapping,ModelCellComponentServerState state){
  URL[] source=importedModel.getAllOriginalModels();
  String filename=getFilename(importedModel.getOriginalURL());
  String filenameGZ=filename + "String_Node_Str";
  File targetFile=new File(targetDir,filenameGZ);
  try {
    targetFile.createNewFile();
    copyAsset(source[0],targetFile,true);
    deployedModel.setModelURL("String_Node_Str" + moduleName + "String_Node_Str"+ filename+ "String_Node_Str"+ filenameGZ);
    deployedModel.setLoaderDataURL(deployedModel.getModelURL() + "String_Node_Str");
    deployDeploymentData(targetDir,deployedModel,filenameGZ);
    state.setDeployedModelURL(deployedModel.getModelURL() + "String_Node_Str");
  }
 catch (  IOException ex) {
    Logger.getLogger(JmeColladaLoader.class.getName()).log(Level.SEVERE,"String_Node_Str" + targetFile,ex);
  }
}

Fixed version (ground truth):
/** 
 * Deploy the dae files to the server, source[0] is the primary file.
 * @param moduleArtRootDir
 */
protected void deployModels(File targetDir,String moduleName,DeployedModel deployedModel,ImportedModel importedModel,HashMap<String,String> deploymentMapping,ModelCellComponentServerState state){
  URL[] source=importedModel.getAllOriginalModels();
  String filename=getFilename(importedModel.getOriginalURL());
  String filenameGZ=filename + "String_Node_Str";
  File targetFile=new File(targetDir,filenameGZ);
  try {
    targetFile.createNewFile();
    copyAsset(source[0],targetFile,true);
    deployedModel.setModelURL(importedModel.getDeploymentBaseURL() + filename + "String_Node_Str"+ filenameGZ);
    deployedModel.setLoaderDataURL(deployedModel.getModelURL() + "String_Node_Str");
    deployDeploymentData(targetDir,deployedModel,filenameGZ);
    state.setDeployedModelURL(deployedModel.getModelURL() + "String_Node_Str");
  }
 catch (  IOException ex) {
    Logger.getLogger(JmeColladaLoader.class.getName()).log(Level.SEVERE,"String_Node_Str" + targetFile,ex);
  }
}
Program: 45864
Project: 45864
Buggy source:
@Override public CellComponentClientState getClientState(CellComponentClientState state,WonderlandClientID clientID,ClientCapabilities capabilities){
  if (state == null) {
    state=new JmeColladaCellComponentClientState();
  }
  serverState.setClientState((JmeColladaCellComponentClientState)state);
  return state;
}

Fixed version (ground truth):
@Override public CellComponentClientState getClientState(CellComponentClientState state,WonderlandClientID clientID,ClientCapabilities capabilities){
  if (state == null) {
    state=new JmeColladaCellComponentClientState();
  }
  ((JmeColladaCellComponentServerState)serverState).setClientState((JmeColladaCellComponentClientState)state);
  return state;
}
Program: 45866
Project: 45866
Buggy source:
private void animateCallAnswer(){
  if (chatType.equals(ChatType.PRIVATE)) {
    client.getWlAvatarCharacter().playAnimation("String_Node_Str");
    logger.warning("String_Node_Str");
  }
 else {
    client.getWlAvatarCharacter().stop();
    logger.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
private void animateCallAnswer(){
  if (true) {
    return;
  }
  WlAvatarCharacter avatar=client.getWlAvatarCharacter();
  if (avatar == null) {
    return;
  }
  String answerCell=null;
  for (  String action : avatar.getAnimationNames()) {
    if (action.indexOf("String_Node_Str") > 0) {
      answerCell=action;
      break;
    }
  }
  if (answerCell == null) {
    return;
  }
  if (chatType.equals(ChatType.PRIVATE)) {
    avatar.playAnimation(answerCell);
    logger.warning("String_Node_Str");
  }
 else {
    avatar.stop();
    logger.warning("String_Node_Str");
  }
}
Program: 45867
Project: 45867
Buggy source:
private void addMembers(){
  clearUserList();
  addToUserList(myPresenceInfo);
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
synchronized (members) {
      if (members.contains(info)) {
        if (info.equals(myPresenceInfo) == false) {
          addToUserList(info);
        }
        addBystanders(info);
      }
    }
  }
}

Fixed version (ground truth):
private void addMembers(){
  clearUserList();
  addToUserList(myPresenceInfo);
  PresenceInfo[] presenceInfoList=pm.getAllUsers();
  for (int i=0; i < presenceInfoList.length; i++) {
    PresenceInfo info=presenceInfoList[i];
    if (info.callID == null) {
      continue;
    }
synchronized (members) {
synchronized (invitedMembers) {
        if (members.contains(info)) {
          if (info.equals(myPresenceInfo) == false) {
            addToUserList(info);
          }
          addBystanders(info);
        }
 else         if (invitedMembers.contains(info)) {
          if (info.equals(myPresenceInfo) == false) {
            addToUserList(info);
          }
        }
      }
    }
  }
}
Program: 45868
Project: 45868
Buggy source:
private void saveAsModuleBActionPerformed(java.awt.event.ActionEvent evt){
  ArrayList<DeployedModel> deploymentInfo=new ArrayList();
  JFileChooser chooser=new JFileChooser();
  chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  int returnVal=chooser.showOpenDialog(ImportSessionFrame.this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    createModuleJar(deploymentInfo,chooser.getSelectedFile());
  }
}

Fixed version (ground truth):
private void saveAsModuleBActionPerformed(java.awt.event.ActionEvent evt){
  ArrayList<DeployedModel> deploymentInfo=new ArrayList();
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle(BUNDLE.getString("String_Node_Str"));
  chooser.setApproveButtonText(BUNDLE.getString("String_Node_Str"));
  chooser.setDialogType(JFileChooser.SAVE_DIALOG);
  chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  int returnVal=chooser.showSaveDialog(ImportSessionFrame.this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    createModuleJar(deploymentInfo,chooser.getSelectedFile());
  }
}
Program: 45871
Project: 45871
Buggy source:
/** 
 * Asynchronously loads the set of avatars from all of the various sources in the system.
 */
public void load(){
synchronized (currentState) {
    if (currentState == State.LOADING) {
      logger.warning("String_Node_Str");
      return;
    }
 else     if (currentState == State.READY) {
      logger.warning("String_Node_Str");
      return;
    }
    currentState=State.LOADING;
  }
  Set<AvatarFactorySPI> factorySet=new HashSet();
  ScannedClassLoader scl=manager.getClassloader();
  Iterator<AvatarFactorySPI> it=scl.getAll(AvatarFactory.class,AvatarFactorySPI.class);
  while (it.hasNext() == true) {
    factorySet.add(it.next());
  }
  for (  AvatarFactorySPI factory : factorySet) {
    loadingSet.add((Class<AvatarFactorySPI>)factory.getClass());
  }
  for (  AvatarFactorySPI factory : factorySet) {
    final AvatarFactorySPI f=factory;
    logger.warning("String_Node_Str" + f.getClass().getName());
    new Thread(){
      @Override public void run(){
        try {
          f.registerAvatars(manager);
        }
 catch (        java.lang.Exception excp) {
          logger.log(Level.WARNING,"String_Node_Str",excp);
        }
 finally {
          loadingComplete((Class<AvatarFactorySPI>)f.getClass());
        }
      }
    }
.start();
  }
}

Fixed version (ground truth):
/** 
 * Asynchronously loads the set of avatars from all of the various sources in the system.
 */
public void load(){
synchronized (currentState) {
    if (currentState == State.LOADING) {
      logger.warning("String_Node_Str");
      return;
    }
 else     if (currentState == State.READY) {
      logger.warning("String_Node_Str");
      return;
    }
    currentState=State.LOADING;
  }
  Set<AvatarFactorySPI> factorySet=new HashSet();
  ScannedClassLoader scl=manager.getClassloader();
  Iterator<AvatarFactorySPI> it=scl.getAll(AvatarFactory.class,AvatarFactorySPI.class);
  while (it.hasNext() == true) {
    factorySet.add(it.next());
  }
  for (  AvatarFactorySPI factory : factorySet) {
    loadingSet.add((Class<AvatarFactorySPI>)factory.getClass());
  }
  for (  AvatarFactorySPI factory : factorySet) {
    final AvatarFactorySPI f=factory;
    logger.info("String_Node_Str" + f.getClass().getName());
    new Thread(){
      @Override public void run(){
        try {
          f.registerAvatars(manager);
        }
 catch (        java.lang.Exception excp) {
          logger.log(Level.WARNING,"String_Node_Str",excp);
        }
 finally {
          loadingComplete((Class<AvatarFactorySPI>)f.getClass());
        }
      }
    }
.start();
  }
}
Program: 45872
Project: 45872
Buggy source:
/** 
 * Sets the state of the avatar session loader.
 * @param state The new state
 */
public void setState(State state){
synchronized (currentState) {
    logger.warning("String_Node_Str" + state);
    currentState=state;
    fireAvatarLoaderStateEvent(state);
  }
}

Fixed version (ground truth):
/** 
 * Sets the state of the avatar session loader.
 * @param state The new state
 */
public void setState(State state){
synchronized (currentState) {
    logger.info("String_Node_Str" + state);
    currentState=state;
    fireAvatarLoaderStateEvent(state);
  }
}
Program: 45873
Project: 45873
Buggy source:
/** 
 * Removes an avatar factory from the set of loading. This updates the state of the loader session to READY once this set is empty.
 * @param clazz The AvatarFactorySPI Class to remove
 */
public void loadingComplete(Class<AvatarFactorySPI> clazz){
synchronized (loadingSet) {
    logger.warning("String_Node_Str" + clazz.getName());
    loadingSet.remove(clazz);
    if (loadingSet.isEmpty() == true) {
      setState(State.READY);
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes an avatar factory from the set of loading. This updates the state of the loader session to READY once this set is empty.
 * @param clazz The AvatarFactorySPI Class to remove
 */
public void loadingComplete(Class<AvatarFactorySPI> clazz){
synchronized (loadingSet) {
    logger.info("String_Node_Str" + clazz.getName());
    loadingSet.remove(clazz);
    if (loadingSet.isEmpty() == true) {
      setState(State.READY);
    }
  }
}
Program: 45875
Project: 45875
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellComponentClientState clientState){
  super.setClientState(clientState);
  avatarConfigInfo=((AvatarConfigComponentClientState)clientState).getAvatarConfigInfo();
  try {
    if (avatarConfigInfo != null) {
      String str=avatarConfigInfo.getAvatarConfigURL();
      if (str != null) {
        if (str.startsWith("String_Node_Str") == true) {
          URL newURL=AssetUtils.getAssetURL("String_Node_Str" + str,cell);
          System.err.println("String_Node_Str" + str);
          avatarConfigInfo=new AvatarConfigInfo(newURL.toExternalForm(),avatarConfigInfo.getLoaderFactoryClassName());
        }
      }
    }
  }
 catch (  MalformedURLException ex) {
    Logger.getLogger(AvatarConfigComponent.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void setClientState(CellComponentClientState clientState){
  super.setClientState(clientState);
  avatarConfigInfo=((AvatarConfigComponentClientState)clientState).getAvatarConfigInfo();
  try {
    if (avatarConfigInfo != null) {
      String str=avatarConfigInfo.getAvatarConfigURL();
      if (str != null) {
        if (str.startsWith("String_Node_Str") == true) {
          URL newURL=AssetUtils.getAssetURL("String_Node_Str" + str,cell);
          avatarConfigInfo=new AvatarConfigInfo(newURL.toExternalForm(),avatarConfigInfo.getLoaderFactoryClassName());
        }
      }
    }
  }
 catch (  MalformedURLException ex) {
    Logger.getLogger(AvatarConfigComponent.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 45877
Project: 45877
Buggy source:
/** 
 * Sets the current attributes of the avatar and refreshes the GUI. NOTE: This method assumes it is being called in the AWT Event Thread.
 * @param attributes The attribute of the avatar configuration
 */
public void setAttributes(WonderlandCharacterParams attributes){
  if (EventQueue.isDispatchThread() == false) {
    logger.warning("String_Node_Str");
  }
  currentParams=attributes.clone();
  populateComboBox(hairComboBox,ConfigType.HAIR,"String_Node_Str");
  populateComboBox(headComboBox,ConfigType.HEAD,"String_Node_Str");
  populateComboBox(torsoComboBox,ConfigType.TORSO,"String_Node_Str");
  populateComboBox(legsComboBox,ConfigType.LEGS,"String_Node_Str");
  populateComboBox(jacketComboBox,ConfigType.JACKET,"String_Node_Str");
  populateComboBox(handsComboBox,ConfigType.HANDS,"String_Node_Str");
  populateComboBox(feetComboBox,ConfigType.FEET,"String_Node_Str");
  updateAvatarName();
  updateGender();
  updateComboBoxes();
}

Fixed version (ground truth):
/** 
 * Sets the current attributes of the avatar and refreshes the GUI. NOTE: This method assumes it is being called in the AWT Event Thread.
 * @param attributes The attribute of the avatar configuration
 */
public void setAttributes(WonderlandCharacterParams attributes){
  if (EventQueue.isDispatchThread() == false) {
    logger.severe("String_Node_Str");
  }
  currentParams=attributes.clone();
  populateComboBox(hairComboBox,ConfigType.HAIR,"String_Node_Str");
  populateComboBox(headComboBox,ConfigType.HEAD,"String_Node_Str");
  populateComboBox(torsoComboBox,ConfigType.TORSO,"String_Node_Str");
  populateComboBox(legsComboBox,ConfigType.LEGS,"String_Node_Str");
  populateComboBox(jacketComboBox,ConfigType.JACKET,"String_Node_Str");
  populateComboBox(handsComboBox,ConfigType.HANDS,"String_Node_Str");
  populateComboBox(feetComboBox,ConfigType.FEET,"String_Node_Str");
  updateAvatarName();
  updateGender();
  updateComboBoxes();
}
Program: 45878
Project: 45878
Buggy source:
@Override public void compute(ProcessorArmingCollection arg0){
  for (  Event evt : events) {
    System.err.println(evt);
    if (evt instanceof KeyEvent3D && evt.isFocussed()) {
      KeyEvent ke=(KeyEvent)((KeyEvent3D)evt).getAwtEvent();
      inputGroup.processKeyEvent(ke);
    }
 else     if (evt instanceof MouseEvent3D && evt.isFocussed()) {
      MouseEvent me=(MouseEvent)((MouseEvent3D)evt).getAwtEvent();
      inputGroup.processMouseEvent(me);
    }
  }
  events.clear();
}

Fixed version (ground truth):
@Override public void compute(ProcessorArmingCollection arg0){
  for (  Event evt : events) {
    if (evt instanceof KeyEvent3D && evt.isFocussed()) {
      KeyEvent ke=(KeyEvent)((KeyEvent3D)evt).getAwtEvent();
      inputGroup.processKeyEvent(ke);
    }
 else     if (evt instanceof MouseEvent3D && evt.isFocussed()) {
      MouseEvent me=(MouseEvent)((MouseEvent3D)evt).getAwtEvent();
      inputGroup.processMouseEvent(me);
    }
  }
  events.clear();
}
Program: 45879
Project: 45879
Buggy source:
public void loadAndChangeAvatar(final AvatarConfigInfo avatarConfigInfo){
  logger.warning("String_Node_Str");
  WlAvatarCharacter avatar=loadAvatar(avatarConfigInfo);
  logger.warning("String_Node_Str");
  changeAvatar(avatar);
  logger.warning("String_Node_Str");
}

Fixed version (ground truth):
public void loadAndChangeAvatar(final AvatarConfigInfo avatarConfigInfo){
  logger.info("String_Node_Str");
  WlAvatarCharacter avatar=loadAvatar(avatarConfigInfo);
  logger.info("String_Node_Str");
  changeAvatar(avatar);
  logger.info("String_Node_Str");
}
Program: 45881
Project: 45881
Buggy source:
@Override public void cellTransformUpdate(CellTransform transform){
  if (!selectedForInput && avatarCharacter != null && avatarCharacter.getContext().getController().getModelInstance() != null) {
    if (avatarCharacter.getContext().getBehaviorManager().isEnabled() && avatarCharacter.getContext().getBehaviorManager().getCurrentTask() != null) {
      System.err.println("String_Node_Str");
    }
 else {
      Vector3f pos=transform.getTranslation(null);
      Vector3f dir=new Vector3f(0,0,-1);
      transform.getRotation(null).multLocal(dir);
      PMatrix local=avatarCharacter.getContext().getController().getModelInstance().getTransform().getLocalMatrix(true);
      final Vector3f currentPosition=local.getTranslation();
      float currentDistance=currentPosition.distance(pos);
      if (currentDistance < positionMaxDistanceForPull) {
        pos.set(currentPosition);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void cellTransformUpdate(CellTransform transform){
  if (!selectedForInput && avatarCharacter != null && avatarCharacter.getContext().getController().getModelInstance() != null) {
    if (avatarCharacter.getContext().getBehaviorManager().isEnabled() && avatarCharacter.getContext().getBehaviorManager().getCurrentTask() != null) {
    }
 else {
      Vector3f pos=transform.getTranslation(null);
      Vector3f dir=new Vector3f(0,0,-1);
      transform.getRotation(null).multLocal(dir);
      PMatrix local=avatarCharacter.getContext().getController().getModelInstance().getTransform().getLocalMatrix(true);
      final Vector3f currentPosition=local.getTranslation();
      float currentDistance=currentPosition.distance(pos);
      if (currentDistance < positionMaxDistanceForPull) {
        pos.set(currentPosition);
      }
    }
  }
}