jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r921284 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
Date Wed, 10 Mar 2010 10:18:31 GMT
Author: angela
Date: Wed Mar 10 10:18:30 2010
New Revision: 921284

URL: http://svn.apache.org/viewvc?rev=921284&view=rev
Log:
minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java?rev=921284&r1=921283&r2=921284&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
Wed Mar 10 10:18:30 2010
@@ -354,7 +354,6 @@ public class SessionItemStateManager ext
         } else if (mixinEntry != null) {
             // remove the jcr:mixinTypes property state if already present
             PropertyState pState = mixinEntry.getPropertyState();
-            boolean newMixinState = pState.getStatus() == Status.NEW;
             int options = ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_VERSIONING;
             removeItemState(pState, options);
 
@@ -380,7 +379,8 @@ public class SessionItemStateManager ext
         Name[] mixins = nState.getMixinTypeNames();
         List<Name> all = new ArrayList<Name>(Arrays.asList(mixins));
         all.add(primaryName);
-        EffectiveNodeType entAll = entProvider.getEffectiveNodeType(all.toArray(new Name[all.size()]));
+        // retrieve effective to assert validity of arguments
+        entProvider.getEffectiveNodeType(all.toArray(new Name[all.size()]));
 
         // modify the value of the jcr:primaryType property entry without
         // changing the node state itself
@@ -485,9 +485,7 @@ public class SessionItemStateManager ext
         }
 
         // add 'auto-create' properties defined in node type
-        QPropertyDefinition[] pda = ent.getAutoCreateQPropertyDefinitions();
-        for (int i = 0; i < pda.length; i++) {
-            QPropertyDefinition pd = pda[i];
+        for (QPropertyDefinition pd : ent.getAutoCreateQPropertyDefinitions()) {
             if (!nodeState.hasPropertyName(pd.getName())) {
                 QValue[] autoValue = computeSystemGeneratedPropertyValues(nodeState, pd);
                 if (autoValue != null) {
@@ -499,9 +497,7 @@ public class SessionItemStateManager ext
         }
 
         // recursively add 'auto-create' child nodes defined in node type
-        QNodeDefinition[] nda = ent.getAutoCreateQNodeDefinitions();
-        for (int i = 0; i < nda.length; i++) {
-            QNodeDefinition nd = nda[i];
+        for (QNodeDefinition nd : ent.getAutoCreateQNodeDefinitions()) {
             // execute 'addNode' without adding the operation.
             int opt = ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_COLLISION;
             addedStates.addAll(addNodeState(nodeState, nd.getName(), nd.getDefaultPrimaryType(),
null, nd, opt));



Mime
View raw message