commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1211131 - /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/web/ServletRequestConfiguration.java
Date Tue, 06 Dec 2011 20:57:38 GMT
Author: oheger
Date: Tue Dec  6 20:57:37 2011
New Revision: 1211131

URL: http://svn.apache.org/viewvc?rev=1211131&view=rev
Log:
Java 1.5 compatibility: raw types, etc.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/web/ServletRequestConfiguration.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/web/ServletRequestConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/web/ServletRequestConfiguration.java?rev=1211131&r1=1211130&r2=1211131&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/web/ServletRequestConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/web/ServletRequestConfiguration.java
Tue Dec  6 20:57:37 2011
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.ServletRequest;
 
@@ -30,7 +31,7 @@ import javax.servlet.ServletRequest;
  * UnsupportedOperationException.
  *
  * @author <a href="mailto:ebourg@apache.org">Emmanuel Bourg</a>
- * @version $Revision$, $Date$
+ * @version $Id$
  * @since 1.1
  */
 public class ServletRequestConfiguration extends BaseWebConfiguration
@@ -63,13 +64,13 @@ public class ServletRequestConfiguration
         else
         {
             // ensure that escape characters in all list elements are removed
-            List result = new ArrayList(values.length);
+            List<Object> result = new ArrayList<Object>(values.length);
             for (int i = 0; i < values.length; i++)
             {
                 Object val = handleDelimiters(values[i]);
                 if (val instanceof Collection)
                 {
-                    result.addAll((Collection) val);
+                    result.addAll((Collection<?>) val);
                 }
                 else
                 {
@@ -80,8 +81,11 @@ public class ServletRequestConfiguration
         }
     }
 
-    public Iterator getKeys()
+    public Iterator<String> getKeys()
     {
-        return request.getParameterMap().keySet().iterator();
+        // According to the documentation of getParameterMap(), keys are Strings.
+        @SuppressWarnings("unchecked")
+        Map<String, ?> parameterMap = request.getParameterMap();
+        return parameterMap.keySet().iterator();
     }
 }



Mime
View raw message