From: <dcr...@hy...> - 2010-01-13 18:15:40
|
Author: dcrutchf Date: 2010-01-13 10:15:23 -0800 (Wed, 13 Jan 2010) New Revision: 14172 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14172 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java Log: Added null check Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2010-01-13 09:23:54 UTC (rev 14171) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2010-01-13 18:15:23 UTC (rev 14172) @@ -615,19 +615,23 @@ if (debug) watch.markTimeBegin("findResource size=" + size); final Resource res = rMan.findResource(id); if (debug) watch.markTimeEnd("findResource size=" + size); - List list = (List) measCache.get(res.getId()); - if (null != measCache && null != list) { - if (list.size() > 1) { - log.warn("resourceId " + res.getId() + - " has more than one availability measurement " + - " assigned to it"); - } else if (list.size() <= 0) { - continue; + + if (null != measCache) { + List list = (List) measCache.get(res.getId()); + + if (null != list) { + if (list.size() > 1) { + log.warn("resourceId " + res.getId() + + " has more than one availability measurement " + + " assigned to it"); + } else if (list.size() <= 0) { + continue; + } + final Measurement m = (Measurement)list.get(0); + rtn.put(res.getId(), m); + } else { + toGet.add(res); } - final Measurement m = (Measurement)list.get(0); - rtn.put(res.getId(), m); - } else { - toGet.add(res); } } if (debug) watch.markTimeBegin("getAvailMeasurements"); |