From: <sc...@hy...> - 2008-07-18 20:02:04
|
Author: scottmf Date: 2008-07-18 13:01:55 -0700 (Fri, 18 Jul 2008) New Revision: 10276 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=10276 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/DashboardPortletBossEJBImpl.java Log: added extra checking to ensure that JSONArray does not throw an Exception due to a NaN or Infinity number in getMeasurementData() Modified: trunk/src/org/hyperic/hq/bizapp/server/session/DashboardPortletBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/DashboardPortletBossEJBImpl.java 2008-07-18 19:19:45 UTC (rev 10275) +++ trunk/src/org/hyperic/hq/bizapp/server/session/DashboardPortletBossEJBImpl.java 2008-07-18 20:01:55 UTC (rev 10276) @@ -147,7 +147,13 @@ for (Iterator it=data.iterator(); it.hasNext(); ) { JSONArray array = new JSONArray(); HighLowMetricValue pt = (HighLowMetricValue)it.next(); - array.put(pt.getValue()); + double val = pt.getValue(); + if (val == Double.NaN + || val == Double.POSITIVE_INFINITY + || val == Double.NEGATIVE_INFINITY) { + continue; + } + array.put(val); Date date = new Date(pt.getTimestamp()); dataObj.put(dateFmt.format(date), array); } |