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

ObjectView support enum/tt命令无法解析到第一个参数为Enum的值 #454

Closed
1 task done
generalthink opened this issue Jan 16, 2019 · 1 comment
Closed
1 task done
Milestone

Comments

@generalthink
Copy link

generalthink commented Jan 16, 2019

  • 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 3.0.5.2
  • Arthas 版本: 3.0.5.2
  • 操作系统版本: Linux 3.10.0-862.9.1.el7.x86_64
  • 目标进程的JVM版本: 1.8
  • 执行arthas-boot的版本: 3.0.5.2

重现问题的步骤

  1. tt -t -n 2 full_controller_name method_name
  2. request url in google : http://localhost:8080/notification/TODAY/123456/list?country=ID
  3. tt -i index
    发现无法确认第一个参数的值具体是哪个枚举值

部分代码:

@Controller
@RequestMapping("/notification")
public class NotificationController {
@RequestMapping(value = "/{category}/{mid}/list", method = RequestMethod.GET)
    @ResponseBody
    public BaseResponse getNotifications(@PathVariable("category") NotificationCategory category, @PathVariable("mid") String mid,@RequestParam(value="country") String country) {

        //返回值并不重要
        return ResonseUtil.success();
    }

}

public enum NotificationCategory {
    RESERVED,
    UGC,
    TODAY,
    ALL;

    public static final NotificationCategory values[] = values();
}

但是watch命令可以观察到第一个参数的值
image

期望的结果

希望可以定位到参数到底是哪个枚举

实际运行的结果

image

@hengyunabc
Copy link
Collaborator

目前是当Object输出了,所以把所有的field都输出了。 可以加个.toString() ,或者 .ordinal() 来获取具体的值。

下个版本支持打印enum。

@hengyunabc hengyunabc added this to the 3.0.6 milestone Jan 17, 2019
@hengyunabc hengyunabc changed the title tt命令无法解析到第一个参数为Enum的值 ObjectView support enum/tt命令无法解析到第一个参数为Enum的值 Feb 13, 2019
lzc-alioo pushed a commit to lzc-alioo/arthas that referenced this issue May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants