Make dry run parameter documentation more understandable

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162373834
This commit is contained in:
mcilwain 2017-07-18 10:58:01 -07:00 committed by Ben McIlwain
parent 882db28ee0
commit b671dd6451

View file

@ -128,15 +128,14 @@ public final class RequestParameters {
} }
/** /**
* Returns {@code true} if parameter is present and not empty and not {@code "false"}. * Returns {@code true} iff the given parameter is present, not empty, and not {@code "false"}.
* *
* <p>This considers a parameter with a non-existent value true, for situations where the request * <p>This considers a parameter with a non-existent value true, for situations where the request
* URI is something like {@code /foo?bar}, where the mere presence of the {@code bar} parameter * URI is something like {@code /foo?bar}, where the mere presence of the {@code bar} parameter
* without a value indicates that it's true. * without a value indicates that it's true.
*/ */
public static boolean extractBooleanParameter(HttpServletRequest req, String name) { public static boolean extractBooleanParameter(HttpServletRequest req, String name) {
return req.getParameterMap().containsKey(name) return req.getParameterMap().containsKey(name) && !equalsFalse(req.getParameter(name));
&& !equalsFalse(req.getParameter(name));
} }
/** /**