Use for-each statement
Change-Id: Ib89f3372caebc30542739c0eba62f67ef56a4d4e
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java
index f0ab09c..213244f 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java
@@ -606,17 +606,14 @@
+ "southboundGroupEntries for device {}",
southboundGroupEntries.size(),
deviceId);
- for (Iterator<Group> it = southboundGroupEntries.iterator(); it.hasNext();) {
- Group group = it.next();
+ for (Group group : southboundGroupEntries) {
log.trace("Group {} in device {}", group, deviceId);
}
log.trace("Displaying all ({}) stored group entries for device {}",
storedGroupEntries.size(),
deviceId);
- for (Iterator<Group> it1 = storedGroupEntries.iterator();
- it1.hasNext();) {
- Group group = it1.next();
+ for (Group group : storedGroupEntries) {
log.trace("Stored Group {} for device {}", group, deviceId);
}
diff --git a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
index 29cd8e0..764fe9e 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
@@ -1261,17 +1261,14 @@
log.trace("pushGroupMetrics: Displaying all ({}) southboundGroupEntries for device {}",
southboundGroupEntries.size(),
deviceId);
- for (Iterator<Group> it = southboundGroupEntries.iterator(); it.hasNext();) {
- Group group = it.next();
+ for (Group group : southboundGroupEntries) {
log.trace("Group {} in device {}", group, deviceId);
}
log.trace("Displaying all ({}) stored group entries for device {}",
storedGroupEntries.size(),
deviceId);
- for (Iterator<StoredGroupEntry> it1 = storedGroupEntries.iterator();
- it1.hasNext();) {
- Group group = it1.next();
+ for (StoredGroupEntry group : storedGroupEntries) {
log.trace("Stored Group {} for device {}", group, deviceId);
}
diff --git a/core/store/persistence/src/main/java/org/onosproject/persistence/impl/PersistentSet.java b/core/store/persistence/src/main/java/org/onosproject/persistence/impl/PersistentSet.java
index 067329c..c2e885f 100644
--- a/core/store/persistence/src/main/java/org/onosproject/persistence/impl/PersistentSet.java
+++ b/core/store/persistence/src/main/java/org/onosproject/persistence/impl/PersistentSet.java
@@ -82,9 +82,8 @@
public Object[] toArray() {
Object[] retArray = new Object[items.size()];
int index = 0;
- Iterator<byte[]> iterator = items.iterator();
- while (iterator.hasNext()) {
- retArray[index] = serializer.decode(iterator.next());
+ for (byte[] item : items) {
+ retArray[index] = serializer.decode(item);
index++;
}
return retArray;
@@ -191,4 +190,4 @@
public int hashCode() {
return super.hashCode();
}
-}
\ No newline at end of file
+}