Program: 45467
Project: 45467
Buggy source:
/** 
 */
@Override public void initialize(ServerSessionManager manager){
  loaderMap=new HashMap();
  avatarChangedListener=new AvatarChangedListener(){
    public void avatarChanged(    Avatar newAvatar){
      if (camState != null) {
        avatarCellRenderer.removeAvatarChangedListener(avatarChangedListener);
        if (newAvatar.getContext() != null) {
          camState.setTargetCharacter(newAvatar);
        }
 else {
          camState.setTargetCharacter(null);
        }
        ViewManager viewManager=ViewManager.getViewManager();
        ViewCell viewCell=viewManager.getPrimaryViewCell();
        CellTransform transform=viewCell.getWorldTransform();
        Vector3f translation=transform.getTranslation(null);
        Vector3f offset=new Vector3f(0.0f,4.0f,-10.0f);
        camState.setCameraPosition(translation.add(offset));
      }
    }
  }
;
  chaseCameraMI=new JRadioButtonMenuItem(bundle.getString("String_Node_Str"));
  chaseCameraMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      ViewManager viewManager=ViewManager.getViewManager();
      ViewCell viewCell=viewManager.getPrimaryViewCell();
      CellTransform transform=viewCell.getWorldTransform();
      Vector3f translation=transform.getTranslation(null);
      Vector3f offset=new Vector3f(0.0f,4.0f,-10.0f);
      if (camState == null) {
        camModel=(ChaseCamModel)CameraModels.getCameraModel(ChaseCamModel.class);
        camState=new ChaseCamState(offset,new Vector3f(0.0f,1.8f,0.0f));
        camState.setDamping(1.7f);
        camState.setLookAtDamping(1.7f);
      }
      camState.setCameraPosition(translation.add(offset));
      camState.setTargetCharacter(avatarCellRenderer.getAvatarCharacter());
      FlexibleCameraAdapter chaseCamera=new FlexibleCameraAdapter(camModel,camState);
      viewManager.setCameraController(chaseCamera);
    }
  }
);
  gestureMI=new JCheckBoxMenuItem(bundle.getString("String_Node_Str"));
  gestureMI.setSelected(false);
  gestureMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (gestureHUDRef == null || gestureHUDRef.get() == null) {
        GestureHUD hud=new GestureHUD();
        hud.setAvatarCharacter(avatarCellRenderer.getAvatarCharacter());
        gestureHUDRef=new WeakReference(hud);
      }
      gestureHUDEnabled=!gestureHUDEnabled;
      gestureMI.setSelected(gestureHUDEnabled);
      ((GestureHUD)gestureHUDRef.get()).setVisible(gestureHUDEnabled);
    }
  }
);
  avatarConfigMI=new JMenuItem(bundle.getString("String_Node_Str"));
  avatarConfigMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      AvatarConfigFrame f=new AvatarConfigFrame();
      f.setVisible(true);
    }
  }
);
  collisionResponseEnabledMI=new JCheckBoxMenuItem(bundle.getString("String_Node_Str"));
  collisionResponseEnabledMI.setSelected(true);
  collisionResponseEnabledMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean isCollisionResponse=collisionResponseEnabledMI.isSelected();
      boolean isGravity=gravityEnabledMI.isSelected();
      ClientContext.getInputManager().postEvent(new AvatarCollisionChangeRequestEvent(isCollisionResponse,isGravity));
    }
  }
);
  gravityEnabledMI=new JCheckBoxMenuItem(bundle.getString("String_Node_Str"));
  gravityEnabledMI.setSelected(true);
  gravityEnabledMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean isCollisionResponse=collisionResponseEnabledMI.isSelected();
      boolean isGravity=gravityEnabledMI.isSelected();
      ClientContext.getInputManager().postEvent(new AvatarCollisionChangeRequestEvent(isCollisionResponse,isGravity));
    }
  }
);
  ctxListener=new ContextMenuListener(){
    public void contextMenuDisplayed(    ContextMenuEvent event){
      if (!(event.getPrimaryCell() instanceof AvatarCell)) {
        return;
      }
      ContextMenuInvocationSettings settings=event.getSettings();
      settings.setDisplayStandard(false);
      settings.setDisplayCellStandard(false);
      AvatarCell cell=(AvatarCell)event.getPrimaryCell();
      settings.setMenuName(cell.getIdentity().getUsername());
      if (cell == ViewManager.getViewManager().getPrimaryViewCell()) {
        settings.addTempFactory(new ConfigureContextMenuFactory());
      }
    }
  }
;
  ClientContextJME.getAvatarRenderManager().registerRenderer(manager,AvatarImiJME.class,AvatarControls.class);
  try {
    String serverHostAndPort=manager.getServerNameAndPort();
    String baseURL="String_Node_Str";
    URL url=AssetUtils.getAssetURL(baseURL,serverHostAndPort);
    WorldManager worldManager=ClientContextJME.getWorldManager();
    worldManager.addUserData(Repository.class,new Repository(worldManager,new WonderlandAvatarCache(url.toExternalForm(),ClientContext.getUserDirectory("String_Node_Str"))));
  }
 catch (  MalformedURLException excp) {
    logger.log(Level.WARNING,"String_Node_Str",excp);
  }
catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
  AvatarSystem.initialize(ClientContextJME.getWorldManager());
  super.initialize(manager);
}

Fixed version (ground truth):
/** 
 */
