Use Map.forEach instead of manual Map.Entry iteration wherever possible SPR-16646

This commit is contained in:
igor-suhorukov
2018-03-28 01:55:03 +03:00
committed by Juergen Hoeller
parent 224d52e032
commit 4aae6a6dda
19 changed files with 74 additions and 99 deletions

View File

@@ -153,15 +153,15 @@ public class SimpleHttpServerFactoryBean implements FactoryBean<HttpServer>, Ini
this.server.setExecutor(this.executor);
}
if (this.contexts != null) {
for (String key : this.contexts.keySet()) {
HttpContext httpContext = this.server.createContext(key, this.contexts.get(key));
this.contexts.forEach((key, context) -> {
HttpContext httpContext = this.server.createContext(key, context);
if (this.filters != null) {
httpContext.getFilters().addAll(this.filters);
}
if (this.authenticator != null) {
httpContext.setAuthenticator(this.authenticator);
}
}
});
}
if (this.logger.isInfoEnabled()) {
this.logger.info("Starting HttpServer at address " + address);