Program: 147084
Project: 147084
Buggy source:
public void addMotionObjectsToFrame(JSONArray transforms_json,JSONArray paths_json){
  if (mcf != null) {
    MuscleList mList=model.getMuscleList();
    MuscleIterator mIter=mList.begin();
    while (!mIter.equals(mList.end())) {
      Muscle msl=mIter.__deref__();
      Vec3 pathColor=modelVisJson.getCurrentPathColorMap().getColor(msl.getGeometryPath(),dContext.getCurrentStateRef());
      ArrayList<UUID> uuids=modelVisJson.findUUIDForObject(msl);
      if (uuids != null && uuids.size() == 1) {
        UUID pathUUID=uuids.get(0);
        JSONObject pathUpdate_json=new JSONObject();
        pathUpdate_json.put("String_Node_Str",pathUUID.toString());
        pathUpdate_json.put("String_Node_Str",JSONUtilities.mapColorToRGBA(pathColor));
        paths_json.add(pathUpdate_json);
      }
      mIter.next();
    }
  }
  if (!(simmMotionData instanceof AnnotatedMotion))   return;
  AnnotatedMotion mot=(AnnotatedMotion)simmMotionData;
  Vector<ExperimentalDataObject> objects=mot.getClassified();
  Vec3 unitScale=new Vec3(1.,1.,1.);
  for (  ExperimentalDataObject nextObject : objects) {
    JSONObject motionObjectTransform=new JSONObject();
    Transform xform=new Transform();
    if (nextObject instanceof ExperimentalMarker) {
      double[] point=((ExperimentalMarker)nextObject).getPoint();
      xform.setP(new Vec3(point[0],point[1],point[2]));
      motionObjectTransform.put("String_Node_Str",nextObject.getDataObjectUUID().toString());
      motionObjectTransform.put("String_Node_Str",JSONUtilities.createMatrixFromTransform(xform,unitScale,modelVisJson.getVisScaleFactor()));
      transforms_json.add(motionObjectTransform);
    }
 else     if (nextObject instanceof MotionObjectPointForce) {
      double[] point=((MotionObjectPointForce)nextObject).getPoint();
      Vec3 dir=((MotionObjectPointForce)nextObject).getDirection();
      double length=Math.sqrt(Math.pow(dir.get(0),2) + Math.pow(dir.get(1),2) + Math.pow(dir.get(2),2)) / 1000;
      UnitVec3 dirNorm=new UnitVec3(dir);
      xform.setP(new Vec3(point[0],point[1],point[2]));
      for (int i=0; i < 3; i++)       xform.R().set(i,1,dirNorm.get(i));
      motionObjectTransform.put("String_Node_Str",nextObject.getDataObjectUUID().toString());
      motionObjectTransform.put("String_Node_Str",JSONUtilities.createMatrixFromTransform(xform,new Vec3(1,length,1),modelVisJson.getVisScaleFactor()));
      transforms_json.add(motionObjectTransform);
    }
  }
}

Fixed version (ground truth):
public void addMotionObjectsToFrame(JSONArray transforms_json,JSONArray paths_json){
  if (mcf != null) {
    MuscleList mList=model.getMuscleList();
    MuscleIterator mIter=mList.begin();
    while (!mIter.equals(mList.end())) {
      Muscle msl=mIter.__deref__();
      double newColorInBlueToRed=mcf.getColor(msl);
      Vec3 pathColor=new Vec3(newColorInBlueToRed,0,1 - newColorInBlueToRed);
      ArrayList<UUID> uuids=modelVisJson.findUUIDForObject(msl);
      if (uuids != null && uuids.size() == 1) {
        UUID pathUUID=uuids.get(0);
        JSONObject pathUpdate_json=new JSONObject();
        pathUpdate_json.put("String_Node_Str",pathUUID.toString());
        pathUpdate_json.put("String_Node_Str",JSONUtilities.mapColorToRGBA(pathColor));
        paths_json.add(pathUpdate_json);
      }
      mIter.next();
    }
  }
  if (!(simmMotionData instanceof AnnotatedMotion))   return;
  AnnotatedMotion mot=(AnnotatedMotion)simmMotionData;
  Vector<ExperimentalDataObject> objects=mot.getClassified();
  Vec3 unitScale=new Vec3(1.,1.,1.);
  for (  ExperimentalDataObject nextObject : objects) {
    JSONObject motionObjectTransform=new JSONObject();
    Transform xform=new Transform();
    if (nextObject instanceof ExperimentalMarker) {
      double[] point=((ExperimentalMarker)nextObject).getPoint();
      xform.setP(new Vec3(point[0],point[1],point[2]));
      motionObjectTransform.put("String_Node_Str",nextObject.getDataObjectUUID().toString());
      motionObjectTransform.put("String_Node_Str",JSONUtilities.createMatrixFromTransform(xform,unitScale,modelVisJson.getVisScaleFactor()));
      transforms_json.add(motionObjectTransform);
    }
 else     if (nextObject instanceof MotionObjectPointForce) {
      double[] point=((MotionObjectPointForce)nextObject).getPoint();
      Vec3 dir=((MotionObjectPointForce)nextObject).getDirection();
      double length=Math.sqrt(Math.pow(dir.get(0),2) + Math.pow(dir.get(1),2) + Math.pow(dir.get(2),2)) / 1000;
      UnitVec3 dirNorm=new UnitVec3(dir);
      xform.setP(new Vec3(point[0],point[1],point[2]));
      for (int i=0; i < 3; i++)       xform.R().set(i,1,dirNorm.get(i));
      motionObjectTransform.put("String_Node_Str",nextObject.getDataObjectUUID().toString());
      motionObjectTransform.put("String_Node_Str",JSONUtilities.createMatrixFromTransform(xform,new Vec3(1,length,1),modelVisJson.getVisScaleFactor()));
      transforms_json.add(motionObjectTransform);
    }
  }
}