Skip to content

Commit

Permalink
errorprone :: ForEachIterable (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb authored May 29, 2024
1 parent 9617c4c commit e26c2ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/main/java/emissary/directory/DirectoryEntryList.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -248,8 +247,7 @@ public DirectoryEntry pickOneOf(final int desiredExpense) {
public static DirectoryEntryList fromXML(final Element e) {
final DirectoryEntryList d = new DirectoryEntryList();
final List<Element> entryElements = e.getChildren(DirectoryEntry.ENTRY);
for (Iterator<Element> i = entryElements.iterator(); i.hasNext();) {
final Element entryElement = i.next();
for (Element entryElement : entryElements) {
d.add(DirectoryEntry.fromXml(entryElement));
}
return d;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/emissary/directory/DirectoryEntryMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -323,8 +322,7 @@ public int countAllMatching(final String key) {
int count = 0;

for (final DirectoryEntryList list : values()) {
for (final Iterator<DirectoryEntry> i = list.iterator(); i.hasNext();) {
final DirectoryEntry entry = i.next();
for (DirectoryEntry entry : list) {
if (KeyManipulator.gmatch(entry.getKey(), key)) {
count++;
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/emissary/pool/MoveSpool.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -120,8 +119,7 @@ public void quit() {
*/
private IDirectoryPlace getLocalDirectory() {
if (localDirectory == null) {
for (Iterator<String> i = Namespace.keySet().iterator(); i.hasNext();) {
String key = i.next();
for (String key : Namespace.keySet()) {
try {
Object value = Namespace.lookup(key);
if (value instanceof IDirectoryPlace) {
Expand Down

0 comments on commit e26c2ff

Please sign in to comment.