final RpcInvocationStrategy rpc = rpcNames.get(method);
if (rpc != null) {
- if (method.getParameterTypes().length == 0) {
+ if (method.getParameterCount() == 0) {
return rpc.invokeEmpty();
}
if (args.length != 1) {
private static boolean isObjectMethod(final Method m) {
switch (m.getName()) {
case "toString":
- return m.getReturnType().equals(String.class) && m.getParameterTypes().length == 0;
+ return m.getReturnType().equals(String.class) && m.getParameterCount() == 0;
case "hashCode":
- return m.getReturnType().equals(int.class) && m.getParameterTypes().length == 0;
+ return m.getReturnType().equals(int.class) && m.getParameterCount() == 0;
case "equals":
- return m.getReturnType().equals(boolean.class) && m.getParameterTypes().length == 1 && m
+ return m.getReturnType().equals(boolean.class) && m.getParameterCount() == 1 && m
.getParameterTypes()[0] == Object.class;
default:
return false;
// constructors but the one we want has the bean ConstructorProperties annotation.
for (final Constructor<?> ctor: propertyType.getConstructors()) {
final ConstructorProperties ctorPropsAnnotation = ctor.getAnnotation(ConstructorProperties.class);
- if (ctor.getParameterTypes().length == 1 && ctorPropsAnnotation != null) {
+ if (ctor.getParameterCount() == 1 && ctorPropsAnnotation != null) {
findYangTypeGetter(propertyType, ctorPropsAnnotation.value()[0]);
CONSTRUCTORS.put(propertyType, ctor);
break;