Author: bdelacretaz
Date: Mon Feb 29 10:17:11 2016
New Revision: 1732846
URL: http://svn.apache.org/viewvc?rev=1732846&view=rev
Log:
SLING-5415 - avoid warning
Modified:
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
Modified:
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java?rev=1732846&r1=1732845&r2=1732846&view=diff
==============================================================================
---
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
(original)
+++
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
Mon Feb 29 10:17:11 2016
@@ -26,6 +26,7 @@ import static org.mockito.MockitoAnnotat
import java.util.Collection;
import java.util.Date;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -169,14 +170,15 @@ public class HealthCheckExecutorImplTest
}
- private int getLogEntryCount(HealthCheckExecutionResult result) {
- int logEntryCount = 0;
- for (Entry entry : result.getHealthCheckResult()) {
- logEntryCount++;
- }
+ private int getLogEntryCount(HealthCheckExecutionResult result) {
+ int logEntryCount = 0;
+ final Iterator<Entry> it = result.getHealthCheckResult().iterator();
+ while(it.hasNext()) {
+ it.next();
+ logEntryCount++;
+ }
return logEntryCount;
- }
-
+ }
private void addResultToCache(Status status) {
healthCheckResultCache.updateWith(new
ExecutionResult(HealthCheckMetadata, new Result(status, "Status "+status),
1000));