You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/27 04:29:06 UTC

[GitHub] [skywalking] yaojingguo commented on pull request #6462: Fix ClassCastException from CallbackAdapterInterceptor

yaojingguo commented on pull request #6462:
URL: https://github.com/apache/skywalking/pull/6462#issuecomment-787002852


   ```
       private ContextSnapshot getSnapshot(CallbackCache cache) {
           ContextSnapshot snapshot = cache.getSnapshot();
           if (snapshot == null) {
               snapshot = ((CallbackCache) ((EnhancedInstance) cache.getCallback()).getSkyWalkingDynamicField()).getSnapshot();
           }
           return snapshot;
       }
   ```
   In `CallbackInterceptor`'s `getSnapshot`, `((CallbackCache) ((EnhancedInstance) cache.getCallback()).getSkyWalkingDynamicField()).getSnapshot()` requires `CallbackCache`. So I make `CallbackAdapterInterceptor`'s `getSkyWalkingDynamicField` returns a `CallbackCache` insteadf of `ContextSnapshot`.
   
   Could you help me review my PR? Thanks.
   @zifeihan 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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