allow null/missing for varargs params (needed e.g. for EC2 ElasticBlockStoreAsyncClient.describeVolumesInRegion)

This commit is contained in:
Alex Heneveld 2011-09-30 11:49:50 +01:00
parent 70d58180e0
commit f59d1fec0b
1 changed files with 4 additions and 0 deletions

View File

@ -969,6 +969,10 @@ public class RestAnnotationProcessor<T> {
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()))