You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/07/13 20:25:14 UTC

[GitHub] L-Angel removed a comment on issue #2054: anonymous inner class doesn't work in callback.

L-Angel removed a comment on issue #2054: anonymous inner class doesn't work in callback.
URL: https://github.com/apache/incubator-dubbo/issues/2054#issuecomment-404939101
 
 
   @diecui1202 
    I think the reason of this error is that the inner class defined in a class ,when we serialize this inner class must to serialize its parent class. In other words,In this demo the class demoController must to be serialized when the class DemoController$1.this$0 is serialized ,the $0 is a reference from inner class to outer class. And the DemoController is not implement Serializable interface.So we cant use func class.isAssignableFrom to judge that inner class implement Serializable.  
   we can modify this part
   ```
   protected Serializer getDefaultSerializer(Class cl)
     {
       if (_defaultSerializer != null)
         return _defaultSerializer;
   
       if (! Serializable.class.isAssignableFrom(cl)
   	&& ! _isAllowNonSerializable) {
         throw new IllegalStateException("Serialized class " + cl.getName() + " must implement java.io.Serializable");
       }
   
       return new JavaSerializer(cl, _loader);
     }
   ```
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org