jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r1184944 - /jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java
Date Sun, 16 Oct 2011 22:06:16 GMT
Author: dbrosius
Date: Sun Oct 16 22:06:15 2011
New Revision: 1184944

URL: http://svn.apache.org/viewvc?rev=1184944&view=rev
Log:
getValue() returns a String[], so no need for the typechecking/casting

Modified:
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java?rev=1184944&r1=1184943&r2=1184944&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java
Sun Oct 16 22:06:15 2011
@@ -127,14 +127,10 @@ public class HrefProperty extends Abstra
     @Override
     public Element toXml(Document document) {
         Element elem = getName().toXml(document);
-        Object value = getValue();
+        String[] value = getValue();
         if (value != null) {
-            if (value instanceof String[]) {
-                for (String href : (String[]) value) {
-                    elem.appendChild(DomUtil.hrefToXml(href, document));
-                }
-            } else {
-                elem.appendChild(DomUtil.hrefToXml(value.toString(), document));
+            for (String href : value) {
+                elem.appendChild(DomUtil.hrefToXml(href, document));
             }
         }
         return elem;
@@ -160,4 +156,4 @@ public class HrefProperty extends Abstra
     public List<String> getHrefs() {
         return (value != null) ? Arrays.asList(value) : new ArrayList<String>();
     }
-}
\ No newline at end of file
+}



Mime
View raw message