提交 17648c67 编写于 作者: F fuyou001 提交者: von gosling

#ROCKETMQ-340# improve code for avoid ClassCastException. (#210)

上级 6eed5f1c
......@@ -44,8 +44,10 @@ public class BrokerFastFailure {
public static RequestTask castRunnable(final Runnable runnable) {
try {
FutureTaskExt object = (FutureTaskExt) runnable;
return (RequestTask) object.getRunnable();
if (runnable instanceof FutureTaskExt) {
FutureTaskExt object = (FutureTaskExt) runnable;
return (RequestTask) object.getRunnable();
}
} catch (Throwable e) {
log.error(String.format("castRunnable exception, %s", runnable.getClass().getName()), e);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册