Buggy code:
protected static final Color EXPECTED_SERIES_COLOR = new Color ( 80 , 80 , 80 ) ; protected static final Shape EFFORT_LEFT_SERIES_SHAPE = new Rectangle ( ( - 2 ) , ( - 2 ) , 4 , 4 ) ; protected static final boolean EFFORT_LEFT_SERIES_SHAPE_VISIBLE = true ; protected static final Shape EFFORT_SPENT_SERIES_SHAPE = new Rectangle ( ( - 2 ) , ( - 2 ) , 4 , 4 ) ; protected static final boolean EFFORT_SPENT_SERIES_SHAPE_VISIBLE = true ; protected static final Shape CURRENT_DAY_EFFORT_LEFT_SERIES_SHAPE = new Rectangle ( ( - 2 ) , ( - 2 ) , 4 , 4 ) ; protected static final boolean CURRENT_DAY_EFFORT_LEFT_SERIES_SHAPE_VISIBLE = true ; protected static final boolean CURRENT_DAY_EFFORT_LEFT_SERIES_SHAPE_FILLED = false ; protected static final Shape CURRENT_DAY_EFFORT_SPENT_SERIES_SHAPE = new Rectangle ( ( - 2 ) , ( - 2 ) , 4 , 4 ) ; protected static final boolean CURRENT_DAY_EFFORT_SPENT_SERIES_SHAPE_VISIBLE = true ; protected static final boolean CURRENT_DAY_EFFORT_SPENT_SERIES_SHAPE_FILLED = false ; protected static final Stroke SMALL_BURNDOWN_STROKE = new BasicStroke ( 1.0F ) ; protected static final Stroke CURRENT_DAY_SERIES_STROKE = new BasicStroke ( 1.0F , BasicStroke . CAP_BUTT , BasicStroke . JOIN_BEVEL , 0.0F , new float [ ] { 7.0F , 3.0F } , 0.0F ) ; protected static final Stroke SCOPING_SERIES_STROKE = new BasicStroke ( 1.0F , BasicStroke . CAP_BUTT , BasicStroke . JOIN_BEVEL , 0.0F , new float [ ] { 2.0F , 4.0F } , 0.0F ) ; protected static final Stroke EXPECTED_SERIES_STROKE = new BasicStroke ( 1.0F , BasicStroke . CAP_BUTT , BasicStroke . JOIN_BEVEL , 0.0F , new float [ ] { 2.0F , 4.0F } , 0.0F ) ; protected static final String EFFORT_LEFT_SERIES_NAME = "Effort<seq2seq4repair_space>left" ; protected static final String EFFORT_SPENT_SERIES_NAME = "Effort<seq2seq4repair_space>spent" ; protected static final String REFERENCE_SERIES_NAME = "Reference<seq2seq4repair_space>velocity" ; protected static final String SCOPING_SERIES_NAME = "Scoping" ; protected static final String CURRENT_DAY_EFFORT_LEFT_SERIES_NAME = "Current<seq2seq4repair_space>day" ; protected static final String CURRENT_DAY_EFFORT_SPENT_SERIES_NAME = "Current<seq2seq4repair_space>day" ; protected static final String EXPECTED_SERIES_NAME = "Predicted<seq2seq4repair_space>velocity" ; protected static final TickUnits tickUnits = IterationBurndownBusinessImpl . getTickUnits ( ) ; private int timeDifferenceMinutes = 0 ; private static TickUnits getTickUnits ( ) { } @ Autowired public void setIterationHistoryEntryBusiness ( IterationHistoryEntryBusiness iterationHistoryEntryBusiness ) { } @ Autowired public void setHourEntryBusiness ( HourEntryBusiness hourEntryBusiness ) { } public void setIterationBusiness ( IterationBusiness iterationBusiness ) { } protected byte [ ] getChartImageByteArray ( JFreeChart chart ) { } protected byte [ ] getChartImageByteArray ( JFreeChart chart , int width , int height ) { } public byte [ ] getIterationBurndown ( Iteration iteration , Integer timeZoneOffset ) { } public byte [ ] getSmallIterationBurndown ( Iteration iteration , Integer timeZoneOffset ) { } public byte [ ] getCustomIterationBurndown ( Iteration iteration , Integer width , Integer height , Integer timeZoneOffset ) { } protected JFreeChart constructChart ( Iteration iteration , boolean drawLegend , Integer timeZoneOffset ) { } protected JFreeChart constructChart ( Iteration iteration , Integer timeZoneOffset ) { } protected JFreeChart constructSmallChart ( Iteration iteration , Integer timeZoneOffset ) { } protected JFreeChart transformToSmallChart ( JFreeChart burndownChart ) { } protected void formatChartStyle ( JFreeChart chart ) { } protected void setSeriesStyles ( JFreeChart chart ) { } protected void formatChartAxes ( JFreeChart chart , DateTime start , DateTime end ) { } protected TimeSeriesCollection getDataset ( Iteration iteration ) { } protected LocalDate determineEndDate ( LocalDate iterationEndDate ) { } protected IterationHistoryEntry getHistoryEntryForDate ( List < IterationHistoryEntry > entries , LocalDate date ) { } protected List < IterationHistoryEntry > getIterationHistoryEntries ( Iteration iteration ) { } protected ExactEstimate getTodaysStartValueWithScoping ( IterationHistoryEntry yesterdayEntry , IterationHistoryEntry todayEntry ) { } protected TimeSeries getReferenceVelocityTimeSeries ( DateTime startDate , DateTime endDate , ExactEstimate originalEstimateSum ) { } protected TimeSeries getReferenceVelocityWithWeekends ( String seriesKey , DateTime startDate , DateTime endDate , ExactEstimate oeSum ) { } protected TimeSeries getPredictedVelocityTimeSeries ( LocalDate iterationStart , LocalDate iterationEnd , IterationHistoryEntry yesterdayEntry , IterationHistoryEntry todayEntry ) { } protected TimeSeries getCurrentDayEffortLeftSeries ( IterationHistoryEntry yesterdayEntry , IterationHistoryEntry todayEntry ) { } @ SuppressWarnings ( "deprecation" ) protected TimeSeries getCurrentDaySpentEffortSeries ( List < ? extends HourEntry > hourEntries , DateTime startDate , DateTime endDate ) { } protected TimeSeries getEffortSpentTimeSeries ( List < ? extends HourEntry > hourEntries , DateTime startDate , DateTime endDate ) { TimeSeries effortSpentSeries = new TimeSeries ( IterationBurndownBusinessImpl . EFFORT_SPENT_SERIES_NAME ) ; List < DailySpentEffort > spentEffortList = new ArrayList < DailySpentEffort > ( ) ; MutableDateTime today = new MutableDateTime ( ) ; <START_BUG> if ( ! ( today . isBefore ( endDate ) ) ) { <END_BUG> spentEffortList = hourEntryBusiness . getDailySpentEffortForHourEntries ( hourEntries , startDate . minusDays ( 1 ) , today . toDateTime ( ) ) ; } else { spentEffortList = hourEntryBusiness . getDailySpentEffortForHourEntries ( hourEntries , startDate . minusDays ( 1 ) , endDate . plusDays ( 1 ) ) ; } double cumulativeSum = 0.0 ; for ( DailySpentEffort spentEffort : spentEffortList ) { TimeSeriesDataItem dateItem = getEffortSpentDataItemForDay ( spentEffort ) ; cumulativeSum += dateItem . getValue ( ) . doubleValue ( ) ; dateItem . setValue ( cumulativeSum ) ; effortSpentSeries . add ( dateItem ) ; } return effortSpentSeries ; } protected TimeSeriesDataItem getEffortSpentDataItemForDay ( DailySpentEffort entry ) { } protected TimeSeries getBurndownTimeSeries ( List < IterationHistoryEntry > iterationHistoryEntries , LocalDate startDate , LocalDate endDate ) { } protected TimeSeriesDataItem getBurndownDataItemForDay ( IterationHistoryEntry entry ) { } protected Pair < TimeSeriesDataItem , TimeSeriesDataItem > getBurndownScopedDataItemForDay ( IterationHistoryEntry yesterdayEntry , IterationHistoryEntry todayEntry ) { } protected List < TimeSeriesDataItem > getScopeSeriesDataItems ( IterationHistoryEntry yesterdayEntry , IterationHistoryEntry todayEntry ) { } protected boolean isScopingDone ( IterationHistoryEntry entry ) { } protected TimeSeries getScopingTimeSeries ( List < IterationHistoryEntry > iterationHistoryEntries , LocalDate startDate , LocalDate endDate ) { } protected TimeSeries getSeriesByStartAndEndPoints ( String seriesKey , DateTime startInstant , ExactEstimate startValue , DateTime endInstant , ExactEstimate endValue ) { } protected void addTimeSeriesItem ( DateTime instant , ExactEstimate value , TimeSeries timeSeries ) { } public void setSettingBusiness ( SettingBusiness settingBusiness ) { } }

Fix:
if ( today . isBefore ( endDate ) ) {