From fc1b59e0d44eb5f451208e5446f5c316ceabdef8 Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 8 Aug 2008 00:41:02 +0000 Subject: Add check to avoid ArrayOutofBound git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@683776 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/sca') diff --git a/java/sca/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java b/java/sca/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java index d4dc3d2be4..8a9701b8fc 100644 --- a/java/sca/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java +++ b/java/sca/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java @@ -20,9 +20,7 @@ package org.apache.tuscany.sca.monitor.logging.impl; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -77,7 +75,10 @@ public class DefaultLoggingMonitorImpl implements Monitor { return problemCache; } - public Problem getLastLoggedProblem(){ + public Problem getLastLoggedProblem() { + if (problemCache.isEmpty()) { + return null; + } return problemCache.get(problemCache.size() - 1); } -- cgit v1.2.3