Program: 50623
Project: 50623
Buggy source:
/** 
 * Get the total number min and hours of a shift. Note the max date time is 24 hours. If the the diff is 0 is seen as a 24h shift
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 15 May 2013
 * @param startDate - The shift start date
 * @param endDate - The shift end date
 * @return the shift is format "(H.M)"
 */
public String getShiftTimeDiff(SSDate startDate,SSDate endDate){
  if (minutesStep == 15) {
    boolean reversed=false;
    if (endDate.getTime() < startDate.getTime() - 1000) {
      reversed=true;
    }
    int shiftTotalHours=(int)(((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60)));
    int shiftTotalMin=(int)(((endDate.getTime() - startDate.getTime()) / (1000 * 60)) % 60);
    if (shiftTotalMin == 59) {
      shiftTotalMin=0;
      shiftTotalHours++;
    }
 else     if (shiftTotalMin % 15 == 14) {
      shiftTotalMin++;
    }
    int totalMinAndHours=(shiftTotalHours * 60) + shiftTotalMin;
    if (totalMinAndHours >= 1441 || totalMinAndHours <= 1439) {
      if (endDate.getTime() - startDate.getTime() > 86399000) {
        shiftTotalHours=24;
        totalMinAndHours=1440;
        shiftTotalMin=0;
      }
    }
    if (((15 - (shiftTotalMin % 15) < 1)) || (totalMinAndHours > 1440) || reversed) {
      return "String_Node_Str";
    }
    if (shiftTotalMin == 0) {
      return "String_Node_Str" + shiftTotalHours + "String_Node_Str";
    }
    String displayedMinutes=String.valueOf((int)((Math.ceil(shiftTotalMin) / 60) * 100)).replaceAll("String_Node_Str","String_Node_Str");
    return "String_Node_Str" + shiftTotalHours + "String_Node_Str"+ displayedMinutes+ "String_Node_Str";
  }
 else {
    float shiftTotalMinutes=(endDate.getTime() - startDate.getTime()) / 1000 / 60;
    int hours=(int)(shiftTotalMinutes / 60);
    int min=(int)(shiftTotalMinutes - (hours * 60));
    String totalTimeString=TOTAL_TIME_FORMAT_START + hours + TOTAL_TIME_FORMAT_HOURS;
    if (min < 10) {
      totalTimeString+="String_Node_Str" + 0;
    }
 else {
      totalTimeString+="String_Node_Str";
    }
    totalTimeString+=min + TOTAL_TIME_FORMAT_MINUTES + TOTAL_TIME_FORMAT_END;
    return totalTimeString;
  }
}

Fixed version (ground truth):
/** 
 * Get the total number min and hours of a shift. Note the max date time is 24 hours. If the the diff is 0 is seen as a 24h shift
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 15 May 2013
 * @param startDate - The shift start date
 * @param endDate - The shift end date
 * @return the shift is format "(H.M)"
 */
public String getShiftTimeDiff(SSDate startDate,SSDate endDate){
  if (minutesStep == 15) {
    boolean reversed=false;
    if (endDate.getTime() < startDate.getTime() - 1000) {
      reversed=true;
    }
    int shiftTotalHours=(int)(((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60)));
    int shiftTotalMin=(int)(((endDate.getTime() - startDate.getTime()) / (1000 * 60)) % 60);
    if (shiftTotalMin == 59) {
      shiftTotalMin=0;
      shiftTotalHours++;
    }
 else     if (shiftTotalMin % 15 == 14) {
      shiftTotalMin++;
    }
    int totalMinAndHours=(shiftTotalHours * 60) + shiftTotalMin;
    if (totalMinAndHours >= 1441 || totalMinAndHours <= 1439) {
      if (endDate.getTime() - startDate.getTime() > 86399000) {
        shiftTotalHours=24;
        totalMinAndHours=1440;
        shiftTotalMin=0;
      }
    }
    if (((15 - (shiftTotalMin % 15) < 1)) || (totalMinAndHours > 1440) || reversed) {
      return "String_Node_Str";
    }
    if (shiftTotalMin == 0) {
      return "String_Node_Str" + shiftTotalHours + "String_Node_Str";
    }
    String displayedMinutes=String.valueOf((int)((Math.ceil(shiftTotalMin) / 60) * 100)).replaceAll("String_Node_Str","String_Node_Str");
    return "String_Node_Str" + shiftTotalHours + "String_Node_Str"+ displayedMinutes+ "String_Node_Str";
  }
 else {
    startDate=startDatePicker.getValue();
    startDate.setDirectTime(startTimePicker.getDateTime().getHours(),startTimePicker.getDateTime().getMinutes(),startTimePicker.getDateTime().getSeconds());
    endDate=endDatePicker.getValue();
    endDate.setDirectTime(endTimePicker.getDateTime().getHours(),endTimePicker.getDateTime().getMinutes(),endTimePicker.getDateTime().getSeconds());
    float shiftTotalMinutes=(endDate.getTime() - startDate.getTime()) / 1000 / 60;
    int hours=(int)(shiftTotalMinutes / 60);
    int min=(int)(shiftTotalMinutes - (hours * 60));
    String totalTimeString=TOTAL_TIME_FORMAT_START + hours + TOTAL_TIME_FORMAT_HOURS;
    if (min < 10) {
      totalTimeString+="String_Node_Str" + 0;
    }
 else {
      totalTimeString+="String_Node_Str";
    }
    totalTimeString+=min + TOTAL_TIME_FORMAT_MINUTES + TOTAL_TIME_FORMAT_END;
    return totalTimeString;
  }
}