Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch 特殊用法 中 ognl不存在size()的方法 #515

Closed
CjqDy opened this Issue Feb 15, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@CjqDy
Copy link

CjqDy commented Feb 15, 2019

在查看watch特殊用法的章节中
针对参数的size()方法提示报错
watch failed, condition is: null, express is: params[0].size(), ognl.MethodFailedException: Method "size" failed for object 0 [java.lang.NoSuchMethodException: java.lang.Integer.size()]
官方文档上是没有问题的
$ watch com.taobao.container.Test test "params[0].size()"
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 22 ms.
@integer[40]

@hengyunabc

This comment has been minimized.

Copy link
Collaborator

hengyunabc commented Feb 15, 2019

这个是文档错误,我更新下。应该是 params.size()

@hengyunabc

This comment has been minimized.

Copy link
Collaborator

hengyunabc commented Feb 15, 2019

具体在哪个文档里?我搜索了下没找到

@CjqDy

This comment has been minimized.

Copy link
Author

CjqDy commented Feb 15, 2019

这个是文档错误,我更新下。应该是 params.size()

params[0]表示的应该是第一个参数,params[0].size() 表示的第一个参数的长度
感觉是没什么错

我换成params.size()也还是报这个错误

在 Arthas的一些特殊用法文档说明 #71 Issues里

@hengyunabc

This comment has been minimized.

Copy link
Collaborator

hengyunabc commented Feb 15, 2019

额,我理解了。 params 是一个数组,可以用 params.length 来获取它的大小。

#71 的是指 params[0] 它是一个集合,比如函数参数的第一个是一个List,那就可以 params[0].size() 知道它的大小。

@CjqDy CjqDy closed this Feb 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.