Browse Source

Simplify DefaultContextCache implementation by using entrySet().removeIf()

pull/36169/head
Sam Brannen 2 weeks ago
parent
commit
01a57a7219
  1. 6
      spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java

6
spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java vendored

@ -341,11 +341,7 @@ public class DefaultContextCache implements ContextCache { @@ -341,11 +341,7 @@ public class DefaultContextCache implements ContextCache {
}
// Remove empty entries from the hierarchy map.
for (Map.Entry<MergedContextConfiguration, Set<MergedContextConfiguration>> entry : this.hierarchyMap.entrySet()) {
if (entry.getValue().isEmpty()) {
this.hierarchyMap.remove(entry.getKey());
}
}
this.hierarchyMap.entrySet().removeIf(entry -> entry.getValue().isEmpty());
}
private void remove(List<MergedContextConfiguration> removedContexts, MergedContextConfiguration key) {

Loading…
Cancel
Save