提交 a95e15fb 编写于 作者: 刘正阳 提交者: wu-sheng

Fix ArrayIndexOutOfBoundsException (#2284)

* Fix ArrayIndexOutOfBoundsException when intercepting net.spy.memcached.MemcachedClient.getStats()

* revert format
上级 8f866fec
......@@ -41,7 +41,15 @@ public class MemcachedMethodInterceptor implements InstanceMethodsAroundIntercep
span.setComponent(ComponentsDefine.SPYMEMCACHED);
Tags.DB_TYPE.set(span, ComponentsDefine.SPYMEMCACHED.getName());
SpanLayer.asCache(span);
Tags.DB_STATEMENT.set(span, method.getName() + " " + allArguments[0]);
Tags.DB_STATEMENT.set(span, getStatement(method, allArguments));
}
private String getStatement(Method method, Object[] allArguments) {
if (allArguments != null && allArguments.length > 0) {
return method.getName() + ' ' + allArguments[0];
} else {
return method.getName();
}
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册