summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-08 00:41:02 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-08 00:41:02 +0000
commitfc1b59e0d44eb5f451208e5446f5c316ceabdef8 (patch)
tree1ed2767b5e17529bc07c50052b1dc9cdc31ce30c /java/sca
parent440097128eb008ffdf73ee61347554d517e50288 (diff)
Add check to avoid ArrayOutofBound
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@683776 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/monitor-logging/src/main/java/org/apache/tuscany/sca/monitor/logging/impl/DefaultLoggingMonitorImpl.java7
1 files changed, 4 insertions, 3 deletions
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);
}