DATAREDIS-1063 - Build against JDK 11+.

This commit is contained in:
Greg Turnquist
2019-11-05 13:21:34 -06:00
committed by Mark Paluch
parent 292c0a3756
commit a3d2ad7ed6
8 changed files with 126 additions and 73 deletions

View File

@@ -15,11 +15,11 @@
*/
package org.springframework.data.redis.connection.convert;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.core.convert.converter.Converter;
/**
@@ -49,10 +49,11 @@ public class MapConverter<S, T> implements Converter<Map<S, S>, Map<T, T>> {
@Override
public Map<T, T> convert(Map<S, S> source) {
return source.entrySet().stream()
.collect(Collectors.toMap(e -> itemConverter.convert(e.getKey()), e -> itemConverter.convert(e.getValue()),
(a, b) -> a, source instanceof LinkedHashMap ? LinkedHashMap::new : HashedMap::new));
return source.entrySet().stream() //
.collect(Collectors.toMap( //
e -> itemConverter.convert(e.getKey()), //
e -> itemConverter.convert(e.getValue()), //
(a, b) -> a, source instanceof LinkedHashMap ? LinkedHashMap::new : HashMap::new));
}
}