Commit 4a52d215d09e6f78765795db2230a49fd69a9035
1 parent
6cc65d34
#chore:去掉不必要的空值检测
Showing
1 changed file
with
22 additions
and
22 deletions
src/main/java/com/irrigation/icl/cache/core/LayeringCache.java
| @@ -64,7 +64,7 @@ public class LayeringCache extends RedisCache { | @@ -64,7 +64,7 @@ public class LayeringCache extends RedisCache { | ||
| 64 | Element value = ehCache.get(key); | 64 | Element value = ehCache.get(key); |
| 65 | if (value != null) { | 65 | if (value != null) { |
| 66 | log.info("Hit Cache L1 (ehcache) :{}={}", key, value); | 66 | log.info("Hit Cache L1 (ehcache) :{}={}", key, value); |
| 67 | - return (value != null ? new SimpleValueWrapper(value.getObjectValue()) : null); | 67 | + return new SimpleValueWrapper(value.getObjectValue()); |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | Cache.ValueWrapper wrapper = super.get(key); | 70 | Cache.ValueWrapper wrapper = super.get(key); |
| @@ -239,25 +239,25 @@ public class LayeringCache extends RedisCache { | @@ -239,25 +239,25 @@ public class LayeringCache extends RedisCache { | ||
| 239 | layeringL1CacheManager = new CacheManager(configuration); | 239 | layeringL1CacheManager = new CacheManager(configuration); |
| 240 | } | 240 | } |
| 241 | } | 241 | } |
| 242 | - | ||
| 243 | - class MyCopyStrategy implements ReadWriteCopyStrategy<Element> { | ||
| 244 | - @Override | ||
| 245 | - public Element copyForWrite(Element value) { | ||
| 246 | - if (value != null) { | ||
| 247 | - Object temp = (Serializable) value.getObjectValue(); | ||
| 248 | - return new Element(value.getObjectKey(), temp); | ||
| 249 | - } | ||
| 250 | - return value; | ||
| 251 | - } | ||
| 252 | - | ||
| 253 | - @Override | ||
| 254 | - public Element copyForRead(Element storedValue) { | ||
| 255 | - if (storedValue != null) { | ||
| 256 | - Object temp = (Serializable) storedValue.getObjectValue(); | ||
| 257 | - return new Element(storedValue.getObjectKey(), temp); | ||
| 258 | - } | ||
| 259 | - return storedValue; | ||
| 260 | - | ||
| 261 | - } | ||
| 262 | - } | 242 | +// |
| 243 | +// class MyCopyStrategy implements ReadWriteCopyStrategy<Element> { | ||
| 244 | +// @Override | ||
| 245 | +// public Element copyForWrite(Element value) { | ||
| 246 | +// if (value != null) { | ||
| 247 | +// Object temp = (Serializable) value.getObjectValue(); | ||
| 248 | +// return new Element(value.getObjectKey(), temp); | ||
| 249 | +// } | ||
| 250 | +// return value; | ||
| 251 | +// } | ||
| 252 | +// | ||
| 253 | +// @Override | ||
| 254 | +// public Element copyForRead(Element storedValue) { | ||
| 255 | +// if (storedValue != null) { | ||
| 256 | +// Object temp = (Serializable) storedValue.getObjectValue(); | ||
| 257 | +// return new Element(storedValue.getObjectKey(), temp); | ||
| 258 | +// } | ||
| 259 | +// return storedValue; | ||
| 260 | +// | ||
| 261 | +// } | ||
| 262 | +// } | ||
| 263 | } | 263 | } |