jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r597424 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: hierarchy/HierarchyManagerImpl.java hierarchy/NodeEntryImpl.java state/WorkspaceItemStateFactory.java
Date Thu, 22 Nov 2007 15:19:35 GMT
Author: angela
Date: Thu Nov 22 07:19:34 2007
New Revision: 597424

URL: http://svn.apache.org/viewvc?rev=597424&view=rev
Log:
JCR-1231 - Unneeded call to getPropertyInfo upon creating a new NodeState

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManagerImpl.java?rev=597424&r1=597423&r2=597424&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManagerImpl.java
Thu Nov 22 07:19:34 2007
@@ -42,7 +42,8 @@
     private final UniqueIdResolver uniqueIdResolver;
     private final IdFactory idFactory;
 
-    public HierarchyManagerImpl(TransientItemStateFactory isf, IdFactory idFactory, PathFactory
pathFactory) {
+    public HierarchyManagerImpl(TransientItemStateFactory isf, IdFactory idFactory,
+                                PathFactory pathFactory) {
         uniqueIdResolver = new UniqueIdResolver(isf);
         rootEntry = new EntryFactory(isf, idFactory, uniqueIdResolver, pathFactory).createRootEntry();
         this.idFactory = idFactory;

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java?rev=597424&r1=597423&r2=597424&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
Thu Nov 22 07:19:34 2007
@@ -692,7 +692,7 @@
      */
     public PropertyEntry addPropertyEntry(Name propName) throws ItemExistsException {
         // TODO: check for existing prop.
-        return internalAddPropertyEntry(propName);
+        return internalAddPropertyEntry(propName, true);
     }
 
     /**
@@ -700,15 +700,16 @@
      * exists.
      *
      * @param propName
+     * @param notifySpecial
      * @return
      */
-    private PropertyEntry internalAddPropertyEntry(Name propName) {
+    private PropertyEntry internalAddPropertyEntry(Name propName, boolean notifySpecial)
{
         PropertyEntry entry = factory.createPropertyEntry(this, propName);
         properties.add(entry);
 
         // if property-name is jcr:uuid or jcr:mixin this affects this entry
         // and the attached nodeState.
-        if (StateUtility.isUuidOrMixin(propName)) {
+        if (notifySpecial && StateUtility.isUuidOrMixin(propName)) {
             notifyUUIDorMIXINModified(entry);
         }
         return entry;
@@ -727,7 +728,12 @@
         for (Iterator it = propNames.iterator(); it.hasNext();) {
             Name propName = (Name) it.next();
             if (!properties.contains(propName)) {
-                addPropertyEntry(propName);
+                // TODO: check again.
+                // addPropertyEntries is used by WorkspaceItemStateFactory upon
+                // creating a NodeState, in which case the uuid/mixins are set
+                // anyway and not need exists to explicitely load the corresponding
+                // property state in order to retrieve the values.
+                internalAddPropertyEntry(propName, false);
             }
         }
 
@@ -905,7 +911,7 @@
                 // added by some earlier 'add' event
                 HierarchyEntry child = lookupEntry(childEvent.getItemId(), childEvent.getPath());
                 if (child == null) {
-                    internalAddPropertyEntry(eventName);
+                    internalAddPropertyEntry(eventName, true);
                 } else {
                     child.reload(false, true);
                 }
@@ -923,7 +929,7 @@
                 child = lookupEntry(childEvent.getItemId(), childEvent.getPath());
                 if (child == null) {
                     // prop-Entry has not been loaded yet -> add propEntry
-                    internalAddPropertyEntry(eventName);
+                    internalAddPropertyEntry(eventName, true);
                 } else if (child.isAvailable()) {
                     // Reload data from server and try to merge them with the
                     // current session-state. if the latter is transiently

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java?rev=597424&r1=597423&r2=597424&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
Thu Nov 22 07:19:34 2007
@@ -258,6 +258,7 @@
 
         // now build the nodestate itself
         NodeState state = new NodeState(entry, info, this, definitionProvider);
+        state.setMixinTypeNames(info.getMixins());
 
         // update NodeEntry from the information present in the NodeInfo (prop entries)
         List propNames = new ArrayList();



Mime
View raw message