jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1164026 [10/11] - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ config/ hierarchy/ lock/ nodetype/ observation/ operation/ query/ security/ state/ util/ version/ xml/
Date Thu, 01 Sep 2011 11:52:13 GMT
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java Thu Sep  1 11:52:08 2011
@@ -16,13 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.state;
 
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.RepositoryException;
-
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
@@ -38,12 +32,17 @@ import org.apache.jackrabbit.spi.commons
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.RepositoryException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * <code>NodeState</code> represents the state of a <code>Node</code>.
  */
 public class NodeState extends ItemState {
-
-    private static Logger log = LoggerFactory.getLogger(NodeState.class);
+    private static final Logger log = LoggerFactory.getLogger(NodeState.class);
 
     /**
      * the name of this node's primary type
@@ -70,9 +69,9 @@ public class NodeState extends ItemState
      * @param definition
      * @param definitionProvider
      */
-    protected NodeState(NodeEntry entry, Name nodeTypeName, Name[] mixinTypeNames,
-                        ItemStateFactory isf, QNodeDefinition definition,
-                        ItemDefinitionProvider definitionProvider) {
+    protected NodeState(NodeEntry entry, Name nodeTypeName, Name[] mixinTypeNames, ItemStateFactory isf,
+            QNodeDefinition definition, ItemDefinitionProvider definitionProvider) {
+
         super(Status.NEW, entry, isf, definitionProvider);
         this.nodeTypeName = nodeTypeName;
         setMixinTypeNames(mixinTypeNames);
@@ -90,43 +89,32 @@ public class NodeState extends ItemState
     protected NodeState(NodeEntry entry, NodeInfo nInfo, ItemStateFactory isf,
                         ItemDefinitionProvider definitionProvider) {
         super(entry, isf, definitionProvider);
-        this.nodeTypeName = nInfo.getNodetype();
+        nodeTypeName = nInfo.getNodetype();
         setMixinTypeNames(nInfo.getMixins());
     }
 
     //----------------------------------------------------------< ItemState >---
+
     /**
      * Determines if this item state represents a node.
      *
      * @return always true
-     * @see ItemState#isNode
      */
     @Override
     public final boolean isNode() {
         return true;
     }
 
-    /**
-     * {@inheritDoc}
-     * @see ItemState#getId()
-     */
     @Override
     public ItemId getId() throws RepositoryException {
         return getNodeId();
     }
 
-    /**
-     * {@inheritDoc}
-     * @see ItemState#getWorkspaceId()
-     */
     @Override
     public ItemId getWorkspaceId() throws RepositoryException {
         return getNodeEntry().getWorkspaceId();
     }
 
-    /**
-     * @see ItemState#merge(ItemState, boolean)
-     */
     @Override
     public MergeResult merge(ItemState another, boolean keepChanges) {
         boolean modified = false;
@@ -159,11 +147,6 @@ public class NodeState extends ItemState
         return new SimpleMergeResult(modified);
     }
 
-    /**
-     * @see ItemState#revert()
-     * @return Always returns false unless the definition has been modified
-     * along with a move operation.
-     */
     @Override
     public boolean revert() {
         // TODO: ev. reset the 'markModified' flag
@@ -183,6 +166,7 @@ public class NodeState extends ItemState
     }
 
     //----------------------------------------------------------< NodeState >---
+
     /**
      * @return The <code>NodeEntry</code> associated with this state.
      */
@@ -358,7 +342,7 @@ public class NodeState extends ItemState
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    public NodeState getChildNodeState(Name nodeName, int index) throws ItemNotFoundException, RepositoryException {
+    public NodeState getChildNodeState(Name nodeName, int index) throws RepositoryException {
         NodeEntry ne = getNodeEntry().getNodeEntry(nodeName, index, true);
         if (ne != null) {
             return ne.getNodeState();
@@ -393,7 +377,7 @@ public class NodeState extends ItemState
      * @see NodeEntry#getPropertyEntry(Name, boolean)
      * @see PropertyEntry#getPropertyState()
      */
-    public PropertyState getPropertyState(Name propertyName) throws ItemNotFoundException, RepositoryException {
+    public PropertyState getPropertyState(Name propertyName) throws RepositoryException {
         PropertyEntry pe = getNodeEntry().getPropertyEntry(propertyName, true);
         if (pe != null) {
             return pe.getPropertyState();
@@ -414,9 +398,9 @@ public class NodeState extends ItemState
      * <code>beforeNode</code> is not a child node of this <code>NodeState</code>.
      */
     synchronized void reorderChildNodeEntries(NodeState insertNode, NodeState beforeNode)
-        throws ItemNotFoundException, RepositoryException {
+        throws RepositoryException {
 
-        NodeEntry before = (beforeNode == null) ? null : beforeNode.getNodeEntry();
+        NodeEntry before = beforeNode == null ? null : beforeNode.getNodeEntry();
         insertNode.getNodeEntry().orderBefore(before);
 
         // mark this state as modified
@@ -434,8 +418,9 @@ public class NodeState extends ItemState
      * @throws RepositoryException if the given child state is not a child
      * of this node state.
      */
-    synchronized void moveChildNodeEntry(NodeState newParent, NodeState childState,
-                                         Name newName, QNodeDefinition newDefinition)
+    synchronized void moveChildNodeEntry(NodeState newParent, NodeState childState, Name newName,
+            QNodeDefinition newDefinition)
+
         throws RepositoryException {
         // move child entry
         childState.getNodeEntry().move(newName, newParent.getNodeEntry(), true);
@@ -452,16 +437,14 @@ public class NodeState extends ItemState
         if (isRoot()) {
             def = definitionProvider.getRootNodeDefinition();
         } else {
-            /*
-             Don't use getAllNodeTypeNames() to retrieve the definition:
-             for NEW-states the definition is always set upon creation.
-             for all other states the definition must be retrieved only taking
-             the effective nodetypes present on the parent into account
-             any kind of transiently added mixins must not have an effect
-             on the definition retrieved for an state that has been persisted
-             before. The effective NT must be evaluated as if it had been
-             evaluated upon creating the workspace state.
-             */
+            // Don't use getAllNodeTypeNames() to retrieve the definition:
+            // for NEW -states the definition is always set upon creation.
+            // for all other states the definition must be retrieved only taking
+            // the effective nodetypes present on the parent into account
+            // any kind of transiently added mixins must not have an effect
+            // on the definition retrieved for an state that has been persisted
+            // before. The effective NT must be evaluated as if it had been
+            // evaluated upon creating the workspace state.
             NodeState parent = getParent();
             NodeId wspId = (NodeId) getWorkspaceId();
             def = definitionProvider.getQNodeDefinition(parent.getNodeTypeNames(), getName(), getNodeTypeName(), wspId);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java Thu Sep  1 11:52:08 2011
@@ -16,11 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.state;
 
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.ValueFormatException;
-import javax.jcr.nodetype.ConstraintViolationException;
-
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
 import org.apache.jackrabbit.spi.ItemId;
@@ -31,12 +27,16 @@ import org.apache.jackrabbit.spi.commons
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.ValueFormatException;
+import javax.jcr.nodetype.ConstraintViolationException;
+
 /**
  * <code>PropertyState</code> represents the state of a <code>Property</code>.
  */
 public class PropertyState extends ItemState {
-
-    private static Logger log = LoggerFactory.getLogger(PropertyState.class);
+    private static final Logger log = LoggerFactory.getLogger(PropertyState.class);
 
     /**
      * Property definition
@@ -67,13 +67,11 @@ public class PropertyState extends ItemS
      * @param definition
      * @param definitionProvider
      */
-    protected PropertyState(PropertyEntry entry, ItemStateFactory isf,
-                            QPropertyDefinition definition,
-                            ItemDefinitionProvider definitionProvider,
-                            QValue[] values, int propertyType)
-            throws ConstraintViolationException, RepositoryException {
+    protected PropertyState(PropertyEntry entry, ItemStateFactory isf, QPropertyDefinition definition,
+            ItemDefinitionProvider definitionProvider, QValue[] values, int propertyType) throws RepositoryException {
+
         super(Status.NEW, entry, isf, definitionProvider);
-        this.multiValued = definition.isMultiple();
+        multiValued = definition.isMultiple();
         this.definition = definition;
         setValues(values, propertyType);
     }
@@ -86,40 +84,32 @@ public class PropertyState extends ItemS
      * @param isf
      * @param definitionProvider
      */
-    protected PropertyState(PropertyEntry entry, PropertyInfo pInfo,
-                            ItemStateFactory isf,
-                            ItemDefinitionProvider definitionProvider) {
+    protected PropertyState(PropertyEntry entry, PropertyInfo pInfo, ItemStateFactory isf,
+            ItemDefinitionProvider definitionProvider) {
+
         super(entry, isf, definitionProvider);
-        this.multiValued = pInfo.isMultiValued();
-        this.data = new PropertyData(pInfo);
-        this.transientData = null;
+        multiValued = pInfo.isMultiValued();
+        data = new PropertyData(pInfo);
+        transientData = null;
     }
 
     //----------------------------------------------------------< ItemState >---
+
     /**
      * Always returns false.
      *
      * @return always false
-     * @see ItemState#isNode
      */
     @Override
     public boolean isNode() {
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @see ItemState#getId()
-     */
     @Override
     public ItemId getId() throws RepositoryException {
         return ((PropertyEntry) getHierarchyEntry()).getId();
     }
 
-    /**
-     * {@inheritDoc}
-     * @see ItemState#getWorkspaceId()
-     */
     @Override
     public ItemId getWorkspaceId() throws RepositoryException {
         return ((PropertyEntry) getHierarchyEntry()).getWorkspaceId();
@@ -131,7 +121,6 @@ public class PropertyState extends ItemS
      * persistent state is different to the stored persistent values. Otherwise
      * the transient changes will be discarded.
      *
-     * @see ItemState#merge(ItemState, boolean)
      */
     @Override
     public MergeResult merge(ItemState another, boolean keepChanges) {
@@ -143,7 +132,7 @@ public class PropertyState extends ItemS
             PropertyDiffer result = new PropertyDiffer(data, ((PropertyState) another).data);
 
             // reset the pInfo to point to the pInfo of another state.
-            this.data = ((PropertyState) another).data;
+            data = ((PropertyState) another).data;
             // if transient changes should be preserved OR if there are not
             // transient changes, return the differ and postpone the effort of
             // calculating the diff (the test if this state got internally changed)).
@@ -159,10 +148,6 @@ public class PropertyState extends ItemS
         return new SimpleMergeResult(modified);
     }
 
-    /**
-     * @see ItemState#revert()
-     * @return true if
-     */
     @Override
     public boolean revert() {
         if (getStatus() == Status.NEW) {
@@ -178,6 +163,7 @@ public class PropertyState extends ItemS
     }
 
     //------------------------------------------------------< PropertyState >---
+
     /**
      * Returns the type of the property value(s).
      *
@@ -188,7 +174,7 @@ public class PropertyState extends ItemS
      * type if the latter is {@link PropertyType#UNDEFINED}.
      */
     public int getType() {
-        return (transientData == null) ? data.type : transientData.type;
+        return transientData == null ? data.type : transientData.type;
     }
 
     /**
@@ -210,17 +196,16 @@ public class PropertyState extends ItemS
      */
     public QPropertyDefinition getDefinition() throws RepositoryException {
         if (definition == null) {
-            /*
-            Don't pass 'all-node types from parent':
-            for NEW-states the definition is always set upon creation.
-            for all other states the definition must be retrieved only taking
-            the effective node types present on the parent into account
-            any kind of transiently added mixins must not have an effect
-            on the definition retrieved for an state that has been persisted
-            before. The effective NT must be evaluated as if it had been
-            evaluated upon creating the workspace state.
-            */
-            definition = definitionProvider.getQPropertyDefinition(getParent().getNodeTypeNames(), getName(), getType(), multiValued, ((PropertyEntry) getHierarchyEntry()).getWorkspaceId());
+            // Don't pass 'all-node types from parent':
+            // for NEW -states the definition is always set upon creation.
+            // for all other states the definition must be retrieved only taking
+            // the effective node types present on the parent into account
+            // any kind of transiently added mixins must not have an effect
+            // on the definition retrieved for an state that has been persisted
+            // before. The effective NT must be evaluated as if it had been
+            // evaluated upon creating the workspace state.
+            definition = definitionProvider.getQPropertyDefinition(getParent().getNodeTypeNames(), getName(), getType(),
+                    multiValued, ((PropertyEntry) getHierarchyEntry()).getWorkspaceId());
         }
         return definition;
     }
@@ -232,7 +217,7 @@ public class PropertyState extends ItemS
      */
     public QValue[] getValues() {
         // if transientData are null the data MUST be present (ev. add check)
-        return (transientData == null) ? data.values : transientData.values;
+        return transientData == null ? data.values : transientData.values;
     }
 
     /**
@@ -278,6 +263,7 @@ public class PropertyState extends ItemS
     }
 
     //------------------------------------------------------------< private >---
+
     /**
      * Checks whether the given property parameters are consistent and satisfy
      * the constraints specified by the given definition. The following
@@ -299,13 +285,14 @@ public class PropertyState extends ItemS
      * @throws RepositoryException If another error occurs.
      */
     private static void validate(QValue[] values, int propertyType, QPropertyDefinition definition)
-        throws ConstraintViolationException, RepositoryException {
+            throws RepositoryException {
+
         if (propertyType == PropertyType.UNDEFINED) {
             throw new RepositoryException("'Undefined' is not a valid property type for existing values.");
         }
-        for (int i = 0; i < values.length; i++) {
-            if (values[i] != null && propertyType != values[i].getType()) {
-                throw new ConstraintViolationException("Inconsistent value types: Required type = " + PropertyType.nameFromValue(propertyType) + "; Found value with type = " + PropertyType.nameFromValue(values[i].getType()));
+        for (QValue value : values) {
+            if (value != null && propertyType != value.getType()) {
+                throw new ConstraintViolationException("Inconsistent value types: Required type = " + PropertyType.nameFromValue(propertyType) + "; Found value with type = " + PropertyType.nameFromValue(value.getType()));
             }
         }
         if (definition.getRequiredType() != PropertyType.UNDEFINED && definition.getRequiredType() != propertyType) {
@@ -330,21 +317,22 @@ public class PropertyState extends ItemS
 
         QValue[] vs1 = p1.values;
         QValue[] vs2 = p2.values;
-        if (vs1.length != vs2.length) {
-            return true;
-        } else {
+        if (vs1.length == vs2.length) {
             for (int i = 0; i < vs1.length; i++) {
-                boolean eq = (vs1[i] == null) ? vs2[i] == null : vs1[i].equals(vs2[i]);
+                boolean eq = vs1[i] == null ? vs2[i] == null : vs1[i].equals(vs2[i]);
                 if (!eq) {
                     return true;
                 }
             }
+        } else {
+            return true;
         }
         // no difference
         return false;
     }
 
     //--------------------------------------------------------< inner class >---
+
     /**
      * Inner class storing property values and their type.
      */
@@ -354,15 +342,15 @@ public class PropertyState extends ItemS
         private boolean discarded;
 
         private PropertyData(PropertyInfo pInfo) {
-            this.type = pInfo.getType();
-            this.values = pInfo.getValues();
+            type = pInfo.getType();
+            values = pInfo.getValues();
         }
 
-        private PropertyData(int type, QValue[] values, QPropertyDefinition definition) throws ConstraintViolationException, RepositoryException {
+        private PropertyData(int type, QValue[] values, QPropertyDefinition definition) throws RepositoryException {
             setValues(type, values, definition);
         }
 
-        private void setValues(int type, QValue[] values, QPropertyDefinition definition) throws ConstraintViolationException, RepositoryException {
+        private void setValues(int type, QValue[] values, QPropertyDefinition definition) throws RepositoryException {
             // make sure the arguments are consistent and do not violate the
             // given property definition.
             validate(values, type, definition);
@@ -370,16 +358,16 @@ public class PropertyState extends ItemS
             // -> see JCR-2880
 
             this.type = type;
-            this.values = (values == null) ? QValue.EMPTY_ARRAY : values;
+            this.values = values == null ? QValue.EMPTY_ARRAY : values;
         }
 
         private void discardValues() {
             if (!discarded && values != null) {
-                for (int i = 0; i < values.length; i++) {
-                    if (values[i] != null) {
+                for (QValue value : values) {
+                    if (value != null) {
                         // make sure temporarily allocated data is discarded
                         // before overwriting it (see QValue#discard())
-                        values[i].discard();
+                        value.discard();
                     }
                 }
                 discarded = true;
@@ -391,26 +379,29 @@ public class PropertyState extends ItemS
      * Helper class for delayed determination of property differences.
      */
     private static class PropertyDiffer implements MergeResult {
-
         private final PropertyData oldData;
         private final PropertyData newData;
 
         PropertyDiffer(PropertyData oldData, PropertyData newData) {
-            super();
             this.oldData = oldData;
             this.newData = newData;
         }
 
+        @Override
         public boolean modified() {
             if (oldData.discarded || newData.discarded) {
                 // cannot calculate the diff any more -> return true.
-                String msg = " Diff cannot be calculated: " + ((oldData.discarded) ? "Old property data" : "New property data") + " have already been discarded.";
+                String msg = " Diff cannot be calculated: " + (oldData.discarded
+                    ? "Old property data"
+                    : "New property data") + " have already been discarded.";
+
                 log.debug(msg);
                 return true;
             }
             return diff(oldData, newData);
         }
 
+        @Override
         public void dispose() {
             oldData.discardValues();
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java Thu Sep  1 11:52:08 2011
@@ -68,8 +68,7 @@ import org.slf4j.LoggerFactory;
  * <code>SessionItemStateManager</code> ...
  */
 public class SessionItemStateManager extends TransientOperationVisitor implements UpdatableItemStateManager {
-
-    private static Logger log = LoggerFactory.getLogger(SessionItemStateManager.class);
+    private static final Logger log = LoggerFactory.getLogger(SessionItemStateManager.class);
 
     /**
      * State manager that allows updates
@@ -96,13 +95,11 @@ public class SessionItemStateManager ext
      * @param isf
      * @param mgrProvider
      */
-    public SessionItemStateManager(UpdatableItemStateManager workspaceItemStateMgr,
-                                   ItemStateValidator validator,
-                                   QValueFactory qValueFactory,
-                                   ItemStateFactory isf, SessionImpl mgrProvider) {
+    public SessionItemStateManager(UpdatableItemStateManager workspaceItemStateMgr, ItemStateValidator validator,
+            QValueFactory qValueFactory, ItemStateFactory isf, SessionImpl mgrProvider) {
 
         this.workspaceItemStateMgr = workspaceItemStateMgr;
-        this.transientStateMgr = new TransientItemStateManager();
+        transientStateMgr = new TransientItemStateManager();
         isf.addCreationListener(transientStateMgr);
 
         this.validator = validator;
@@ -125,8 +122,7 @@ public class SessionItemStateManager ext
      *
      * @param state the root state of the update operation
      */
-    public void save(ItemState state) throws ReferentialIntegrityException,
-            InvalidItemStateException, RepositoryException {
+    public void save(ItemState state) throws RepositoryException {
         // shortcut, if no modifications are present
         if (!transientStateMgr.hasPendingChanges()) {
             return;
@@ -134,7 +130,7 @@ public class SessionItemStateManager ext
         // collect the changes to be saved
         ChangeLog changeLog = transientStateMgr.getChangeLog(state, true);
         if (!changeLog.isEmpty()) {
-            // only pass changelog if there are transient modifications available
+            // only pass change log if there are transient modifications available
             // for the specified item and its descendants.
             workspaceItemStateMgr.execute(changeLog);
             // remove states and operations just processed from the transient ISM
@@ -154,16 +150,16 @@ public class SessionItemStateManager ext
      * and descendant items is not a closed set of changes. That is, at least
      * another item needs to be canceled as well in another sub-tree.
      */
-    public void undo(ItemState itemState) throws ConstraintViolationException, RepositoryException {
+    public void undo(ItemState itemState) throws RepositoryException {
         // short cut
         if (!transientStateMgr.hasPendingChanges()) {
             return;
         }
         ChangeLog changeLog = transientStateMgr.getChangeLog(itemState, false);
         if (!changeLog.isEmpty()) {
-            // let changelog revert all changes
+            // let change log revert all changes
             changeLog.undo();
-            // remove transient states and related operations from the t-statemanager
+            // remove transient states and related operations from the state manager
             transientStateMgr.dispose(changeLog);
             changeLog.reset();
         }
@@ -177,7 +173,7 @@ public class SessionItemStateManager ext
      * @throws ConstraintViolationException
      * @throws RepositoryException
      */
-    public void adjustReferences(ReferenceChangeTracker refTracker) throws ConstraintViolationException, RepositoryException {
+    public void adjustReferences(ReferenceChangeTracker refTracker) throws RepositoryException {
         Iterator<PropertyState> it = refTracker.getReferences();
         while (it.hasNext()) {
             PropertyState propState = it.next();
@@ -207,26 +203,18 @@ public class SessionItemStateManager ext
     }
 
     //------------------------------------------< UpdatableItemStateManager >---
-    /**
-     * {@inheritDoc}
-     * @see UpdatableItemStateManager#execute(Operation)
-     */
+
+    @Override
     public void execute(Operation operation) throws RepositoryException {
         operation.accept(this);
     }
 
-    /**
-     * {@inheritDoc}
-     * @see UpdatableItemStateManager#execute(ChangeLog)
-     */
+    @Override
     public void execute(ChangeLog changes) throws RepositoryException {
         throw new UnsupportedOperationException("Not implemented for SessionItemStateManager");
     }
 
-    /**
-     * {@inheritDoc}
-     * @see UpdatableItemStateManager#dispose()
-     */
+    @Override
     public void dispose() {
         // discard all transient changes
         transientStateMgr.dispose();
@@ -235,23 +223,29 @@ public class SessionItemStateManager ext
     }
 
     //---------------------------------------------------< OperationVisitor >---
+
     /**
      * @see OperationVisitor#visit(AddNode)
      */
-    public void visit(AddNode operation) throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+    @Override
+    public void visit(AddNode operation) throws RepositoryException {
         NodeState parent = operation.getParentState();
         ItemDefinitionProvider defProvider = mgrProvider.getItemDefinitionProvider();
-        QNodeDefinition def = defProvider.getQNodeDefinition(parent.getAllNodeTypeNames(), operation.getNodeName(), operation.getNodeTypeName());
-        List<ItemState> newStates = addNodeState(parent, operation.getNodeName(), operation.getNodeTypeName(), operation.getUuid(), def, operation.getOptions());
-        operation.addedState(newStates);
+        QNodeDefinition def = defProvider.getQNodeDefinition(parent.getAllNodeTypeNames(), operation.getNodeName(),
+                operation.getNodeTypeName());
+
+        List<ItemState> newStates = addNodeState(parent, operation.getNodeName(), operation.getNodeTypeName(),
+                operation.getUuid(), def, operation.getOptions());
 
+        operation.addedState(newStates);
         transientStateMgr.addOperation(operation);
     }
 
     /**
      * @see OperationVisitor#visit(AddProperty)
      */
-    public void visit(AddProperty operation) throws ValueFormatException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+    @Override
+    public void visit(AddProperty operation) throws RepositoryException {
         NodeState parent = operation.getParentState();
         Name propertyName = operation.getPropertyName();
         QPropertyDefinition pDef = operation.getDefinition();
@@ -264,15 +258,14 @@ public class SessionItemStateManager ext
         }
 
         addPropertyState(parent, propertyName, targetType, operation.getValues(), pDef, operation.getOptions());
-
         transientStateMgr.addOperation(operation);
     }
 
     /**
      * @see OperationVisitor#visit(Move)
      */
-    public void visit(Move operation) throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
-
+    @Override
+    public void visit(Move operation) throws RepositoryException {
         // retrieve states and assert they are modifiable
         NodeState srcState = operation.getSourceState();
         NodeState srcParent = operation.getSourceParentState();
@@ -297,7 +290,8 @@ public class SessionItemStateManager ext
     /**
      * @see OperationVisitor#visit(Remove)
      */
-    public void visit(Remove operation) throws ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+    @Override
+    public void visit(Remove operation) throws RepositoryException {
         ItemState state = operation.getRemoveState();
         removeItemState(state, operation.getOptions());
 
@@ -308,8 +302,9 @@ public class SessionItemStateManager ext
     /**
      * @see OperationVisitor#visit(SetMixin)
      */
-    public void visit(SetMixin operation) throws ConstraintViolationException, AccessDeniedException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
-        // NOTE: nodestate is only modified upon save of the changes!
+    @Override
+    public void visit(SetMixin operation) throws RepositoryException {
+        // NOTE: node state is only modified upon save of the changes!
         Name[] mixinNames = operation.getMixinNames();
         NodeState nState = operation.getNodeState();
         NodeEntry nEntry = nState.getNodeEntry();
@@ -326,7 +321,9 @@ public class SessionItemStateManager ext
             } else {
                 // create new jcr:mixinTypes property
                 ItemDefinitionProvider defProvider = mgrProvider.getItemDefinitionProvider();
-                QPropertyDefinition pd = defProvider.getQPropertyDefinition(nState.getAllNodeTypeNames(), NameConstants.JCR_MIXINTYPES, PropertyType.NAME, true);
+                QPropertyDefinition pd = defProvider.getQPropertyDefinition(nState.getAllNodeTypeNames(),
+                        NameConstants.JCR_MIXINTYPES, PropertyType.NAME, true);
+
                 QValue[] mixinValue = getQValues(mixinNames, qValueFactory);
                 addPropertyState(nState, pd.getName(), pd.getRequiredType(), mixinValue, pd, operation.getOptions());
             }
@@ -345,8 +342,9 @@ public class SessionItemStateManager ext
     /**
      * @see OperationVisitor#visit(SetPrimaryType)
      */
-    public void visit(SetPrimaryType operation) throws ConstraintViolationException, RepositoryException {
-        // NOTE: nodestate is only modified upon save of the changes!
+    @Override
+    public void visit(SetPrimaryType operation) throws RepositoryException {
+        // NOTE: node state is only modified upon save of the changes!
         Name primaryName = operation.getPrimaryTypeName();
         NodeState nState = operation.getNodeState();
         NodeEntry nEntry = nState.getNodeEntry();
@@ -366,7 +364,8 @@ public class SessionItemStateManager ext
         // changing the node state itself
         PropertyEntry pEntry = nEntry.getPropertyEntry(NameConstants.JCR_PRIMARYTYPE);
         PropertyState pState = pEntry.getPropertyState();
-        setPropertyStateValue(pState, getQValues(new Name[] {primaryName}, qValueFactory), PropertyType.NAME, operation.getOptions());
+        setPropertyStateValue(pState, getQValues(new Name[] {primaryName}, qValueFactory), PropertyType.NAME,
+                operation.getOptions());
 
         // mark the affected node state modified and remember the operation
         nState.markModified();
@@ -376,7 +375,8 @@ public class SessionItemStateManager ext
     /**
      * @see OperationVisitor#visit(SetPropertyValue)
      */
-    public void visit(SetPropertyValue operation) throws ValueFormatException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+    @Override
+    public void visit(SetPropertyValue operation) throws RepositoryException {
         PropertyState pState = operation.getPropertyState();
         setPropertyStateValue(pState, operation.getValues(), operation.getValueType(), operation.getOptions());
         transientStateMgr.addOperation(operation);
@@ -385,7 +385,8 @@ public class SessionItemStateManager ext
     /**
      * @see OperationVisitor#visit(ReorderNodes)
      */
-    public void visit(ReorderNodes operation) throws ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+    @Override
+    public void visit(ReorderNodes operation) throws RepositoryException {
         NodeState parent = operation.getParentState();
         // modify the parent node state
         parent.reorderChildNodeEntries(operation.getInsertNode(), operation.getBeforeNode());
@@ -394,6 +395,7 @@ public class SessionItemStateManager ext
     }
 
     //--------------------------------------------< Internal State Handling >---
+
     /**
      *
      * @param parent
@@ -413,27 +415,22 @@ public class SessionItemStateManager ext
      * @throws VersionException
      * @throws RepositoryException
      */
-    private PropertyState addPropertyState(NodeState parent, Name propertyName,
-                                  int propertyType, QValue[] values,
-                                  QPropertyDefinition pDef, int options)
-            throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+    private PropertyState addPropertyState(NodeState parent, Name propertyName, int propertyType, QValue[] values,
+            QPropertyDefinition pDef, int options) throws RepositoryException {
 
         validator.checkAddProperty(parent, propertyName, pDef, options);
         // create property state
         return transientStateMgr.createNewPropertyState(propertyName, parent, pDef, values, propertyType);
     }
 
-    private List<ItemState> addNodeState(NodeState parent, Name nodeName, Name nodeTypeName,
-                              String uuid, QNodeDefinition definition, int options)
-            throws RepositoryException, ConstraintViolationException, AccessDeniedException,
-            UnsupportedRepositoryOperationException, NoSuchNodeTypeException,
-            ItemExistsException, VersionException {
+    private List<ItemState> addNodeState(NodeState parent, Name nodeName, Name nodeTypeName, String uuid,
+            QNodeDefinition definition, int options) throws RepositoryException {
 
         // check if add node is possible. note, that the options differ if
         // the 'addNode' is called from inside a regular add-node to create
         // autocreated child nodes that may be 'protected'.
         validator.checkAddNode(parent, nodeName, nodeTypeName, options);
-        // a new NodeState doesn't have mixins defined yet -> ent is ent of primarytype
+        // a new NodeState doesn't have mixins defined yet -> ent is ent of primary type
         EffectiveNodeType ent = mgrProvider.getEffectiveNodeTypeProvider().getEffectiveNodeType(nodeTypeName);
 
         if (nodeTypeName == null) {
@@ -456,7 +453,9 @@ public class SessionItemStateManager ext
         if (uuid != null) {
             QValue[] value = getQValues(uuid, qValueFactory);
             ItemDefinitionProvider defProvider = mgrProvider.getItemDefinitionProvider();
-            QPropertyDefinition pDef = defProvider.getQPropertyDefinition(NameConstants.MIX_REFERENCEABLE, NameConstants.JCR_UUID, PropertyType.STRING, false);
+            QPropertyDefinition pDef = defProvider.getQPropertyDefinition(NameConstants.MIX_REFERENCEABLE,
+                    NameConstants.JCR_UUID, PropertyType.STRING, false);
+
             addedStates.add(addPropertyState(nodeState, NameConstants.JCR_UUID, PropertyType.STRING, value, pDef, 0));
         }
 
@@ -467,7 +466,8 @@ public class SessionItemStateManager ext
                 if (autoValue != null) {
                     int propOptions = ItemStateValidator.CHECK_NONE;
                     // execute 'addProperty' without adding operation.
-                    addedStates.add(addPropertyState(nodeState, pd.getName(), pd.getRequiredType(), autoValue, pd, propOptions));
+                    addedStates.add(addPropertyState(nodeState, pd.getName(), pd.getRequiredType(), autoValue, pd,
+                            propOptions));
                 }
             }
         }
@@ -490,7 +490,7 @@ public class SessionItemStateManager ext
             success = true;
         } finally {
             if (!success) {
-                // TODO: TOBEFIXED undo state modifications
+                // TODO: undo state modifications
             }
         }
     }
@@ -511,7 +511,7 @@ public class SessionItemStateManager ext
      */
     private void setPropertyStateValue(PropertyState propState, QValue[] iva,
                                        int valueType, int options)
-        throws ValueFormatException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        throws RepositoryException {
         // assert that the property can be modified.
         validator.checkSetProperty(propState, options);
         propState.setValues(iva, valueType);
@@ -525,9 +525,9 @@ public class SessionItemStateManager ext
      * @param def
      * @return the computed values
      */
-    private QValue[] computeSystemGeneratedPropertyValues(NodeState parent,
-                                                          QPropertyDefinition def)
+    private QValue[] computeSystemGeneratedPropertyValues(NodeState parent, QPropertyDefinition def)
             throws RepositoryException {
+
         QValue[] genValues = null;
         QValue[] qDefaultValues = def.getDefaultValues();
         if (qDefaultValues != null && qDefaultValues.length > 0) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java Thu Sep  1 11:52:08 2011
@@ -39,22 +39,27 @@ public final class Status {
      * 'existing', i.e. persistent state
      */
     public static final int EXISTING = 1;
+
     /**
      * 'existing', i.e. persistent state that has been transiently modified (copy-on-write)
      */
     public static final int EXISTING_MODIFIED = 2;
+
     /**
      * 'existing', i.e. persistent state that has been transiently removed (copy-on-write)
      */
     public static final int EXISTING_REMOVED = 3;
+
     /**
      * 'new' state
      */
     public static final int NEW = 4;
+
     /**
      * 'existing', i.e. persistent state that has been persistently modified by somebody else
      */
     public static final int STALE_MODIFIED = 5;
+
     /**
      * 'existing', i.e. persistent state that has been destroyed by somebody else
      */
@@ -74,16 +79,8 @@ public final class Status {
      */
     public static final int REMOVED = 8;
 
-    private static final String[] STATUS_NAMES = new String[] {
-        "INVALIDATED",
-        "EXISTING",
-        "EXISTING_MODIFIED",
-        "EXISTING_REMOVED",
-        "NEW",
-        "STALE_MODIFIED",
-        "STALE_DESTROYED",
-        "MODIFIED",
-        "REMOVED"
+    private static final String[] STATUS_NAMES = new String[] {"INVALIDATED", "EXISTING", "EXISTING_MODIFIED",
+        "EXISTING_REMOVED", "NEW", "STALE_MODIFIED", "STALE_DESTROYED", "MODIFIED", "REMOVED"
     };
 
     /**
@@ -162,34 +159,35 @@ public final class Status {
         if (oldStatus == newStatus) {
             return true;
         }
-        boolean isValid = false;
+
         // valid status changes for session-states
+        boolean isValid = false;
         switch (newStatus) {
             case INVALIDATED:
-                isValid = (oldStatus == EXISTING); // invalidate
+                isValid = oldStatus == EXISTING; // invalidate
                 break;
             case EXISTING:
                 switch (oldStatus) {
-                    case INVALIDATED: /* refresh */
-                    case NEW: /* save */
-                    case EXISTING_MODIFIED: /* save, revert */
-                    case EXISTING_REMOVED:  /* revert */
-                    case STALE_MODIFIED:    /* revert */
+                    case INVALIDATED: // refresh
+                    case NEW: // save
+                    case EXISTING_MODIFIED: // save, revert
+                    case EXISTING_REMOVED:  // revert
+                    case STALE_MODIFIED:    // revert
                     case MODIFIED:
                         isValid = true;
                         break;
-                        /* REMOVED, STALE_DESTROYED -> false */
+                        // REMOVED, STALE_DESTROYED -> false
                 }
                 break;
             case EXISTING_MODIFIED:
-                isValid = (oldStatus == EXISTING);
+                isValid = oldStatus == EXISTING;
                 break;
             case EXISTING_REMOVED:
-                isValid = (oldStatus == EXISTING || oldStatus == EXISTING_MODIFIED);
+                isValid = oldStatus == EXISTING || oldStatus == EXISTING_MODIFIED;
                 break;
             case STALE_MODIFIED:
             case STALE_DESTROYED:
-                isValid = (oldStatus == EXISTING_MODIFIED || oldStatus == EXISTING_REMOVED || oldStatus == STALE_MODIFIED);
+                isValid = oldStatus == EXISTING_MODIFIED || oldStatus == EXISTING_REMOVED || oldStatus == STALE_MODIFIED;
                 break;
             case REMOVED:
                 // removal always possible -> getNewStatus(int, int)
@@ -201,8 +199,7 @@ public final class Status {
                     isValid = true;
                 }
                 break;
-                /* default:
-                    NEW cannot change state to NEW -> false */
+                // default: NEW cannot change state to NEW -> false 
         }
         return isValid;
     }
@@ -219,22 +216,22 @@ public final class Status {
     public static int getNewStatus(int oldStatus, int newStatusHint) {
         int newStatus;
         switch (newStatusHint) {
-            case Status.MODIFIED:
+            case MODIFIED:
                 // underlying state has been modified by external changes
-                if (oldStatus == Status.EXISTING || oldStatus == Status.INVALIDATED) {
+                if (oldStatus == EXISTING || oldStatus == INVALIDATED) {
                     // temporarily set the state to MODIFIED in order to inform listeners.
-                    newStatus = Status.MODIFIED;
-                } else if (oldStatus == Status.EXISTING_MODIFIED) {
-                    newStatus = Status.STALE_MODIFIED;
+                    newStatus = MODIFIED;
+                } else if (oldStatus == EXISTING_MODIFIED) {
+                    newStatus = STALE_MODIFIED;
                 } else {
                     // old status is EXISTING_REMOVED (or any other) => ignore.
                     // a NEW state may never be marked modified.
                     newStatus = oldStatus;
                 }
                 break;
-            case Status.REMOVED:
-                if (oldStatus == Status.EXISTING_MODIFIED || oldStatus == Status.STALE_MODIFIED) {
-                    newStatus = Status.STALE_DESTROYED;
+            case REMOVED:
+                if (oldStatus == EXISTING_MODIFIED || oldStatus == STALE_MODIFIED) {
+                    newStatus = STALE_DESTROYED;
                 } else {
                     // applies both to NEW or to any other status
                     newStatus = newStatusHint;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java Thu Sep  1 11:52:08 2011
@@ -39,9 +39,10 @@ import org.slf4j.LoggerFactory;
 /**
  * <code>TransientISFactory</code>...
  */
-public final class TransientISFactory extends AbstractItemStateFactory implements TransientItemStateFactory, ItemStateCreationListener  {
+public final class TransientISFactory extends AbstractItemStateFactory implements TransientItemStateFactory,
+        ItemStateCreationListener  {
 
-    private static Logger log = LoggerFactory.getLogger(TransientISFactory.class);
+    private static final Logger log = LoggerFactory.getLogger(TransientISFactory.class);
 
     private final ItemStateFactory workspaceStateFactory;
     private final ItemDefinitionProvider defProvider;
@@ -56,12 +57,9 @@ public final class TransientISFactory ex
     }
 
     //------------------------------------------< TransientItemStateFactory >---
-    /**
-     * @see TransientItemStateFactory#createNewNodeState(NodeEntry , Name, QNodeDefinition)
-     */
-    public NodeState createNewNodeState(NodeEntry entry, Name nodetypeName,
-                                        QNodeDefinition definition) {
 
+    @Override
+    public NodeState createNewNodeState(NodeEntry entry, Name nodetypeName, QNodeDefinition definition) {
         NodeState nodeState = new NodeState(entry, nodetypeName, Name.EMPTY_ARRAY, this, definition, defProvider);
 
         // notify listeners that a node state has been created
@@ -70,10 +68,10 @@ public final class TransientISFactory ex
         return nodeState;
     }
 
-    /**
-     * @see TransientItemStateFactory#createNewPropertyState(PropertyEntry, QPropertyDefinition, QValue[], int)
-     */
-    public PropertyState createNewPropertyState(PropertyEntry entry, QPropertyDefinition definition, QValue[] values, int propertyType) throws RepositoryException {
+    @Override
+    public PropertyState createNewPropertyState(PropertyEntry entry, QPropertyDefinition definition, QValue[] values,
+            int propertyType) throws RepositoryException {
+        
         PropertyState propState = new PropertyState(entry, this, definition, defProvider, values, propertyType);
         // notify listeners that a property state has been created
         notifyCreated(propState);
@@ -81,61 +79,60 @@ public final class TransientISFactory ex
     }
 
     //---------------------------------------------------< ItemStateFactory >---
+
     /**
      * @see ItemStateFactory#createRootState(NodeEntry)
      */
-    public NodeState createRootState(NodeEntry entry) throws ItemNotFoundException, RepositoryException {
-        NodeState state = workspaceStateFactory.createRootState(entry);
-        return state;
+    @Override
+    public NodeState createRootState(NodeEntry entry) throws RepositoryException {
+        return workspaceStateFactory.createRootState(entry);
     }
 
     /**
      * @see ItemStateFactory#createNodeState(NodeId,NodeEntry)
      */
-    public NodeState createNodeState(NodeId nodeId, NodeEntry entry)
-            throws ItemNotFoundException, RepositoryException {
-        NodeState state = workspaceStateFactory.createNodeState(nodeId, entry);
-        return state;
+    @Override
+    public NodeState createNodeState(NodeId nodeId, NodeEntry entry) throws RepositoryException {
+        return workspaceStateFactory.createNodeState(nodeId, entry);
     }
 
     /**
      * @see ItemStateFactory#createDeepNodeState(NodeId, NodeEntry)
      */
-    public NodeState createDeepNodeState(NodeId nodeId, NodeEntry anyParent)
-            throws ItemNotFoundException, RepositoryException {
-        NodeState state = workspaceStateFactory.createDeepNodeState(nodeId, anyParent);
-        return state;
+    @Override
+    public NodeState createDeepNodeState(NodeId nodeId, NodeEntry anyParent) throws RepositoryException {
+        return workspaceStateFactory.createDeepNodeState(nodeId, anyParent);
     }
 
     /**
      * @see ItemStateFactory#createPropertyState(PropertyId, PropertyEntry)
      */
-    public PropertyState createPropertyState(PropertyId propertyId,
-                                             PropertyEntry entry)
-            throws ItemNotFoundException, RepositoryException {
-        PropertyState state = workspaceStateFactory.createPropertyState(propertyId, entry);
-        return state;
+    @Override
+    public PropertyState createPropertyState(PropertyId propertyId, PropertyEntry entry) throws RepositoryException {
+        return workspaceStateFactory.createPropertyState(propertyId, entry);
 
     }
 
     /**
      * @see ItemStateFactory#createDeepPropertyState(PropertyId, NodeEntry)
      */
-    public PropertyState createDeepPropertyState(PropertyId propertyId, NodeEntry anyParent) throws ItemNotFoundException, RepositoryException {
-        PropertyState state = workspaceStateFactory.createDeepPropertyState(propertyId, anyParent);
-        return state;
+    @Override
+    public PropertyState createDeepPropertyState(PropertyId propertyId, NodeEntry anyParent) throws RepositoryException {
+        return workspaceStateFactory.createDeepPropertyState(propertyId, anyParent);
     }
 
     /**
      * @see ItemStateFactory#getChildNodeInfos(NodeId)
      */
-    public Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId) throws ItemNotFoundException, RepositoryException {
+    @Override
+    public Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId) throws RepositoryException {
         return workspaceStateFactory.getChildNodeInfos(nodeId);
     }
 
     /**
      * @see ItemStateFactory#getNodeReferences(NodeState,org.apache.jackrabbit.spi.Name,boolean)
      */
+    @Override
     public Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName, boolean weak) {
         if (nodeState.getStatus() == Status.NEW) {
             Set<PropertyId> t = Collections.emptySet();
@@ -145,9 +142,8 @@ public final class TransientISFactory ex
     }
 
     //------------------------------------------< ItemStateCreationListener >---
-    /**
-     * @see ItemStateCreationListener#created(ItemState)
-     */
+
+    @Override
     public void created(ItemState state) {
         log.debug("ItemState created by WorkspaceItemStateFactory");
         notifyCreated(state);
@@ -156,6 +152,7 @@ public final class TransientISFactory ex
     /**
      * @see ItemStateCreationListener#statusChanged(ItemState, int)
      */
+    @Override
     public void statusChanged(ItemState state, int previousStatus) {
         // ignore
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateFactory.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateFactory.java Thu Sep  1 11:52:08 2011
@@ -40,9 +40,7 @@ public interface TransientItemStateFacto
      * @param definition
      * @return the created <code>NodeState</code>
      */
-    public NodeState createNewNodeState(NodeEntry entry,
-                                        Name nodeTypeName,
-                                        QNodeDefinition definition);
+    NodeState createNewNodeState(NodeEntry entry, Name nodeTypeName, QNodeDefinition definition);
 
     /**
      * Creates a transient <code>PropertyState</code>.
@@ -53,8 +51,6 @@ public interface TransientItemStateFacto
      * @param propertyType
      * @return the created <code>PropertyState</code>.
      */
-    public PropertyState createNewPropertyState(PropertyEntry entry,
-                                                QPropertyDefinition definition,
-                                                QValue[] values, int propertyType)
-            throws RepositoryException;
+    PropertyState createNewPropertyState(PropertyEntry entry, QPropertyDefinition definition, QValue[] values,
+            int propertyType) throws RepositoryException;
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java Thu Sep  1 11:52:08 2011
@@ -16,21 +16,12 @@
  */
 package org.apache.jackrabbit.jcr2spi.state;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.ItemExistsException;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.ConstraintViolationException;
-
 import org.apache.commons.collections.iterators.IteratorChain;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
+import org.apache.jackrabbit.jcr2spi.operation.Update;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
@@ -38,6 +29,15 @@ import org.apache.jackrabbit.spi.QValue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
 /**
  * <code>TransientItemStateManager</code> adds support for transient changes on
  * {@link ItemState}s and also provides methods to create new item states.
@@ -85,13 +85,6 @@ public class TransientItemStateManager i
     }
 
     /**
-     * @return the operations that have been recorded until now.
-     */
-    Iterator<Operation> getOperations() {
-        return operations.iterator();
-    }
-
-    /**
      * Add the given operation to the list of operations to be recorded within
      * this TransientItemStateManager.
      *
@@ -126,7 +119,7 @@ public class TransientItemStateManager i
      * therefore not reuse the <code>changeLog</code> if such an exception is thrown.
      * @throws RepositoryException if <code>state</code> is a new item state.
      */
-    ChangeLog getChangeLog(ItemState target, boolean throwOnStale) throws InvalidItemStateException, ConstraintViolationException, RepositoryException {
+    ChangeLog getChangeLog(ItemState target, boolean throwOnStale) throws RepositoryException {
         // fail-fast test: check status of this item's state
         if (target.getStatus() == Status.NEW) {
             String msg = "Cannot save/revert an item with status NEW (" +target+ ").";
@@ -188,14 +181,14 @@ public class TransientItemStateManager i
             // - collect the set of operations and
             //   check if the affected states listed by the operations are all
             //   listed in the modified,removed or added states collected by this
-            //   changelog.
+            //   change log.
             for (Operation op : operations) {
                 Collection<ItemState> opStates = op.getAffectedItemStates();
                 for (ItemState state : opStates) {
                     if (affectedStates.contains(state)) {
                         // operation needs to be included
                         if (!affectedStates.containsAll(opStates)) {
-                            // incomplete changelog: need to save a parent as well
+                            // incomplete change log: need to save a parent as well
                             String msg = "ChangeLog is not self contained.";
                             throw new ConstraintViolationException(msg);
                         }
@@ -208,8 +201,7 @@ public class TransientItemStateManager i
             }
         }
 
-        ChangeLog cl = new ChangeLog(target, ops, affectedStates);
-        return cl;
+        return new ChangeLog(target, ops, affectedStates);
     }
 
     /**
@@ -225,9 +217,9 @@ public class TransientItemStateManager i
      * @param parent       the parent of the new node state.
      * @return a new transient {@link NodeState}.
      */
-    NodeState createNewNodeState(Name nodeName, String uniqueID, Name nodeTypeName,
-                                 QNodeDefinition definition, NodeState parent)
-            throws RepositoryException {
+    static NodeState createNewNodeState(Name nodeName, String uniqueID, Name nodeTypeName, QNodeDefinition definition,
+            NodeState parent) throws RepositoryException {
+
         NodeEntry ne = ((NodeEntry) parent.getHierarchyEntry()).addNewNodeEntry(nodeName, uniqueID, nodeTypeName, definition);
         try {
             parent.markModified();
@@ -251,10 +243,9 @@ public class TransientItemStateManager i
      * @throws ConstraintViolationException
      * @throws RepositoryException
      */
-    PropertyState createNewPropertyState(Name propName, NodeState parent,
-                                         QPropertyDefinition definition,
-                                         QValue[] values, int propertyType)
-            throws ItemExistsException, ConstraintViolationException, RepositoryException {
+    static PropertyState createNewPropertyState(Name propName, NodeState parent, QPropertyDefinition definition,
+            QValue[] values, int propertyType) throws RepositoryException {
+
         // NOTE: callers must make sure, the property type is not 'undefined'
         NodeEntry nodeEntry = (NodeEntry) parent.getHierarchyEntry();
         PropertyEntry pe = nodeEntry.addNewPropertyEntry(propName, definition, values, propertyType);
@@ -341,6 +332,7 @@ public class TransientItemStateManager i
     }
 
     //-----------------------------------------< ItemStateLifeCycleListener >---
+
     /**
      * Depending on status of the given state adapt change log.
      * E.g. a revert on states will reset the status from 'existing modified' to
@@ -349,16 +341,15 @@ public class TransientItemStateManager i
      *
      * @see ItemStateLifeCycleListener#statusChanged(ItemState, int)
      */
+    @Override
     public void statusChanged(ItemState state, int previousStatus) {
-        /*
-        Update the collections of states that were transiently modified.
-        NOTE: cleanup of operations is omitted here. this is expected to
-        occur upon {@link ChangeLog#save()} and {@link ChangeLog#undo()}.
-        External modifications in contrast that clash with transient modifications
-        render the corresponding states stale.
-        */
+        // Update the collections of states that were transiently modified.
+        // NOTE: cleanup of operations is omitted here. this is expected to
+        // occur upon {@link ChangeLog#save()} and {@link ChangeLog#undo()}.
+        // External modifications in contrast that clash with transient modifications
+        // render the corresponding states stale.
         switch (state.getStatus()) {
-            case (Status.EXISTING):
+            case Status.EXISTING:
                 switch (previousStatus) {
                     case Status.EXISTING_MODIFIED:
                         // was modified and got persisted or reverted
@@ -385,11 +376,11 @@ public class TransientItemStateManager i
                 // transition from EXISTING to EXISTING_MODIFIED
                 modifiedStates.add(state);
                 break;
-            case (Status.EXISTING_REMOVED):
+            case Status.EXISTING_REMOVED:
                 // transition from EXISTING or EXISTING_MODIFIED to EXISTING_REMOVED
                 removed(state);
                 break;
-            case (Status.REMOVED):
+            case Status.REMOVED:
                 switch (previousStatus) {
                     case Status.EXISTING_REMOVED:
                         // was transiently removed and removal was persisted.
@@ -407,19 +398,18 @@ public class TransientItemStateManager i
                 break;
             case Status.STALE_DESTROYED:
             case Status.STALE_MODIFIED:
-                /**
-                 state is stale due to external modification -> move it to
-                 the collection of stale item states.
-                 validation omitted for only 'existing_modified' states can
-                 become stale see {@link Status#isValidStatusChange(int, int)}
-                 */
+                 // state is stale due to external modification -> move it to
+                 // the collection of stale item states.
+                 // validation omitted for only 'existing_modified' states can
+                 // become stale see {@link Status#isValidStatusChange(int, int)}
                 modifiedStates.remove(state);
                 staleStates.add(state);
                 break;
             case Status.MODIFIED:
             case Status.INVALIDATED:
                 // MODIFIED, INVALIDATED: ignore.
-                log.debug("Item " + state.getName() + " changed status from " + Status.getName(previousStatus) + " to " + Status.getName(state.getStatus()) + ".");
+                log.debug("Item " + state.getName() + " changed status from " + Status.getName(previousStatus) +
+                        " to " + Status.getName(state.getStatus()) + '.');
                 break;
             default:
                 log.error("ItemState "+ state.getName() + " has invalid status: " + state.getStatus());
@@ -427,9 +417,8 @@ public class TransientItemStateManager i
     }
 
     //-----------------------------------------< ItemStateCreationListener >---
-    /**
-     * @see ItemStateCreationListener#created(ItemState)
-     */
+
+    @Override
     public void created(ItemState state) {
         // new state has been created
         if (state.getStatus() == Status.NEW) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/UpdatableItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/UpdatableItemStateManager.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/UpdatableItemStateManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/UpdatableItemStateManager.java Thu Sep  1 11:52:08 2011
@@ -31,7 +31,7 @@ public interface UpdatableItemStateManag
      * @param operation
      * @throws RepositoryException
      */
-    public void execute(Operation operation) throws RepositoryException;
+    void execute(Operation operation) throws RepositoryException;
 
     /**
      * Executes the operations passed with the given change log and modifies the
@@ -40,7 +40,7 @@ public interface UpdatableItemStateManag
      * @param changes
      * @throws RepositoryException
      */
-    public void execute(ChangeLog changes) throws RepositoryException;
+    void execute(ChangeLog changes) throws RepositoryException;
 
     /**
      * Disposes this <code>UpdatableItemStateManager</code> and frees resources.

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java Thu Sep  1 11:52:08 2011
@@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory;
  * <code>WorkspaceItemStateFactory</code>...
  */
 public class WorkspaceItemStateFactory extends AbstractItemStateFactory {
-    private static Logger log = LoggerFactory.getLogger(WorkspaceItemStateFactory.class);
+    private static final Logger log = LoggerFactory.getLogger(WorkspaceItemStateFactory.class);
 
     private final RepositoryService service;
     private final SessionInfo sessionInfo;
@@ -62,7 +62,7 @@ public class WorkspaceItemStateFactory e
     private final ItemInfoCache cache;
 
     public WorkspaceItemStateFactory(RepositoryService service, SessionInfo sessionInfo,
-                                     ItemDefinitionProvider definitionProvider, ItemInfoCache cache) {
+            ItemDefinitionProvider definitionProvider, ItemInfoCache cache) {
 
         this.service = service;
         this.sessionInfo = sessionInfo;
@@ -70,7 +70,8 @@ public class WorkspaceItemStateFactory e
         this.cache = cache;
     }
 
-    public NodeState createRootState(NodeEntry entry) throws ItemNotFoundException, RepositoryException {
+    @Override
+    public NodeState createRootState(NodeEntry entry) throws RepositoryException {
         IdFactory idFactory = service.getIdFactory();
         PathFactory pf = service.getPathFactory();
 
@@ -80,7 +81,8 @@ public class WorkspaceItemStateFactory e
     /**
      * Creates the node with information retrieved from the <code>RepositoryService</code>.
      */
-    public NodeState createNodeState(NodeId nodeId, NodeEntry entry) throws ItemNotFoundException,
+    @Override
+    public NodeState createNodeState(NodeId nodeId, NodeEntry entry) throws
             RepositoryException {
 
         try {
@@ -109,7 +111,8 @@ public class WorkspaceItemStateFactory e
      * Creates the node with information retrieved from the <code>RepositoryService</code>.
      * Intermediate entries are created as needed.
      */
-    public NodeState createDeepNodeState(NodeId nodeId, NodeEntry anyParent) throws ItemNotFoundException,
+    @Override
+    public NodeState createDeepNodeState(NodeId nodeId, NodeEntry anyParent) throws
             RepositoryException {
 
         try {
@@ -158,8 +161,9 @@ public class WorkspaceItemStateFactory e
     /**
      * Creates the PropertyState with information retrieved from the <code>RepositoryService</code>.
      */
+    @Override
     public PropertyState createPropertyState(PropertyId propertyId, PropertyEntry entry)
-            throws ItemNotFoundException, RepositoryException {
+            throws RepositoryException {
 
         try {
             // Get item info from cache and use it if up to date
@@ -188,6 +192,7 @@ public class WorkspaceItemStateFactory e
      * Creates the PropertyState with information retrieved from the <code>RepositoryService</code>.
      * Intermediate entries are created as needed.
      */
+    @Override
     public PropertyState createDeepPropertyState(PropertyId propertyId, NodeEntry anyParent)
             throws RepositoryException {
 
@@ -233,12 +238,14 @@ public class WorkspaceItemStateFactory e
         }
     }
 
-    public Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId) throws ItemNotFoundException,
+    @Override
+    public Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId) throws
             RepositoryException {
 
         return service.getChildInfos(sessionInfo, nodeId);
     }
 
+    @Override
     public Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName, boolean weak) {
         NodeEntry entry = nodeState.getNodeEntry();
 
@@ -293,7 +300,7 @@ public class WorkspaceItemStateFactory e
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    private NodeState createNodeState(NodeInfo info, NodeEntry entry) throws ItemNotFoundException,
+    private NodeState createNodeState(NodeInfo info, NodeEntry entry) throws
             RepositoryException {
 
         // Make sure the entry has the correct ItemId
@@ -337,7 +344,7 @@ public class WorkspaceItemStateFactory e
             entry.setNodeEntries(childInfos);
         }
 
-        // now build or update the nodestate itself
+        // now build or update the node state itself
         NodeState tmp = new NodeState(entry, info, this, definitionProvider);
         entry.setItemState(tmp);
 
@@ -378,7 +385,7 @@ public class WorkspaceItemStateFactory e
             return entry.getPropertyState();
         }
 
-        // now build or update the nodestate itself
+        // now build or update the node state itself
         PropertyState tmp = new PropertyState(entry, info, this, definitionProvider);
         entry.setItemState(tmp);
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java Thu Sep  1 11:52:08 2011
@@ -32,8 +32,7 @@ import javax.jcr.NamespaceException;
  * <code>LogUtil</code>...
  */
 public final class LogUtil {
-
-    private static Logger log = LoggerFactory.getLogger(LogUtil.class);
+    private static final Logger log = LoggerFactory.getLogger(LogUtil.class);
 
     /**
      * Avoid instantiation
@@ -41,7 +40,7 @@ public final class LogUtil {
     private LogUtil() {}
 
     /**
-     * Failsafe conversion of internal <code>Path</code> to JCR path for use in
+     * Fail safe conversion of internal <code>Path</code> to JCR path for use in
      * error messages etc.
      *
      * @param qPath path to convert
@@ -59,7 +58,7 @@ public final class LogUtil {
     }
 
     /**
-     * Failsafe conversion of an <code>ItemState</code> to JCR path for use in
+     * Fail safe conversion of an <code>ItemState</code> to JCR path for use in
      * error messages etc.
      *
      * @param itemState
@@ -76,7 +75,7 @@ public final class LogUtil {
     }
 
     /**
-     * Failsafe conversion of a <code>Name</code> to a JCR name for use in
+     * Fail safe conversion of a <code>Name</code> to a JCR name for use in
      * error messages etc.
      *
      * @param qName
@@ -94,7 +93,7 @@ public final class LogUtil {
     }
 
     /**
-     * Failsafe conversion of an <code>ItemId</code> to a human readable string
+     * Fail safe conversion of an <code>ItemId</code> to a human readable string
      * resolving the path part of the specified id using the given path resolver.
      *
      * @param itemId
@@ -106,7 +105,7 @@ public final class LogUtil {
         if (p == null || pathResolver == null) {
             return itemId.toString();
         } else {
-            StringBuffer bf = new StringBuffer();
+            StringBuilder bf = new StringBuilder();
             String uniqueID = itemId.getUniqueID();
             if (uniqueID != null) {
                 bf.append(uniqueID).append(" - ");

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/ReferenceChangeTracker.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/ReferenceChangeTracker.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/ReferenceChangeTracker.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/ReferenceChangeTracker.java Thu Sep  1 11:52:08 2011
@@ -37,25 +37,19 @@ import java.util.Map;
  * need correcting depending on the uuid mappings.
  */
 public class ReferenceChangeTracker {
-
-    private static Logger log = LoggerFactory.getLogger(ReferenceChangeTracker.class);
+    private static final Logger log = LoggerFactory.getLogger(ReferenceChangeTracker.class);
 
     /**
      * mapping <original uuid> to <new uuid> of mix:referenceable nodes
      */
     private final Map<String, String> uuidMap = new HashMap<String, String>();
+
     /**
      * list of processed reference properties that might need correction
      */
     private final List<PropertyState> references = new ArrayList<PropertyState>();
 
     /**
-     * Creates a new instance.
-     */
-    public ReferenceChangeTracker() {
-    }
-
-    /**
      * Resets all internal state.
      */
     public void clear() {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/StateUtility.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/StateUtility.java?rev=1164026&r1=1164025&r2=1164026&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/StateUtility.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/StateUtility.java Thu Sep  1 11:52:08 2011
@@ -63,14 +63,6 @@ public final class StateUtility {
         }
     }
 
-    public static Name getPrimaryTypeName(PropertyState ps) throws RepositoryException {
-        if (!NameConstants.JCR_PRIMARYTYPE.equals(ps.getName())) {
-            throw new IllegalArgumentException();
-        }
-        QValue[] values = ps.getValues();
-        return values[0].getName();
-    }
-
     public static boolean isUuidOrMixin(Name propName) {
         return NameConstants.JCR_UUID.equals(propName) || NameConstants.JCR_MIXINTYPES.equals(propName);
     }



Mime
View raw message