未验证 提交 1bb86731 编写于 作者: P Phodal Huang

refactor: move is java type to package

上级 b7754734
......@@ -79,7 +79,7 @@ func (s Service) Evaluate(result *EvaluateModel, node domain.JClassNode) {
if s.enableSameReturnType() {
for _, method := range node.Methods {
if !s.isJavaType(method) {
if !method.IsJavaLangReturnType() {
methodType := method.Type
if _, ok := serviceNodeMap[methodType]; ok {
......@@ -91,10 +91,6 @@ func (s Service) Evaluate(result *EvaluateModel, node domain.JClassNode) {
}
}
func (s Service) isJavaType(method domain.JMethod) bool {
return method.Type == "String" || method.Type == "int"
}
func (s Service) buildLifecycle(methodNameArray [][]string) map[string][]string {
var hadLifecycle = make(map[string][]string)
var nameMap = make(map[string][]string)
......
......@@ -37,6 +37,10 @@ func NewJMethod() JMethod {
}
}
func (m *JMethod) IsJavaLangReturnType() bool {
return m.Type == "String" || m.Type == "int" || m.Type == "float" || m.Type == "void" || m.Type == "char" || m.Type == "double"
}
func (m *JMethod) IsStatic() bool {
return infrastructure.StringArrayContains(m.Modifiers, "static")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册