jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r314832 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java
Date Wed, 12 Oct 2005 09:14:25 GMT
Author: tripod
Date: Wed Oct 12 02:14:21 2005
New Revision: 314832

URL: http://svn.apache.org/viewcvs?rev=314832&view=rev
Log:
JCR-251 NullPointerException in VirtualNodeTypeStateManager.nodeTypeRegistered

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java?rev=314832&r1=314831&r2=314832&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java
Wed Oct 12 02:14:21 2005
@@ -123,16 +123,18 @@
      */
     public void nodeTypeRegistered(QName ntName) {
         try {
-            // allow provider to update
             if (virtProvider != null) {
+                // allow provider to update
                 virtProvider.onNodeTypeAdded(ntName);
             }
-
-            NodeImpl root = (NodeImpl) systemSession.getItemManager().getItem(new NodeId(rootNodeId));
-            NodeImpl child = root.getNode(ntName);
-            List events = new ArrayList();
-            recursiveAdd(events, root, child);
-            obsDispatcher.dispatch(events, systemSession);
+            if (systemSession != null) {
+                // generate observation events
+                NodeImpl root = (NodeImpl) systemSession.getItemManager().getItem(new NodeId(rootNodeId));
+                NodeImpl child = root.getNode(ntName);
+                List events = new ArrayList();
+                recursiveAdd(events, root, child);
+                obsDispatcher.dispatch(events, systemSession);
+            }
         } catch (RepositoryException e) {
             log.error("Unable to index new nodetype: " + e.toString());
         }
@@ -152,12 +154,16 @@
      */
     public void nodeTypeUnregistered(QName ntName) {
         try {
-            NodeImpl root = (NodeImpl) systemSession.getItemManager().getItem(new NodeId(rootNodeId));
-            NodeImpl child = root.getNode(ntName);
-            List events = new ArrayList();
-            recursiveRemove(events, root, child);
-            obsDispatcher.dispatch(events, systemSession);
+            if (systemSession != null) {
+                // generated observation events
+                NodeImpl root = (NodeImpl) systemSession.getItemManager().getItem(new NodeId(rootNodeId));
+                NodeImpl child = root.getNode(ntName);
+                List events = new ArrayList();
+                recursiveRemove(events, root, child);
+                obsDispatcher.dispatch(events, systemSession);
+            }
             if (virtProvider != null) {
+                // allow provider to update
                 virtProvider.onNodeTypeRemoved(ntName);
             }
         } catch (RepositoryException e) {



Mime
View raw message