@Override public void initialize(ServerSessionManager manager){
  loaderMap=new HashMap();
  avatarChangedListener=new AvatarChangedListener(){
    public void avatarChanged(    Avatar newAvatar){
      if (camState != null) {
        avatarCellRenderer.removeAvatarChangedListener(avatarChangedListener);
        if (newAvatar.getContext() != null) {
          camState.setTargetCharacter(newAvatar);
        }
 else {
          camState.setTargetCharacter(null);
        }
        ViewManager viewManager=ViewManager.getViewManager();
        ViewCell viewCell=viewManager.getPrimaryViewCell();
        CellTransform transform=viewCell.getWorldTransform();
        Vector3f translation=transform.getTranslation(null);
        Vector3f offset=new Vector3f(0.0f,4.0f,-10.0f);
        camState.setCameraPosition(translation.add(offset));
      }
      if (gestureHUDRef != null && gestureHUDRef.get() != null) {
        if (newAvatar instanceof WlAvatarCharacter) {
          gestureHUDRef.get().setAvatarCharacter((WlAvatarCharacter)newAvatar);
        }
 else {
          gestureHUDRef.get().setVisible(false);
        }
      }
    }
  }
;
  chaseCameraMI=new JRadioButtonMenuItem(bundle.getString("String_Node_Str"));
  chaseCameraMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      ViewManager viewManager=ViewManager.getViewManager();
      ViewCell viewCell=viewManager.getPrimaryViewCell();
      CellTransform transform=viewCell.getWorldTransform();
      Vector3f translation=transform.getTranslation(null);
      Vector3f offset=new Vector3f(0.0f,4.0f,-10.0f);
      if (camState == null) {
        camModel=(ChaseCamModel)CameraModels.getCameraModel(ChaseCamModel.class);
        camState=new ChaseCamState(offset,new Vector3f(0.0f,1.8f,0.0f));
        camState.setDamping(1.7f);
        camState.setLookAtDamping(1.7f);
      }
      camState.setCameraPosition(translation.add(offset));
      camState.setTargetCharacter(avatarCellRenderer.getAvatarCharacter());
      FlexibleCameraAdapter chaseCamera=new FlexibleCameraAdapter(camModel,camState);
      viewManager.setCameraController(chaseCamera);
    }
  }
);
  gestureMI=new JCheckBoxMenuItem(bundle.getString("String_Node_Str"));
  gestureMI.setSelected(false);
  gestureMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (gestureHUDRef == null || gestureHUDRef.get() == null) {
        GestureHUD hud=new GestureHUD();
        hud.setAvatarCharacter(avatarCellRenderer.getAvatarCharacter());
        gestureHUDRef=new WeakReference(hud);
      }
      gestureHUDEnabled=!gestureHUDEnabled;
      gestureMI.setSelected(gestureHUDEnabled);
      ((GestureHUD)gestureHUDRef.get()).setVisible(gestureHUDEnabled);
    }
  }
);
  avatarConfigMI=new JMenuItem(bundle.getString("String_Node_Str"));
  avatarConfigMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      AvatarConfigFrame f=new AvatarConfigFrame();
      f.setVisible(true);
    }
  }
);
  collisionResponseEnabledMI=new JCheckBoxMenuItem(bundle.getString("String_Node_Str"));
  collisionResponseEnabledMI.setSelected(true);
  collisionResponseEnabledMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean isCollisionResponse=collisionResponseEnabledMI.isSelected();
      boolean isGravity=gravityEnabledMI.isSelected();
      ClientContext.getInputManager().postEvent(new AvatarCollisionChangeRequestEvent(isCollisionResponse,isGravity));
    }
  }
);
  gravityEnabledMI=new JCheckBoxMenuItem(bundle.getString("String_Node_Str"));
  gravityEnabledMI.setSelected(true);
  gravityEnabledMI.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean isCollisionResponse=collisionResponseEnabledMI.isSelected();
      boolean isGravity=gravityEnabledMI.isSelected();
      ClientContext.getInputManager().postEvent(new AvatarCollisionChangeRequestEvent(isCollisionResponse,isGravity));
    }
  }
);
  ctxListener=new ContextMenuListener(){
    public void contextMenuDisplayed(    ContextMenuEvent event){
      if (!(event.getPrimaryCell() instanceof AvatarCell)) {
        return;
      }
      ContextMenuInvocationSettings settings=event.getSettings();
      settings.setDisplayStandard(false);
      settings.setDisplayCellStandard(false);
      AvatarCell cell=(AvatarCell)event.getPrimaryCell();
      settings.setMenuName(cell.getIdentity().getUsername());
      if (cell == ViewManager.getViewManager().getPrimaryViewCell()) {
        settings.addTempFactory(new ConfigureContextMenuFactory());
      }
    }
  }
;
  ClientContextJME.getAvatarRenderManager().registerRenderer(manager,AvatarImiJME.class,AvatarControls.class);
  try {
    String serverHostAndPort=manager.getServerNameAndPort();
    String baseURL="String_Node_Str";
    URL url=AssetUtils.getAssetURL(baseURL,serverHostAndPort);
    WorldManager worldManager=ClientContextJME.getWorldManager();
    worldManager.addUserData(Repository.class,new Repository(worldManager,new WonderlandAvatarCache(url.toExternalForm(),ClientContext.getUserDirectory("String_Node_Str"))));
  }
 catch (  MalformedURLException excp) {
    logger.log(Level.WARNING,"String_Node_Str",excp);
  }
catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
  AvatarSystem.initialize(ClientContextJME.getWorldManager());
  super.initialize(manager);
}