commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1165054 - /commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/web/servlet/ServletHeaderValuesMap.java
Date Sun, 04 Sep 2011 15:53:06 GMT
Author: simonetripodi
Date: Sun Sep  4 15:53:06 2011
New Revision: 1165054

URL: http://svn.apache.org/viewvc?rev=1165054&view=rev
Log:
muted ServletContext.getHeaderNames() warnings, it is known that header names are String
        

Modified:
    commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/web/servlet/ServletHeaderValuesMap.java

Modified: commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/web/servlet/ServletHeaderValuesMap.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/web/servlet/ServletHeaderValuesMap.java?rev=1165054&r1=1165053&r2=1165054&view=diff
==============================================================================
--- commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/web/servlet/ServletHeaderValuesMap.java
(original)
+++ commons/proper/chain/branches/version-2.0-work/src/main/java/org/apache/commons/chain/web/servlet/ServletHeaderValuesMap.java
Sun Sep  4 15:53:06 2011
@@ -84,10 +84,12 @@ final class ServletHeaderValuesMap imple
 
     public Set<Entry<String, String[]>> entrySet() {
         Set<Entry<String, String[]>> set = new HashSet<Entry<String, String[]>>();
+        @SuppressWarnings( "unchecked" ) // it is known that header names are String
         Enumeration<String> keys = request.getHeaderNames();
         String key;
         while (keys.hasMoreElements()) {
             key = keys.nextElement();
+            @SuppressWarnings( "unchecked" ) // it is known that header values are String
             Enumeration<String> values = request.getHeaders(key);
             String[] valuesArray = enumerationToArray(values);
             /* Previously the API was returning an Set<Entry<String, Enumeration<String>>
@@ -106,6 +108,7 @@ final class ServletHeaderValuesMap imple
 
 
     public String[] get(Object key) {
+        @SuppressWarnings( "unchecked" ) // it is known that header names are String
         Enumeration<String> values = request.getHeaders(key(key));
         String[] valuesArray = enumerationToArray(values);
 
@@ -125,6 +128,7 @@ final class ServletHeaderValuesMap imple
 
     public Set<String> keySet() {
         Set<String> set = new HashSet<String>();
+        @SuppressWarnings( "unchecked" ) // it is known that header names are String
         Enumeration<String> keys = request.getHeaderNames();
         while (keys.hasMoreElements()) {
             set.add(keys.nextElement());
@@ -150,7 +154,8 @@ final class ServletHeaderValuesMap imple
 
     public int size() {
         int n = 0;
-        Enumeration keys = request.getHeaderNames();
+        @SuppressWarnings( "unchecked" ) // it is known that header names are String
+        Enumeration<String> keys = request.getHeaderNames();
         while (keys.hasMoreElements()) {
             keys.nextElement();
             n++;
@@ -161,9 +166,11 @@ final class ServletHeaderValuesMap imple
 
     public Collection<String[]> values() {
         List<String[]> list = new ArrayList<String[]>();
+        @SuppressWarnings( "unchecked" ) // it is known that header names are String
         Enumeration<String> keys = request.getHeaderNames();
         while (keys.hasMoreElements()) {
             String key = keys.nextElement();
+            @SuppressWarnings( "unchecked" ) // it is known that header values are String
             Enumeration<String> values = request.getHeaders(key);
             String[] valuesArray = enumerationToArray(values);
             list.add(valuesArray);



Mime
View raw message