Author: mircea.markus
Date: 2008-01-30 13:36:19 -0500 (Wed, 30 Jan 2008)
New Revision: 5266
Modified:
benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
Log:
guarded the received list of results
Modified:
benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java 2008-01-30
18:24:23 UTC (rev 5265)
+++
benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java 2008-01-30
18:36:19 UTC (rev 5266)
@@ -66,7 +66,13 @@
List<List<TestResult>> results = new
ArrayList<List<TestResult>>();
for (SocketAddress socketAddress : receivedMessages.keySet())
{
- List<TestResult> testResults = (List<TestResult>)
receivedMessages.get(socketAddress);
+ Object obj = receivedMessages.get(socketAddress);
+ if (!(obj instanceof List))
+ {
+ log.error("Expected a List of results, but received '" + obj +
"'");
+ throw new IllegalStateException("Expected a List of results, but
received '" + obj + "'");
+ }
+ List<TestResult> testResults = (List<TestResult>) obj;
log.trace("From " + socketAddress + " received " +
testResults);
results.add(testResults);
}
Show replies by date