1
0
mirror of https://github.com/google/nomulus synced 2026-01-09 15:43:52 +00:00

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
* URI is something like {@code /foo?bar}, where the mere presence of the {@code bar} parameter
* without a value indicates that it's true.
*/
public static boolean extractBooleanParameter(HttpServletRequest req, String name) {
return req.getParameterMap().containsKey(name)
&& !equalsFalse(req.getParameter(name));
return req.getParameterMap().containsKey(name) && !equalsFalse(req.getParameter(name));
}
/**