未验证 提交 4878986f 编写于 作者: P Phodal Huang

fix: fix chain issue

上级 deb70983
......@@ -140,13 +140,17 @@ func (s *JavaCallListener) EnterMethodCall(ctx *MethodCallContext) {
stopLine := ctx.GetStop().GetLine()
stopLinePosition := startLinePosition + len(callee)
fullType := warpTargetFullType(targetType)
//fmt.Println("callee: " + callee + " targetType: -> " + targetType + " fulltype: " + fullType)
// TODO: 处理链试调用
if strings.Contains(targetType, "()") && strings.Contains(targetType, ".") {
split := strings.Split(targetType, ".")
sourceTarget := split[0]
targetType = localVars[sourceTarget]
}
fullType := warpTargetFullType(targetType)
if targetType == "super" {
targetType = currentClzExtends
}
if fullType != "" {
jMethodCall := &JMethodCall{removeTarget(fullType), "", targetType, callee, startLine, startLinePosition, stopLine, stopLinePosition}
methodCalls = append(methodCalls, *jMethodCall)
......@@ -157,7 +161,7 @@ func (s *JavaCallListener) EnterMethodCall(ctx *MethodCallContext) {
methodCalls = append(methodCalls, *jMethodCall)
} else {
methodName := ctx.IDENTIFIER().GetText()
jMethodCall := &JMethodCall{currentPkg, "", targetType, methodName, startLine, startLinePosition, stopLine, stopLinePosition}
jMethodCall := &JMethodCall{currentPkg, "NEEDFIX", targetType, methodName, startLine, startLinePosition, stopLine, stopLinePosition}
methodCalls = append(methodCalls, *jMethodCall)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册