Use lambdas for map entry iteration where possible
See gh-12626
This commit is contained in:
committed by
Phillip Webb
parent
78a94cafe1
commit
69bc19e0ca
@@ -20,7 +20,6 @@ import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -423,14 +422,7 @@ class ProjectGenerationRequest {
|
||||
|
||||
private static void filter(Map<String, ProjectType> projects, String tag,
|
||||
String tagValue) {
|
||||
for (Iterator<Map.Entry<String, ProjectType>> it = projects.entrySet()
|
||||
.iterator(); it.hasNext();) {
|
||||
Map.Entry<String, ProjectType> entry = it.next();
|
||||
String value = entry.getValue().getTags().get(tag);
|
||||
if (!tagValue.equals(value)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
projects.entrySet().removeIf((entry) -> !tagValue.equals(entry.getValue().getTags().get(tag)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.boot.cli.compiler;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.codehaus.groovy.ast.ASTNode;
|
||||
@@ -68,14 +67,8 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
|
||||
for (ImportNode importNode : module.getStarImports()) {
|
||||
visitAnnotatedNode(importNode, annotationNodes);
|
||||
}
|
||||
for (Map.Entry<String, ImportNode> entry : module.getStaticImports()
|
||||
.entrySet()) {
|
||||
visitAnnotatedNode(entry.getValue(), annotationNodes);
|
||||
}
|
||||
for (Map.Entry<String, ImportNode> entry : module.getStaticStarImports()
|
||||
.entrySet()) {
|
||||
visitAnnotatedNode(entry.getValue(), annotationNodes);
|
||||
}
|
||||
module.getStaticImports().forEach((key, value) -> visitAnnotatedNode(value, annotationNodes));
|
||||
module.getStaticStarImports().forEach((key, value) -> visitAnnotatedNode(value, annotationNodes));
|
||||
for (ClassNode classNode : module.getClasses()) {
|
||||
visitAnnotatedNode(classNode, annotationNodes);
|
||||
classNode.visitContents(classVisitor);
|
||||
|
||||
Reference in New Issue
Block a user