Use Java 8 forEach method on Map

This commit is contained in:
Jon Borenstein
2017-04-25 18:00:38 -04:00
committed by Stephane Nicoll
parent 1ea54eb2c6
commit 13dc0cd828
8 changed files with 29 additions and 34 deletions

View File

@@ -114,7 +114,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
logger.warn("Neither 'urlMap' nor 'mappings' set on SimpleUrlHandlerMapping");
}
else {
for (Map.Entry<String, Object> entry : urlMap.entrySet()) {
urlMap.entrySet().forEach(entry -> {
String url = entry.getKey();
Object handler = entry.getValue();
// Prepend with slash if not already present.
@@ -126,7 +126,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
handler = ((String) handler).trim();
}
registerHandler(url, handler);
}
});
}
}