Program: 147115
Project: 147115
Buggy source:
public void setupMotionDisplay(){
  if (simmMotionData == null)   return;
  colNames=simmMotionData.getColumnLabels();
  int numColumnsIncludingTime=colNames.getSize();
  interpolatedStates=new ArrayDouble(0.0,numColumnsIncludingTime - 1);
  AddMotionObjectsRep(model);
  if (simmMotionData instanceof AnnotatedMotion) {
    AnnotatedMotion mot=(AnnotatedMotion)simmMotionData;
    Vector<ExperimentalDataObject> objects=mot.getClassified();
    mot.setMotionDisplayer(this);
    createMotionObjectsGroupJson();
    addExperimentalDataObjectsToJson(objects);
    for (    ExperimentalDataObject nextObject : objects) {
      if (nextObject.getObjectType() == ExperimentalDataItemType.MarkerData) {
        bindMarkerToVisualizerObjectKeepHandle(nextObject);
      }
 else       if (nextObject.getObjectType() == ExperimentalDataItemType.PointForceData) {
        bindForceVisualizerObjectKeepHandle(nextObject);
      }
    }
    ViewDB.getInstance().addVisualizerObject(createJsonForMotionObjects());
    return;
  }
  mapIndicesToBodies.clear();
  mapIndicesToDofs.clear();
  stateNames=model.getStateVariableNames();
  stateNames.insert(0,"String_Node_Str");
  if (colNames.arrayEquals(stateNames)) {
    statesFile=true;
    setRenderMuscleActivations(true);
  }
 else {
    for (int i=0; i < numColumnsIncludingTime; i++) {
      String columnName=colNames.getitem(i);
      int numClassified=classifyColumn(model,i,columnName);
      ObjectTypesInMotionFiles cType=mapIndicesToObjectTypes.get(i);
      if (numClassified > 1)       i+=(numClassified - 1);
    }
    genCoordColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    genCoordForceColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    segmentMarkerColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    segmentForceColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    anyStateColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    for (int i=1; i < numColumnsIncludingTime; i++) {
      ObjectTypesInMotionFiles cType=mapIndicesToObjectTypes.get(i);
      Object o=mapIndicesToObjects.get(i);
      if (cType == null)       continue;
      ObjectIndexPair newPair=new ObjectIndexPair(o,i - 1);
switch (cType) {
case GenCoord:
        genCoordColumns.add(newPair);
      break;
case GenCoord_Force:
    genCoordForceColumns.add(newPair);
  break;
case State:
anyStateColumns.add(newPair);
break;
case Segment_marker_p1:
segmentMarkerColumns.add(newPair);
break;
case Segment_force_p1:
segmentForceColumns.add(newPair);
break;
}
}
}
}

Fixed version (ground truth):
public void setupMotionDisplay(){
  if (simmMotionData == null)   return;
  colNames=simmMotionData.getColumnLabels();
  int numColumnsIncludingTime=colNames.getSize();
  interpolatedStates=new ArrayDouble(0.0,numColumnsIncludingTime - 1);
  if (simmMotionData instanceof AnnotatedMotion) {
    AnnotatedMotion mot=(AnnotatedMotion)simmMotionData;
    Vector<ExperimentalDataObject> objects=mot.getClassified();
    mot.setMotionDisplayer(this);
    createMotionObjectsGroupJson();
    addExperimentalDataObjectsToJson(objects);
    for (    ExperimentalDataObject nextObject : objects) {
      if (nextObject.getObjectType() == ExperimentalDataItemType.MarkerData) {
        bindMarkerToVisualizerObjectKeepHandle(nextObject);
      }
 else       if (nextObject.getObjectType() == ExperimentalDataItemType.PointForceData) {
        bindForceVisualizerObjectKeepHandle(nextObject);
      }
    }
    ViewDB.getInstance().addVisualizerObject(createJsonForMotionObjects());
    return;
  }
  mapIndicesToBodies.clear();
  mapIndicesToDofs.clear();
  stateNames=model.getStateVariableNames();
  stateNames.insert(0,"String_Node_Str");
  if (colNames.arrayEquals(stateNames)) {
    statesFile=true;
    setRenderMuscleActivations(true);
  }
 else {
    for (int i=0; i < numColumnsIncludingTime; i++) {
      String columnName=colNames.getitem(i);
      int numClassified=classifyColumn(model,i,columnName);
      ObjectTypesInMotionFiles cType=mapIndicesToObjectTypes.get(i);
      if (numClassified > 1)       i+=(numClassified - 1);
    }
    genCoordColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    genCoordForceColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    segmentMarkerColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    segmentForceColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    anyStateColumns=new ArrayList<ObjectIndexPair>(numColumnsIncludingTime);
    for (int i=1; i < numColumnsIncludingTime; i++) {
      ObjectTypesInMotionFiles cType=mapIndicesToObjectTypes.get(i);
      Object o=mapIndicesToObjects.get(i);
      if (cType == null)       continue;
      ObjectIndexPair newPair=new ObjectIndexPair(o,i - 1);
switch (cType) {
case GenCoord:
        genCoordColumns.add(newPair);
      break;
case GenCoord_Force:
    genCoordForceColumns.add(newPair);
  break;
case State:
anyStateColumns.add(newPair);
break;
case Segment_marker_p1:
segmentMarkerColumns.add(newPair);
break;
case Segment_force_p1:
segmentForceColumns.add(newPair);
break;
}
}
}
}