Skip to content

Commit b01fa9f

Browse files
christophstroblThomas Darimont
authored andcommitted
DATAREDIS-302 - Undo breaking change in DecoratingStringHashMapper.
The introduced generic types prevent the DecoratingStringHashMapper from being useful as it can now only be created for mappers of the generic type which was not the original intention. This breaks the retwis-j sample as well as it seems other implementations see: b0c0d23. Original pull request: spring-projects#73.
1 parent bdea105 commit b01fa9f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/springframework/data/redis/hash/DecoratingStringHashMapper.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@
2626
*/
2727
public class DecoratingStringHashMapper<T> implements HashMapper<T, String, String> {
2828

29-
private final HashMapper<T, String, String> delegate;
29+
private final HashMapper<T, ?, ?> delegate;
3030

31-
public DecoratingStringHashMapper(HashMapper<T, String, String> mapper) {
31+
public DecoratingStringHashMapper(HashMapper<T, ?, ?> mapper) {
3232
this.delegate = mapper;
3333
}
3434

35-
public T fromHash(Map<String, String> hash) {
36-
return delegate.fromHash(hash);
35+
@SuppressWarnings({ "rawtypes", "unchecked" })
36+
@Override
37+
public T fromHash(Map hash) {
38+
return (T) delegate.fromHash(hash);
3739
}
3840

3941
public Map<String, String> toHash(T object) {

0 commit comments

Comments
 (0)