Changed some style/readability issues that bugged me.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1638 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2005-04-22 23:36:53 +00:00
parent 0c0486bb13
commit 14ea28dd8a
@@ -133,31 +133,33 @@ public class ParameterUtil
HttpServletRequest req, String name, String invalidDataMessage) HttpServletRequest req, String name, String invalidDataMessage)
throws DataValidationException throws DataValidationException
{ {
String[] values = req.getParameterValues(name);
ArrayIntSet ints = new ArrayIntSet(); ArrayIntSet ints = new ArrayIntSet();
for (int ii = 0; values != null && ii < values.length; ii++) { String[] values = req.getParameterValues(name);
if (StringUtil.blank(values[ii])) { if (values != null) {
continue; for (int ii = 0; ii < values.length; ii++) {
if (!StringUtil.blank(values[ii])) {
ints.add(parseIntParameter(values[ii], invalidDataMessage));
}
} }
ints.add(parseIntParameter(values[ii], invalidDataMessage));
} }
return ints; return ints;
} }
/** /**
* Fetches all the values from the request with the specified name and * Fetches all the values from the request with the specified name and
* converts them HashSet. * converts them to a HashSet.
*/ */
public static HashSet getParameters (HttpServletRequest req, String name) public static HashSet getParameters (HttpServletRequest req, String name)
throws DataValidationException throws DataValidationException
{ {
String[] values = req.getParameterValues(name);
HashSet set = new HashSet(); HashSet set = new HashSet();
for (int ii = 0; values != null && ii < values.length; ii++) { String[] values = req.getParameterValues(name);
if (StringUtil.blank(values[ii])) { if (values != null) {
continue; for (int ii = 0; ii < values.length; ii++) {
if (!StringUtil.blank(values[ii])) {
set.add(values[ii]);
}
} }
set.add(values[ii]);
} }
return set; return set;
} }