abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r432839 - in /incubator/abdera/java/trunk: parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
Date Sat, 19 Aug 2006 15:36:37 GMT
Author: rooneg
Date: Sat Aug 19 08:36:36 2006
New Revision: 432839

URL: http://svn.apache.org/viewvc?rev=432839&view=rev
Log:
More fun with FindBugs.

* parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
  (getXPath): Use Map.entrySet() when we need both the keys and values.

* server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
  (doOutput): Ditto.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java?rev=432839&r1=432838&r2=432839&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
Sat Aug 19 08:36:36 2006
@@ -41,9 +41,8 @@
     DocumentNavigator nav = new DocumentNavigator();
     XPath contextpath = new BaseXPath(path, nav);
     if (namespaces != null) {
-      for (String key : namespaces.keySet()) {
-        String value = namespaces.get(key);
-        contextpath.addNamespace(key, value);
+      for (Map.Entry<String, String> entry : namespaces.entrySet()) {
+        contextpath.addNamespace(entry.getKey(), entry.getValue());
       }
     }
     

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java?rev=432839&r1=432838&r2=432839&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
Sat Aug 19 08:36:36 2006
@@ -94,12 +94,12 @@
       // don't set them.
       Map<String, List<String>> headers = context.getHeaders();
       if (headers != null) {
-        for (String header : headers.keySet()) {
-          List<String> values = headers.get(header);
+        for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
+          List<String> values = entry.getValue();
           if (values == null) 
             continue;          
           for (String value : values) {
-            response.setHeader(header, value);
+            response.setHeader(entry.getKey(), value);
           }
         }
       }



Mime
View raw message