Program: 46209
Project: 46209
Buggy source:
/** 
 * Creates a cell in the world given the CellServerState of the cell and the linear distance away from the avatar to initially place the cell. Throws CellCreationException upon failure. If the given CellServerState is null, this method simply does not create a Cell.
 * @param state The cell server state for the new cell
 * @param distance The linear distance away from the avatar
 * @throw CellCreationException Upon error creating the cell
 */
public static void createCell(CellServerState state,float distance) throws CellCreationException {
  if (state == null) {
    logger.fine("String_Node_Str");
    return;
  }
  ViewManager manager=ViewManager.getViewManager();
  ViewCell viewCell=manager.getPrimaryViewCell();
  Vector3f cameraPosition=viewCell.getWorldTransform().getTranslation(null);
  Vector3f cameraLookDirection=manager.getCameraLookDirection(null);
  Map<String,String> metadata=state.getMetaData();
  String sizingHint=metadata.get("String_Node_Str");
  if (sizingHint != null) {
    float sizing=Float.parseFloat(sizingHint);
    distance=1.0f + sizing;
  }
  float lengthSquared=cameraLookDirection.lengthSquared();
  float factor=(distance * distance) / lengthSquared;
  Vector3f origin=cameraPosition.add(cameraLookDirection.mult(factor));
  System.out.println("String_Node_Str" + cameraPosition);
  System.out.println("String_Node_Str" + cameraLookDirection);
  System.out.println("String_Node_Str" + lengthSquared);
  System.out.println("String_Node_Str" + (distance * distance));
  System.out.println("String_Node_Str" + sizingHint);
  System.out.println("String_Node_Str" + factor);
  System.out.println("String_Node_Str" + origin);
  PositionComponentServerState position=new PositionComponentServerState();
  position.setOrigin(new Origin(origin));
  Quaternion quaternion=new Quaternion();
  quaternion.lookAt(cameraLookDirection.negate(),new Vector3f(0,1,0));
  Vector3f axis=new Vector3f();
  float angle=quaternion.toAngleAxis(axis);
  position.setRotation(new Rotation(axis,angle));
  state.addComponentServerState(position);
  WonderlandSession session=LoginManager.getPrimary().getPrimarySession();
  CellEditChannelConnection connection=(CellEditChannelConnection)session.getConnection(CellEditConnectionType.CLIENT_TYPE);
  CellCreateMessage msg=new CellCreateMessage(null,state);
  connection.send(msg);
}

Fixed version (ground truth):
/** 
 * Creates a cell in the world given the CellServerState of the cell and the linear distance away from the avatar to initially place the cell. Throws CellCreationException upon failure. If the given CellServerState is null, this method simply does not create a Cell.
 * @param state The cell server state for the new cell
 * @param distance The linear distance away from the avatar
 * @throw CellCreationException Upon error creating the cell
 */
public static void createCell(CellServerState state,float distance) throws CellCreationException {
  if (state == null) {
    logger.fine("String_Node_Str");
    return;
  }
  ViewManager manager=ViewManager.getViewManager();
  ViewCell viewCell=manager.getPrimaryViewCell();
  Vector3f cameraPosition=viewCell.getWorldTransform().getTranslation(null);
  Vector3f cameraLookDirection=manager.getCameraLookDirection(null);
  Map<String,String> metadata=state.getMetaData();
  String sizingHint=metadata.get("String_Node_Str");
  if (sizingHint != null) {
    float sizing=Float.parseFloat(sizingHint);
    distance=1.0f + sizing;
  }
  float lengthSquared=cameraLookDirection.lengthSquared();
  float factor=(distance * distance) / lengthSquared;
  Vector3f origin=cameraPosition.add(cameraLookDirection.mult(factor));
  PositionComponentServerState position=new PositionComponentServerState();
  position.setOrigin(new Origin(origin));
  Quaternion quaternion=new Quaternion();
  quaternion.lookAt(cameraLookDirection.negate(),new Vector3f(0,1,0));
  Vector3f axis=new Vector3f();
  float angle=quaternion.toAngleAxis(axis);
  position.setRotation(new Rotation(axis,angle));
  state.addComponentServerState(position);
  WonderlandSession session=LoginManager.getPrimary().getPrimarySession();
  CellEditChannelConnection connection=(CellEditChannelConnection)session.getConnection(CellEditConnectionType.CLIENT_TYPE);
  CellCreateMessage msg=new CellCreateMessage(null,state);
  connection.send(msg);
}