jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r397820 - /jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
Date Fri, 28 Apr 2006 09:26:03 GMT
Author: angela
Date: Fri Apr 28 02:25:43 2006
New Revision: 397820

URL: http://svn.apache.org/viewcvs?rev=397820&view=rev
Log:
Serialization of DAVException: only create DAV:error if the given element does not represent
DAV:error itself

Modified:
    jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java

Modified: jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java?rev=397820&r1=397819&r2=397820&view=diff
==============================================================================
--- jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
(original)
+++ jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
Fri Apr 28 02:25:43 2006
@@ -150,8 +150,13 @@
      */
     public Element toXml(Document document) {
         if (hasErrorCondition()) {
-            Element error = DomUtil.createElement(document, XML_ERROR, DavConstants.NAMESPACE);
-            error.appendChild(document.importNode(errorCondition, true));
+            Element error;
+            if (DomUtil.matches(errorCondition, XML_ERROR, DavConstants.NAMESPACE)) {
+                error = (Element) document.importNode(errorCondition, true);
+            } else {
+                error = DomUtil.createElement(document, XML_ERROR, DavConstants.NAMESPACE);
+                error.appendChild(document.importNode(errorCondition, true));
+            }           
             return error;
         } else {
             return null;



Mime
View raw message