Program: 147191
Project: 147191
Buggy source:
public void fromModelScaler(){
  ModelScaler modelScaler=scaleToolModel.getScaleTool().getModelScaler();
  for (int i=0; i < size(); i++)   set(i,new BodyScaleFactors());
  boolean sawManualScale=false;
  for (int o=0; o < modelScaler.getScalingOrder().getSize(); o++) {
    if (modelScaler.getScalingOrder().getitem(o).equals("String_Node_Str")) {
      if (sawManualScale) {
      }
      for (int i=0; i < modelScaler.getScalingOrder().getSize(); i++) {
        if (modelScaler.getScalingOrder().getitem(i).equals("String_Node_Str")) {
          MeasurementSet measurementSet=modelScaler.getMeasurementSet();
          for (int j=0; j < measurementSet.getSize(); j++) {
            Measurement meas=modelScaler.getMeasurementSet().get(j);
            if (!meas.getApply())             continue;
            for (int k=0; k < meas.getBodyScaleSet().getSize(); k++) {
              BodyScale bodyScale=meas.getBodyScaleSet().get(k);
              Integer bodyIndex=mapBodyNameToIndex.get(bodyScale.getName());
              if (bodyIndex != null) {
                BodyScaleFactors scaleFactors=get(bodyIndex);
                scaleFactors.useManual=false;
                ArrayStr axisNames=bodyScale.getAxisNames();
                for (int l=0; l < axisNames.getSize(); l++) {
                  int index=axisToIndex(axisNames.getitem(l));
                  if (index >= 0)                   scaleFactors.measurements[index]=j;
                }
              }
 else {
                System.out.println("String_Node_Str" + bodyScale.getName() + "String_Node_Str"+ meas.getName()+ "String_Node_Str");
              }
            }
          }
        }
      }
    }
 else     if (modelScaler.getScalingOrder().getitem(o).equals("String_Node_Str")) {
      sawManualScale=true;
      for (int i=0; i < modelScaler.getScaleSet().getSize(); i++) {
        Scale scale=modelScaler.getScaleSet().get(i);
        Integer bodyIndex=mapBodyNameToIndex.get(scale.getSegmentName());
        if (bodyIndex != null) {
          BodyScaleFactors scaleFactors=get(bodyIndex);
          scaleFactors.useManual=scale.getApply();
          double[] scales=new double[3];
          scale.getScaleFactors(scales);
          for (int j=0; j < 3; j++)           scaleFactors.manualScales[j]=scales[j];
        }
 else {
          System.out.println("String_Node_Str" + scale.getSegmentName() + "String_Node_Str"+ scale.getName()+ "String_Node_Str");
        }
      }
    }
 else {
      System.out.println("String_Node_Str" + modelScaler.getScalingOrder().getitem(o) + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void fromModelScaler(){
  ModelScaler modelScaler=scaleToolModel.getScaleTool().getModelScaler();
  for (int i=0; i < size(); i++)   set(i,new BodyScaleFactors());
  for (int order=0; order < modelScaler.getScalingOrder().getSize(); order++) {
    if (modelScaler.getScalingOrder().getitem(order).equals("String_Node_Str")) {
      for (int i=0; i < modelScaler.getScalingOrder().getSize(); i++) {
        if (modelScaler.getScalingOrder().getitem(i).equals("String_Node_Str")) {
          MeasurementSet measurementSet=modelScaler.getMeasurementSet();
          for (int j=0; j < measurementSet.getSize(); j++) {
            Measurement meas=modelScaler.getMeasurementSet().get(j);
            if (!meas.getApply())             continue;
            for (int k=0; k < meas.getBodyScaleSet().getSize(); k++) {
              BodyScale bodyScale=meas.getBodyScaleSet().get(k);
              Integer bodyIndex=mapBodyNameToIndex.get(bodyScale.getName());
              if (bodyIndex != null) {
                BodyScaleFactors scaleFactors=get(bodyIndex);
                scaleFactors.useManual=false;
                ArrayStr axisNames=bodyScale.getAxisNames();
                for (int l=0; l < axisNames.getSize(); l++) {
                  int index=axisToIndex(axisNames.getitem(l));
                  if (index >= 0)                   scaleFactors.measurements[index]=j;
                }
              }
 else {
                System.out.println("String_Node_Str" + bodyScale.getName() + "String_Node_Str"+ meas.getName()+ "String_Node_Str");
              }
            }
          }
        }
      }
    }
 else     if (modelScaler.getScalingOrder().getitem(order).equals("String_Node_Str")) {
      for (int i=0; i < modelScaler.getScaleSet().getSize(); i++) {
        Scale scale=modelScaler.getScaleSet().get(i);
        Integer bodyIndex=mapBodyNameToIndex.get(scale.getSegmentName());
        if (bodyIndex != null) {
          BodyScaleFactors scaleFactors=get(bodyIndex);
          scaleFactors.useManual=scale.getApply();
          double[] scales=new double[3];
          scale.getScaleFactors(scales);
          for (int j=0; j < 3; j++)           scaleFactors.manualScales[j]=scales[j];
        }
 else {
          System.out.println("String_Node_Str" + scale.getSegmentName() + "String_Node_Str"+ scale.getName()+ "String_Node_Str");
        }
      }
    }
 else {
      System.out.println("String_Node_Str" + modelScaler.getScalingOrder().getitem(order) + "String_Node_Str");
    }
  }
}