WangJi92 / arthas-idea-plugin

arthas idea plugin 更简单的使用arthas的IDEA 插件,方便的构建各种arthas 命令,复制到剪切板 然后到服务器上启动arthas 执行命令。
https://plugins.jetbrains.com/plugin/13581-arthas-idea
Apache License 2.0
606 stars 98 forks source link

some class command not work #156

Open WangJi92 opened 1 day ago

WangJi92 commented 1 day ago

class com.intellij.psi.PsiWildcardType cannot be cast to class com.intellij.psi.PsiClassType (com.intellij.psi.PsiWildcardType and com.intellij.psi.PsiClassType are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1755ffbd)

image

org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#supports

boolean supports(MethodParameter methodParameter, Type targetType,
            Class<? extends HttpMessageConverter<?>> converterType);

src/com/github/idea/arthas/plugin/utils/OgnlPsUtils.java:529 这里转换的逻辑有点问题

 String qualifiedName = PsiToolkit.getPsiTypeQualifiedNameClazzName((PsiClassType) parameters[0]);
                            return "(@" + qualifiedName + "@class)";

防御性措施: watch、trace 等不应该收到影响,增加防御性

WangJi92 commented 1 day ago

image

WangJi92 commented 1 day ago

可以参考一下 src/com/github/idea/arthas/plugin/utils/OgnlPsUtils.java:578 这个做一下处理 com.github.idea.json.parser.toolkit.PsiToolkit#getPsiTypeGenericsType