There is some defect in the above two methods:
```java
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
[ Full content available at: https://github.com/apache/dubbo/issues/5664 ]
This message was relayed via gitbox.apache.org for
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]