From 804fda60a74fd42c1405d75dfc68ffa95f959608 Mon Sep 17 00:00:00 2001 From: samskivert Date: Tue, 28 Jul 2009 01:28:13 +0000 Subject: [PATCH] getParameters() does not throw a DataValidationException. Also made methods return interfaces. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2600 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/servlet/util/ParameterUtil.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/java/com/samskivert/servlet/util/ParameterUtil.java b/src/java/com/samskivert/servlet/util/ParameterUtil.java index a62d4fb2..0b6c6f83 100644 --- a/src/java/com/samskivert/servlet/util/ParameterUtil.java +++ b/src/java/com/samskivert/servlet/util/ParameterUtil.java @@ -27,10 +27,12 @@ import java.util.Date; import java.util.Enumeration; import java.util.HashSet; import java.util.List; +import java.util.Set; import javax.servlet.http.HttpServletRequest; import com.samskivert.util.ArrayIntSet; +import com.samskivert.util.IntSet; import com.samskivert.util.StringUtil; /** @@ -135,11 +137,11 @@ public class ParameterUtil * IntSet. If the parameter does not exist or is not a well-formed integer, a data validation * exception is thrown with the supplied message. */ - public static ArrayIntSet getIntParameters ( + public static IntSet getIntParameters ( HttpServletRequest req, String name, String invalidDataMessage) throws DataValidationException { - ArrayIntSet ints = new ArrayIntSet(); + IntSet ints = new ArrayIntSet(); String[] values = req.getParameterValues(name); if (values != null) { for (int ii = 0; ii < values.length; ii++) { @@ -152,13 +154,11 @@ public class ParameterUtil } /** - * Fetches all the values from the request with the specified name and converts them to a - * HashSet. + * Fetches all the values from the request with the specified name and converts them to a Set. */ - public static HashSet getParameters (HttpServletRequest req, String name) - throws DataValidationException + public static Set getParameters (HttpServletRequest req, String name) { - HashSet set = new HashSet(); + Set set = new HashSet(); String[] values = req.getParameterValues(name); if (values != null) { for (int ii = 0; ii < values.length; ii++) {