alibaba / arthas

Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas
https://arthas.aliyun.com/
Apache License 2.0
35.7k stars 7.51k forks source link

4.0.0 及之后版本不支持 watch 构造函数 #2933

Open hengyunabc opened 2 weeks ago

hengyunabc commented 2 weeks ago

https://github.com/alibaba/arthas/pull/2658 引入的Bug。 @Allan-QLB

下面这两个命令都会识别为重定向:

watch demo.MathGame '<init>'
watch demo.MathGame <init>
    @Test
    public void testSeparateRedirect2() {
        String[] expectedTextTokenValue = new String[]{"watch", "demo.MathGame", "<init>"};
        String cmd = "watch demo.MathGame '<init>'";
        List<CliToken> actualTokens = CliTokenImpl.tokenize(cmd);
        assertEqualsIgnoreBlank(expectedTextTokenValue, actualTokens);
        Assert.assertEquals(cmd, concatRaw(actualTokens));
    }
hengyunabc commented 1 week ago

目前没有太好的修复办法,需要整体重构 token 的解析。考虑先把 https://github.com/alibaba/arthas/pull/2658 revert 。