-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Open
Milestone
Description
There is some defect in the following methods:
static boolean isSetter(Method method) {
return method.getName().startsWith("set")
&& !"set".equals(method.getName())
&& Modifier.isPublic(method.getModifiers())
&& method.getParameterCount() == 1
&& ClassUtils.isPrimitive(method.getParameterTypes()[0]);
}
static boolean isGetter(Method method) {
String name = method.getName();
return (name.startsWith("get") || name.startsWith("is"))
&& !"get".equals(name) && !"is".equals(name)
&& !"getClass".equals(name) && !"getObject".equals(name)
&& Modifier.isPublic(method.getModifiers())
&& method.getParameterTypes().length == 0
&& ClassUtils.isPrimitive(method.getReturnType());
}
static boolean isMetaMethod(Method method) {
String name = method.getName();
if (!(name.startsWith("get") || name.startsWith("is"))) {
return false;
}
if ("get".equals(name)) {
return false;
}
if ("getClass".equals(name)) {
return false;
}
if (!Modifier.isPublic(method.getModifiers())) {
return false;
}
if (method.getParameterTypes().length != 0) {
return false;
}
if (!ClassUtils.isPrimitive(method.getReturnType())) {
return false;
}
return true;
}- The parameter type or return type should not only primitive
Metadata
Metadata
Assignees
Labels
No labels