fix: 判断 getter 方法不正确问题。

This commit is contained in:
Suomm 2023-07-02 21:16:08 +08:00
parent 243705b54a
commit 4939013da6

View File

@ -114,9 +114,9 @@ public class StrUtil {
public static boolean isGetterMethod(String methodName, String property) {
if (methodName.startsWith("get") && methodName.length() > 3) {
return firstCharToUpperCase(property).equals(methodName.substring(3));
return firstCharToUpperCase(property).concat("()").equals(methodName.substring(3));
} else if (methodName.startsWith("is") && methodName.length() > 2) {
return firstCharToUpperCase(property).equals(methodName.substring(2));
return firstCharToUpperCase(property).concat("()").equals(methodName.substring(2));
} else {
return false;
}