celesky opened a new issue #1597: CacheFilter,when value is null,it will throw 
NPE(if use ehcache for jcache),why not check null here
URL: https://github.com/apache/incubator-dubbo/issues/1597
   when value is null,it will throw NPE(if use ehcache for jcache),why not 
check null here?
   if the value is null ,maybe we have no need to cache it.
   `package com.alibaba.dubbo.cache.filter;
   public class CacheFilter implements Filter {
       private CacheFactory cacheFactory;
       public void setCacheFactory(CacheFactory cacheFactory) {
           this.cacheFactory = cacheFactory;
       public Result invoke(Invoker<?> invoker, Invocation invocation) throws 
RpcException {
           if (cacheFactory != null && 
 Constants.CACHE_KEY))) {
               Cache cache = 
               if (cache != null) {
                   String key = 
                   if (cache != null && key != null) {
                       Object value = cache.get(key);
                       if (value != null) {
                           return new RpcResult(value);
                       Result result = invoker.invoke(invocation);
                       if (!result.hasException()) {
                           cache.put(key, result.getValue());
                       return result;
           return invoker.invoke(invocation);

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to