RedissonCache should put NullValue object instead of null #853

pull/856/head
Nikita 8 years ago
parent 4b288c7d47
commit 9e0d445ee9

@ -92,6 +92,7 @@ public class RedissonCache implements Cache {
@Override @Override
public void put(Object key, Object value) { public void put(Object key, Object value) {
value = toStoreValue(value);
if (mapCache != null) { if (mapCache != null) {
mapCache.fastPut(key, value, config.getTTL(), TimeUnit.MILLISECONDS, config.getMaxIdleTime(), TimeUnit.MILLISECONDS); mapCache.fastPut(key, value, config.getTTL(), TimeUnit.MILLISECONDS, config.getMaxIdleTime(), TimeUnit.MILLISECONDS);
} else { } else {
@ -100,6 +101,7 @@ public class RedissonCache implements Cache {
} }
public ValueWrapper putIfAbsent(Object key, Object value) { public ValueWrapper putIfAbsent(Object key, Object value) {
value = toStoreValue(value);
Object prevValue; Object prevValue;
if (mapCache != null) { if (mapCache != null) {
prevValue = mapCache.putIfAbsent(key, value, config.getTTL(), TimeUnit.MILLISECONDS, config.getMaxIdleTime(), TimeUnit.MILLISECONDS); prevValue = mapCache.putIfAbsent(key, value, config.getTTL(), TimeUnit.MILLISECONDS, config.getMaxIdleTime(), TimeUnit.MILLISECONDS);

Loading…
Cancel
Save