jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r385459 - /incubator/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
Date Mon, 13 Mar 2006 08:27:23 GMT
Author: angela
Date: Mon Mar 13 00:27:21 2006
New Revision: 385459

URL: http://svn.apache.org/viewcvs?rev=385459&view=rev
Log:
JCR-346: Jcr-Server: ItemDefinitionImpl.toXml throws NPE for the root

Modified:
    incubator/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java

Modified: incubator/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java?rev=385459&r1=385458&r2=385459&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
(original)
+++ incubator/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
Mon Mar 13 00:27:21 2006
@@ -101,8 +101,11 @@
      * @param document
      */
     public Element toXml(Document document) {
-	Element elem = document.createElement(getElementName());
-        elem.setAttribute(DECLARINGNODETYPE_ATTRIBUTE, getDeclaringNodeType().getName());
+        Element elem = document.createElement(getElementName());
+        NodeType dnt = getDeclaringNodeType();
+        if (dnt != null) {
+            elem.setAttribute(DECLARINGNODETYPE_ATTRIBUTE, dnt.getName());
+        }
         elem.setAttribute(NAME_ATTRIBUTE, getName());
         elem.setAttribute(AUTOCREATED_ATTRIBUTE, Boolean.toString(isAutoCreated()));
         elem.setAttribute(MANDATORY_ATTRIBUTE, Boolean.toString(isMandatory()));



Mime
View raw message