jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1213722 - /jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/util/LinkHeaderFieldParser.java
Date Tue, 13 Dec 2011 14:45:14 GMT
Author: angela
Date: Tue Dec 13 14:45:14 2011
New Revision: 1213722

URL: http://svn.apache.org/viewvc?rev=1213722&view=rev
Log:
minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/util/LinkHeaderFieldParser.java

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/util/LinkHeaderFieldParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/util/LinkHeaderFieldParser.java?rev=1213722&r1=1213721&r2=1213722&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/util/LinkHeaderFieldParser.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/util/LinkHeaderFieldParser.java
Tue Dec 13 14:45:14 2011
@@ -39,31 +39,27 @@ public class LinkHeaderFieldParser {
     /**
      * the default logger
      */
-    private static Logger log = LoggerFactory
-            .getLogger(LinkHeaderFieldParser.class);
+    private static Logger log = LoggerFactory.getLogger(LinkHeaderFieldParser.class);
 
     private final List<LinkRelation> relations;
 
     public LinkHeaderFieldParser(List<String> fieldValues) {
-
         List<LinkRelation> tmp = new ArrayList<LinkRelation>();
-
-        for (String s : fieldValues) {
-            addFields(tmp, s);
+        if (fieldValues != null) {
+            for (String value : fieldValues) {
+                addFields(tmp, value);
+            }
         }
-
         relations = Collections.unmodifiableList(tmp);
     }
 
     public LinkHeaderFieldParser(Enumeration<?> en) {
-
-        if (en.hasMoreElements()) {
+        if (en != null && en.hasMoreElements()) {
             List<LinkRelation> tmp = new ArrayList<LinkRelation>();
 
             while (en.hasMoreElements()) {
                 addFields(tmp, en.nextElement().toString());
             }
-
             relations = Collections.unmodifiableList(tmp);
         } else {
             // optimize case of no Link headers



Mime
View raw message