From f59d1fec0bb956948e4044405b40a1a0687f64ea Mon Sep 17 00:00:00 2001 From: Alex Heneveld Date: Fri, 30 Sep 2011 11:49:50 +0100 Subject: [PATCH] allow null/missing for varargs params (needed e.g. for EC2 ElasticBlockStoreAsyncClient.describeVolumesInRegion) --- .../org/jclouds/rest/internal/RestAnnotationProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java b/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java index 19321a8228..460d866482 100644 --- a/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java +++ b/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java @@ -969,6 +969,10 @@ public class RestAnnotationProcessor { throw new IllegalArgumentException("Argument index "+(entry.getKey()+1)+" is out of bounds for method "+request.getJavaMethod()); } + if (request.getJavaMethod().isVarArgs() && entry.getKey() + 1 == request.getJavaMethod().getParameterTypes().length) + //allow null/missing for var args + continue OUTER; + Annotation[] annotations = request.getJavaMethod().getParameterAnnotations()[entry.getKey()]; for (Annotation a: annotations) { if (Nullable.class.isAssignableFrom(a.annotationType()))