未验证 提交 6d811000 编写于 作者: P Phodal Huang

fix: fix self callee

上级 c6817190
......@@ -179,14 +179,18 @@ func (s *JavaCallListener) EnterMethodCall(ctx *parser.MethodCallContext) {
var jMethodCall = &models.JMethodCall{}
if fullType != "" {
if targetType == "" {
// 处理自调用
targetType = currentClz
}
jMethodCall = &models.JMethodCall{removeTarget(fullType), "", targetType, callee, startLine, startLinePosition, stopLine, stopLinePosition}
} else {
if ctx.GetText() == targetType {
//fmt.Println(ctx.IDENTIFIER().GetText())
//fmt.Println(imports)
methodName := ctx.IDENTIFIER().GetText()
pkg := currentPkg
clz := currentClz
// 处理 static 方法,如 now()
for _, imp := range imports {
if strings.HasSuffix(imp, "."+methodName) {
pkg = imp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册