Issue 76: allow map binders to work without args in rare cases where there are no parameters, but a request body is needed

git-svn-id: http://jclouds.googlecode.com/svn/trunk@1833 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-07-23 09:11:39 +00:00
parent 2436c68578
commit 3571be7a16
1 changed files with 2 additions and 3 deletions

View File

@ -393,13 +393,12 @@ public class JaxrsAnnotationProcessor {
switch (request.getMethod()) { switch (request.getMethod()) {
case POST: case POST:
case PUT: case PUT:
MapEntityBinder mapBinder = null; MapEntityBinder mapBinder = getMapEntityBinderOrNull(method, args);
Map<String, String> mapParams = buildPostParams(method, args); Map<String, String> mapParams = buildPostParams(method, args);
// MapEntityBinder is only useful if there are parameters. We guard here in case the // MapEntityBinder is only useful if there are parameters. We guard here in case the
// MapEntityBinder is also an EntityBinder. If so, it can be used with or without // MapEntityBinder is also an EntityBinder. If so, it can be used with or without
// parameters. // parameters.
if (mapParams.size() > 0 if (mapBinder != null) {
&& (mapBinder = this.getMapEntityBinderOrNull(method, args)) != null) {
mapBinder.addEntityToRequest(mapParams, request); mapBinder.addEntityToRequest(mapParams, request);
break; break;
} }