Merge "Allow empty POSTs as OAuthRequests"

This commit is contained in:
Dave Borowitz 2018-03-28 18:58:27 +00:00 committed by Gerrit Code Review
commit 8a5c427c90

@ -839,10 +839,10 @@ public class RestApiServlet extends HttpServlet {
}
Object obj = createInstance(type);
Field[] fields = obj.getClass().getDeclaredFields();
if (fields.length == 0 && Strings.isNullOrEmpty(value)) {
if (Strings.isNullOrEmpty(value)) {
return obj;
}
Field[] fields = obj.getClass().getDeclaredFields();
for (Field f : fields) {
if (f.getAnnotation(DefaultInput.class) != null && f.getType() == String.class) {
f.setAccessible(true);