From e585d337b30f48b9eee6c0d058f057e0135bc1a8 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Sun, 9 Feb 2020 22:25:09 +0800 Subject: [PATCH] feat: add field type support --- .../main/kotlin/chapi/ast/javaast/JavaFullIdentListener.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chapi-ast-java/src/main/kotlin/chapi/ast/javaast/JavaFullIdentListener.kt b/chapi-ast-java/src/main/kotlin/chapi/ast/javaast/JavaFullIdentListener.kt index 2166500b..62fb5638 100644 --- a/chapi-ast-java/src/main/kotlin/chapi/ast/javaast/JavaFullIdentListener.kt +++ b/chapi-ast-java/src/main/kotlin/chapi/ast/javaast/JavaFullIdentListener.kt @@ -323,10 +323,13 @@ open class JavaFullIdentListener(fileName: String) : JavaAstListener() { private fun parseTargetType(target: String?): String? { var targetType = target + val fieldType = fieldsMap[targetType] val formalType = formalParameters[targetType] val localVarType = localVars[targetType] - if (formalType != null && formalType != "") { + if (fieldType != null && fieldType != "") { + targetType = fieldType + } else if (formalType != null && formalType != "") { targetType = formalType } else if (localVarType != null && localVarType != "") { targetType = localVarType