Program: 178247
Project: 178247
Buggy source:
/** 
 * Just about to start the next layer
 * @param lc
 */
public void startingLayer(LayerRules lc) throws Exception {
  lc.setFractionDone();
  if (lc.getMachineLayer() > 0 && Preferences.loadGlobalBool("String_Node_Str"))   homeToZeroXYE();
 else {
    int extruderNow=extruder;
    for (int i=0; i < extruders.length; i++) {
      if (extruders[i].getExtruderState().length() > 0) {
        selectExtruder(i);
        extruders[i].zeroExtrudedLength();
      }
    }
    selectExtruder(extruderNow);
  }
  double datumX=getExtruder().getNozzleWipeDatumX();
  double datumY=getExtruder().getNozzleWipeDatumY();
  double strokeY=getExtruder().getNozzleWipeStrokeY();
  double clearTime=getExtruder().getNozzleClearTime();
  double waitTime=getExtruder().getNozzleWaitTime();
  double coolTime=getExtruder().getCoolingPeriod();
  if (layerPauseCheckbox != null && layerPauseCheckbox.isSelected())   layerPause();
  if (isCancelled()) {
    getExtruder().setCooler(false);
    getExtruder().stopExtruding();
    return;
  }
  double cool=Timer.elapsed();
  if (startCooling >= 0)   cool=cool - startCooling;
 else   cool=0;
  if (startCooling >= 0) {
    cool=coolTime - cool;
    machineWait(1000 * cool,false);
  }
  if (coolTime > 0)   getExtruder().setCooler(false);
  if (getExtruder().getNozzleWipeEnabled()) {
    singleMove(datumX,datumY,currentZ,getExtruder().getOutlineFeedrate());
    if (clearTime > 0) {
      getExtruder().setValve(true);
      getExtruder().setMotor(true);
      machineWait(1000 * clearTime,false);
      getExtruder().setMotor(false);
      getExtruder().setValve(false);
      machineWait(1000 * waitTime,false);
    }
    singleMove(datumX,datumY + strokeY,currentZ,currentFeedrate);
  }
  lc.moveZAtStartOfLayer();
}

Fixed version (ground truth):
/** 
 * Just about to start the next layer
 * @param lc
 */
public void startingLayer(LayerRules lc) throws Exception {
  lc.setFractionDone();
  if (lc.getMachineLayer() > 0 && Preferences.loadGlobalBool("String_Node_Str"))   homeToZeroXYE();
 else {
    int extruderNow=extruder;
    for (int i=0; i < extruders.length; i++) {
      selectExtruder(i);
      extruders[i].zeroExtrudedLength();
    }
    selectExtruder(extruderNow);
  }
  double datumX=getExtruder().getNozzleWipeDatumX();
  double datumY=getExtruder().getNozzleWipeDatumY();
  double strokeY=getExtruder().getNozzleWipeStrokeY();
  double clearTime=getExtruder().getNozzleClearTime();
  double waitTime=getExtruder().getNozzleWaitTime();
  double coolTime=getExtruder().getCoolingPeriod();
  if (layerPauseCheckbox != null && layerPauseCheckbox.isSelected())   layerPause();
  if (isCancelled()) {
    getExtruder().setCooler(false);
    getExtruder().stopExtruding();
    return;
  }
  double cool=Timer.elapsed();
  if (startCooling >= 0)   cool=cool - startCooling;
 else   cool=0;
  if (startCooling >= 0) {
    cool=coolTime - cool;
    machineWait(1000 * cool,false);
  }
  if (coolTime > 0)   getExtruder().setCooler(false);
  if (getExtruder().getNozzleWipeEnabled()) {
    singleMove(datumX,datumY,currentZ,getExtruder().getOutlineFeedrate());
    if (clearTime > 0) {
      getExtruder().setValve(true);
      getExtruder().setMotor(true);
      machineWait(1000 * clearTime,false);
      getExtruder().setMotor(false);
      getExtruder().setValve(false);
      machineWait(1000 * waitTime,false);
    }
    singleMove(datumX,datumY + strokeY,currentZ,currentFeedrate);
  }
  lc.moveZAtStartOfLayer();
}