Details
-
Bug
-
Resolution: Fixed
-
High
-
3.7 Beta 2
-
None
-
3.07
-
Description
Entering a negative number in the days previously field causes an OutOfMemory exception. This is caused by the following block of code in com.atlassian.jira.ext.charting.data.DataUtils.java:
public static void normaliseDateRange(Map dateMap, int days, Class period) { // find earliest date, then move it forwards until we hit now RegularTimePeriod cursor = RegularTimePeriod.createInstance(period, new Date(System.currentTimeMillis() - days * DateUtils.DAY_MILLIS), RegularTimePeriod.DEFAULT_TIME_ZONE); RegularTimePeriod now = RegularTimePeriod.createInstance(period, new Date(), RegularTimePeriod.DEFAULT_TIME_ZONE); while (!cursor.equals(now)) { if (!dateMap.containsKey(cursor)) dateMap.put(cursor, new Integer(0)); cursor = cursor.next(); } }
If days is a negative number, the while loop will never exit, and create a dateMap that will eventually use up all memory.
The fix for this is to enter input checks for the charts listed below to check against negative values.
Charts affected by this:
- Recently Created Issues
- Created vs Resolved Issues
- Resolution time
- Time to first Response
- Average Age
- Average Number of Times in Status
- Time Since Issues