提交 745e1043 编写于 作者: X Xin,Zhang 提交者: wu-sheng

Fix ClassCastException (#2125)

上级 6a4e7ffc
......@@ -39,6 +39,11 @@ public class SWExecutionHookWrapper extends HystrixCommandExecutionHook {
@Override
public <T> void onStart(HystrixInvokable<T> commandInstance) {
if (!(commandInstance instanceof EnhancedInstance)) {
actual.onStart(commandInstance);
return;
}
EnhancedInstance enhancedInstance = (EnhancedInstance)commandInstance;
EnhanceRequireObjectCache enhanceRequireObjectCache = (EnhanceRequireObjectCache)enhancedInstance.getSkyWalkingDynamicField();
if (ContextManager.isActive()) {
......@@ -166,6 +171,11 @@ public class SWExecutionHookWrapper extends HystrixCommandExecutionHook {
}
@Override public <T> void onStart(HystrixCommand<T> commandInstance) {
if (!(commandInstance instanceof EnhancedInstance)) {
actual.onStart(commandInstance);
return;
}
EnhancedInstance enhancedInstance = (EnhancedInstance)commandInstance;
EnhanceRequireObjectCache enhanceRequireObjectCache = (EnhanceRequireObjectCache)enhancedInstance.getSkyWalkingDynamicField();
if (ContextManager.isActive()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册