}
@Override
- public Object invoke(final Object proxyObj, final Method method, final Object[] args) throws Throwable {
+ public Object invoke(final Object proxyObj, final Method method, final Object[] args) {
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 method) {
switch (method.getName()) {
case "toString":
- return method.getReturnType().equals(String.class) && method.getParameterTypes().length == 0;
+ return method.getReturnType().equals(String.class) && method.getParameterCount() == 0;
case "hashCode":
- return method.getReturnType().equals(int.class) && method.getParameterTypes().length == 0;
+ return method.getReturnType().equals(int.class) && method.getParameterCount() == 0;
case "equals":
- return method.getReturnType().equals(boolean.class) && method.getParameterTypes().length == 1 && method
+ return method.getReturnType().equals(boolean.class) && method.getParameterCount() == 1 && method
.getParameterTypes()[0] == Object.class;
default:
return false;
// DOMRpcResult does not have a notion of success, hence we have to reverse-engineer it by looking
// at reported errors and checking whether they are just warnings.
- final Collection<RpcError> errors = input.getErrors();
+ final Collection<? extends RpcError> errors = input.getErrors();
return RpcResult.class.cast(RpcResultBuilder.status(errors.stream()
.noneMatch(error -> error.getSeverity() == ErrorSeverity.ERROR))
.withResult(bindingResult).withRpcErrors(errors).build());