No effective change - code cleanup - while to foreach

This commit is contained in:
Robin Bygrave
2015-07-31 16:51:12 +12:00
parent bef2894949
commit 3451280679
3 changed files with 16 additions and 22 deletions
@@ -329,17 +329,15 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
synchronized (statisticsMonitor) {
Counters counters = new Counters();
Iterator<Statistics> it = statisticsMap.values().iterator();
while (it.hasNext()) {
Statistics queryPointStatistics = it.next();
if (!queryPointStatistics.hasUsage()){
// no usage statistics collected yet...
counters.incrementNoUsage();
} else {
updateTunedQueryFromUsage(counters, queryPointStatistics);
}
}
for (Statistics queryPointStatistics : statisticsMap.values()) {
if (!queryPointStatistics.hasUsage()) {
// no usage statistics collected yet...
counters.incrementNoUsage();
} else {
updateTunedQueryFromUsage(counters, queryPointStatistics);
}
}
String summaryInfo = counters.toString();
@@ -76,12 +76,10 @@ public class Statistics implements Serializable {
}
PathProperties pathProps = new PathProperties();
Iterator<StatisticsNodeUsage> it = nodeUsageMap.values().iterator();
while (it.hasNext()) {
StatisticsNodeUsage statsNode = it.next();
statsNode.buildTunedFetch(pathProps, rootDesc);
}
for (StatisticsNodeUsage statsNode : nodeUsageMap.values()) {
statsNode.buildTunedFetch(pathProps, rootDesc);
}
OrmQueryDetail detail = new OrmQueryDetail();
@@ -376,13 +376,11 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
totalPacketsResent += s.size();
Iterator<Long> it = s.iterator();
while (it.hasNext()) {
Long resendPacketId = it.next();
for (Long resendPacketId : s) {
Packet packet = outgoingPacketsCache.getPacket(resendPacketId);
if (packet == null) {
String msg = "Cluster unable to resend packet[" + resendPacketId + "] as it is no longer in the " +
"outgoingPacketsCache";
"outgoingPacketsCache";
logger.error(msg);
} else {
int resendCount = packet.incrementResendCount();
@@ -390,7 +388,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
resendPacket(packet);
} else {
String msg = "Cluster maxResendOutgoing [" + maxResendOutgoing + "] hit for packet " + resendPacketId
+ ". We will not try to send it anymore, removing it from the outgoingPacketsCache.";
+ ". We will not try to send it anymore, removing it from the outgoingPacketsCache.";
logger.error(msg);
outgoingPacketsCache.remove(packet);
}