Program: 178222
Project: 178222
Buggy source:
public int refreshPreferences(){
  prefName="String_Node_Str" + myExtruderID + "String_Node_Str";
  int result=-1;
  try {
    result=Preferences.loadGlobalInt(prefName + "String_Node_Str");
    maxExtruderSpeed=255;
    purgeTime=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionPWM=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionTemp=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionSize=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionHeight=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    if (Preferences.loadGlobalDouble(prefName + "String_Node_Str") == -1)     extrusionInfillWidth=extrusionSize / Preferences.loadGlobalDouble(prefName + "String_Node_Str");
 else     extrusionInfillWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    lowerFineLayers=2;
    upperFineLayers=2;
    extrusionBroadWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    coolingPeriod=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    fastXYFeedrate=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    fastEFeedrate=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    slowXYFeedrate=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    maxAcceleration=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    middleStart=Preferences.loadGlobalBool(prefName + "String_Node_Str");
    t0=0;
    iSpeed=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    oSpeed=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    asLength=-1;
    asFactor=0.5;
    material=Preferences.loadGlobalString(prefName + "String_Node_Str");
    supportMaterial=Preferences.loadGlobalString(prefName + "String_Node_Str");
    inFillMaterial=Preferences.loadGlobalString(prefName + "String_Node_Str");
    offsetX=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    offsetY=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    offsetZ=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    nozzleWipeEnabled=false;
    nozzleWipeDatumX=22.4;
    nozzleWipeDatumY=4;
    nozzleWipeStrokeX=0;
    nozzleWipeStrokeY=10;
    nozzleWipeFreq=1;
    nozzleClearTime=10;
    nozzleWaitTime=0;
    randSt=false;
    incrementedSt=false;
    shortLength=-1;
    shortSpeed=1;
    infillOverlap=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionDelayForLayer=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionDelayForPolygon=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionOverRun=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    valveDelayForLayer=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    valveDelayForPolygon=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionReverseDelay=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    valveOverRun=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    minLiftedZ=-1;
    valvePulseTime=0.5 * Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    shells=Preferences.loadGlobalInt(prefName + "String_Node_Str");
    pauseBetweenSegments=false;
    extrusionFoundationWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionLastFoundationWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    separationFraction=0.8;
    arcCompensationFactor=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    arcShortSides=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrudeRatio=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    lift=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    evenHatchDirection=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    oddHatchDirection=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    Color3f col=new Color3f((float)Preferences.loadGlobalDouble(prefName + "String_Node_Str"),(float)Preferences.loadGlobalDouble(prefName + "String_Node_Str"),(float)Preferences.loadGlobalDouble(prefName + "String_Node_Str"));
    materialColour=new Appearance();
    materialColour.setMaterial(new Material(col,black,col,black,101f));
  }
 catch (  Exception ex) {
    Debug.e("String_Node_Str" + ex.toString());
  }
  if (printer == null) {
    Debug.e("String_Node_Str");
  }
 else {
    fastXYFeedrate=Math.min(printer.getFastXYFeedrate(),fastXYFeedrate);
    slowXYFeedrate=Math.min(printer.getSlowXYFeedrate(),slowXYFeedrate);
    maxAcceleration=Math.min(printer.getMaxXYAcceleration(),maxAcceleration);
  }
  return result;
}

Fixed version (ground truth):
public int refreshPreferences(){
  prefName="String_Node_Str" + myExtruderID + "String_Node_Str";
  int result=-1;
  try {
    result=Preferences.loadGlobalInt(prefName + "String_Node_Str");
    maxExtruderSpeed=255;
    purgeTime=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionPWM=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionTemp=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionSize=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionHeight=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionInfillWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    lowerFineLayers=2;
    upperFineLayers=2;
    extrusionBroadWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    coolingPeriod=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    fastXYFeedrate=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    fastEFeedrate=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    slowXYFeedrate=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    maxAcceleration=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    middleStart=Preferences.loadGlobalBool(prefName + "String_Node_Str");
    t0=0;
    iSpeed=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    oSpeed=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    asLength=-1;
    asFactor=0.5;
    material=Preferences.loadGlobalString(prefName + "String_Node_Str");
    supportMaterial=Preferences.loadGlobalString(prefName + "String_Node_Str");
    inFillMaterial=Preferences.loadGlobalString(prefName + "String_Node_Str");
    offsetX=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    offsetY=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    offsetZ=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    nozzleWipeEnabled=false;
    nozzleWipeDatumX=22.4;
    nozzleWipeDatumY=4;
    nozzleWipeStrokeX=0;
    nozzleWipeStrokeY=10;
    nozzleWipeFreq=1;
    nozzleClearTime=10;
    nozzleWaitTime=0;
    randSt=false;
    incrementedSt=false;
    shortLength=-1;
    shortSpeed=1;
    infillOverlap=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionDelayForLayer=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionDelayForPolygon=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionOverRun=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    valveDelayForLayer=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    valveDelayForPolygon=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionReverseDelay=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    valveOverRun=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    minLiftedZ=-1;
    valvePulseTime=0.5 * Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    shells=Preferences.loadGlobalInt(prefName + "String_Node_Str");
    pauseBetweenSegments=false;
    extrusionFoundationWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrusionLastFoundationWidth=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    separationFraction=0.8;
    arcCompensationFactor=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    arcShortSides=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    extrudeRatio=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    lift=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    evenHatchDirection=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    oddHatchDirection=Preferences.loadGlobalDouble(prefName + "String_Node_Str");
    Color3f col=new Color3f((float)Preferences.loadGlobalDouble(prefName + "String_Node_Str"),(float)Preferences.loadGlobalDouble(prefName + "String_Node_Str"),(float)Preferences.loadGlobalDouble(prefName + "String_Node_Str"));
    materialColour=new Appearance();
    materialColour.setMaterial(new Material(col,black,col,black,101f));
  }
 catch (  Exception ex) {
    Debug.e("String_Node_Str" + ex.toString());
  }
  if (printer == null) {
    Debug.e("String_Node_Str");
  }
 else {
    fastXYFeedrate=Math.min(printer.getFastXYFeedrate(),fastXYFeedrate);
    slowXYFeedrate=Math.min(printer.getSlowXYFeedrate(),slowXYFeedrate);
    maxAcceleration=Math.min(printer.getMaxXYAcceleration(),maxAcceleration);
  }
  return result;
}