Use Map#forEach instead of Map#entrySet#forEach

See gh-1449
This commit is contained in:
diguage
2017-06-05 16:39:28 +08:00
committed by Stephane Nicoll
parent 424bc75fb1
commit 2efa06237a
10 changed files with 38 additions and 39 deletions

View File

@@ -194,9 +194,9 @@ public abstract class UriUtils {
*/
public static Map<String, String> encodeUriVariables(Map<String, ?> uriVariables) {
Map<String, String> result = new LinkedHashMap<>(uriVariables.size());
uriVariables.entrySet().stream().forEach(entry -> {
String stringValue = (entry.getValue() != null ? entry.getValue().toString() : "");
result.put(entry.getKey(), encode(stringValue, StandardCharsets.UTF_8));
uriVariables.forEach((key, value) -> {
String stringValue = (value != null ? value.toString() : "");
result.put(key, encode(stringValue, StandardCharsets.UTF_8));
});
return result;
}