jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1167238 [2/2] - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src: main/java/org/apache/jackrabbit/jcr2spi/ main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ main/java/org/apache/jackrabbit/jcr2spi/lock/ main/java/org/apache/jac...
Date Fri, 09 Sep 2011 15:04:43 GMT
Copied: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status0.java (from r1167084, 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/Status0.java?p2=jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status0.java&p1=jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java&r1=1167084&r2=1167238&rev=1167238&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/Status0.java Fri Sep  9 15:04:41 2011
@@ -1,87 +1,58 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 package org.apache.jackrabbit.jcr2spi.state;
 
-/**
- * {@code Status}...
- */
-public final class Status {
-
-    /**
-     * Avoid instantiation
-     */
-    private Status() {}
-
-    public static final int _UNDEFINED_ = -1;
+public enum Status0 {
+    _UNDEFINED_,
 
     /**
      * A state once read from persistent storage has been set to invalid. This
      * means that the state needs to be re-fetched from persistent storage when
      * accessed the next time.
      */
-    public static final int INVALIDATED = 0;
+    INVALIDATED,
 
     /**
      * 'existing', i.e. persistent state
      */
-    public static final int EXISTING = 1;
+    EXISTING,
 
     /**
      * 'existing', i.e. persistent state that has been transiently modified (copy-on-write)
      */
-    public static final int EXISTING_MODIFIED = 2;
+    EXISTING_MODIFIED,
 
     /**
      * 'existing', i.e. persistent state that has been transiently removed (copy-on-write)
      */
-    public static final int EXISTING_REMOVED = 3;
+    EXISTING_REMOVED,
 
     /**
      * 'new' state
      */
-    public static final int NEW = 4;
+    NEW,
 
     /**
      * 'existing', i.e. persistent state that has been persistently modified by somebody else
      */
-    public static final int STALE_MODIFIED = 5;
+    STALE_MODIFIED,
 
     /**
      * 'existing', i.e. persistent state that has been destroyed by somebody else
      */
-    public static final int STALE_DESTROYED = 6;
+    STALE_DESTROYED,
 
     /**
      * Temporary status used to mark a state, this is permanently modified
      * either by saving transient changes, by workspace operations or by
      * external modification.
      */
-    public static final int MODIFIED = 7;
+    MODIFIED,
 
     /**
      * a new state was removed and is now 'removed'
      * or an existing item has been removed by a workspace operation or
      * by an external modification.
      */
-    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"
-    };
+    REMOVED;
 
     /**
      * Returns {@code true} if the given status is a terminal status, i.e.
@@ -94,7 +65,7 @@ public final class Status {
      * @param status
      * @return true if the given status is terminal.
      */
-    public static boolean isTerminal(int status) {
+    public static boolean isTerminal(Status0 status) {
         return status == REMOVED || status == STALE_DESTROYED;
     }
 
@@ -110,7 +81,7 @@ public final class Status {
      * @param status
      * @return true if the given status indicates a valid ItemState.
      */
-    public static boolean isValid(int status) {
+    public static boolean isValid(Status0 status) {
         return status == EXISTING || status == EXISTING_MODIFIED || status == NEW;
     }
 
@@ -125,7 +96,7 @@ public final class Status {
      * @return {@code true} if {@code status} indicates that an item
      *         state is stale.
      */
-    public static boolean isStale(int status) {
+    public static boolean isStale(Status0 status) {
         return status == STALE_DESTROYED || status == STALE_MODIFIED;
     }
 
@@ -141,7 +112,7 @@ public final class Status {
      * @return {@code true} if {@code status} indicates that an item
      *         state is transiently modified.
      */
-    public static boolean isTransient(int status) {
+    public static boolean isTransient(Status0 status) {
         return status == EXISTING_MODIFIED || status == EXISTING_REMOVED || status == NEW;
     }
 
@@ -155,7 +126,7 @@ public final class Status {
      * @return true if a status change from {@code oldStatus} to
      * {@code newStatus} is allowed or if the two status are the same.
      */
-    public static boolean isValidStatusChange(int oldStatus, int newStatus) {
+    public static boolean isValidStatusChange(Status0 oldStatus, Status0 newStatus) {
         if (oldStatus == newStatus) {
             return true;
         }
@@ -164,30 +135,29 @@ public final class Status {
         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 MODIFIED:
-                        isValid = true;
-                        break;
-                        // REMOVED, STALE_DESTROYED -> false
-                }
+                isValid = oldStatus == INVALIDATED        // refresh
+                       || oldStatus == NEW                // save
+                       || oldStatus == EXISTING_MODIFIED  // save, revert
+                       || oldStatus == EXISTING_REMOVED   // revert
+                       || oldStatus == STALE_MODIFIED     // revert
+                       || oldStatus == MODIFIED;
+                // REMOVED, STALE_DESTROYED -> false
                 break;
             case EXISTING_MODIFIED:
                 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)
@@ -195,11 +165,14 @@ public final class Status {
                 break;
             case MODIFIED:
                 // except for NEW states an external modification is always valid
-                if (oldStatus != NEW) {
-                    isValid = true;
-                }
+                isValid = oldStatus != NEW;
+                break;
+            case NEW:
+                // default: NEW cannot change state to NEW -> false
+                break;
+            case _UNDEFINED_:
+                // false
                 break;
-                // default: NEW cannot change state to NEW -> false 
         }
         return isValid;
     }
@@ -213,8 +186,8 @@ public final class Status {
      * @param newStatusHint
      * @return new status that takes transient modification/removal into account.
      */
-    public static int getNewStatus(int oldStatus, int newStatusHint) {
-        int newStatus;
+    public static Status0 getNewStatus(Status0 oldStatus, Status0 newStatusHint) {
+        Status0 newStatus = newStatusHint;
         switch (newStatusHint) {
             case MODIFIED:
                 // underlying state has been modified by external changes
@@ -232,30 +205,19 @@ public final class Status {
             case REMOVED:
                 if (oldStatus == EXISTING_MODIFIED || oldStatus == STALE_MODIFIED) {
                     newStatus = STALE_DESTROYED;
-                } else {
-                    // applies both to NEW or to any other status
-                    newStatus = newStatusHint;
                 }
                 break;
-            default:
-                newStatus = newStatusHint;
+            case _UNDEFINED_:
+            case INVALIDATED:
+            case EXISTING:
+            case EXISTING_MODIFIED:
+            case EXISTING_REMOVED:
+            case NEW:
+            case STALE_MODIFIED:
+            case STALE_DESTROYED:
                 break;
-
         }
         return newStatus;
     }
 
-    /**
-     * @param status A valid status constant.
-     * @return Human readable status name for the given int.
-     */
-    public static String getName(int status) {
-        if (status == _UNDEFINED_) {
-            return "_UNDEFINED_";
-        }
-        if (status < 0 || status >= STATUS_NAMES.length) {
-            throw new IllegalArgumentException("Invalid status " + status);
-        }
-        return STATUS_NAMES[status];
-    }
 }

Propchange: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status0.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status0.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

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=1167238&r1=1167237&r2=1167238&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 Fri Sep  9 15:04:41 2011
@@ -16,13 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.state;
 
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
@@ -36,6 +29,11 @@ import org.apache.jackrabbit.spi.QValue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.RepositoryException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Set;
+
 /**
  * {@code TransientISFactory}...
  */
@@ -134,7 +132,7 @@ public final class TransientISFactory ex
      */
     @Override
     public Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName, boolean weak) {
-        if (nodeState.getStatus() == Status.NEW) {
+        if (nodeState.getStatus() == Status0.NEW) {
             Set<PropertyId> t = Collections.emptySet();
             return t.iterator();
         }
@@ -150,10 +148,10 @@ public final class TransientISFactory ex
     }
 
     /**
-     * @see ItemStateCreationListener#statusChanged(ItemState, int)
+     * @see ItemStateCreationListener#statusChanged(ItemState, Status0)
      */
     @Override
-    public void statusChanged(ItemState state, int previousStatus) {
+    public void statusChanged(ItemState state, Status0 previousStatus) {
         // ignore
     }
 }
\ No newline at end of file

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=1167238&r1=1167237&r2=1167238&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 Fri Sep  9 15:04:41 2011
@@ -120,12 +120,12 @@ public class TransientItemStateManager i
      */
     ChangeLog getChangeLog(ItemState target, boolean throwOnStale) throws RepositoryException {
         // fail-fast test: check status of this item's state
-        if (target.getStatus() == Status.NEW) {
+        if (target.getStatus() == Status0.NEW) {
             String msg = "Cannot save/revert an item with status NEW (" +target+ ").";
             log.debug(msg);
             throw new RepositoryException(msg);
         }
-        if (throwOnStale && Status.isStale(target.getStatus())) {
+        if (throwOnStale && Status0.isStale(target.getStatus())) {
             String msg =  "Attempt to save/revert an item, that has been externally modified (" +target+ ").";
             log.debug(msg);
             throw new InvalidItemStateException(msg);
@@ -338,80 +338,97 @@ public class TransientItemStateManager i
      * 'existing'. A state which changes from 'existing' to 'existing modified'
      * will go into the modified set of the change log, etc.
      *
-     * @see ItemStateLifeCycleListener#statusChanged(ItemState, int)
+     * @see ItemStateLifeCycleListener#statusChanged(ItemState, Status0)
      */
     @Override
-    public void statusChanged(ItemState state, int previousStatus) {
+    public void statusChanged(ItemState state, Status0 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.
         switch (state.getStatus()) {
-            case Status.EXISTING:
+            case EXISTING:
                 switch (previousStatus) {
-                    case Status.EXISTING_MODIFIED:
+                    case EXISTING_MODIFIED:
                         // was modified and got persisted or reverted
                         modifiedStates.remove(state);
                         break;
-                    case Status.EXISTING_REMOVED:
+                    case EXISTING_REMOVED:
                         // was transiently removed and is now reverted
                         removedStates.remove(state);
                         break;
-                    case Status.STALE_MODIFIED:
+                    case STALE_MODIFIED:
                         // was modified and stale and is now reverted
                         staleStates.remove(state);
                         break;
-                    case Status.NEW:
+                    case NEW:
                         // was new and has been saved now
                         addedStates.remove(state);
                         break;
-                    //default:
+                    case _UNDEFINED_:
+                    case INVALIDATED:
+                    case EXISTING:
+                    case STALE_DESTROYED:
+                    case MODIFIED:
+                    case REMOVED:
                         // INVALIDATED, MODIFIED ignore. no effect to transient modifications.
-                        // any other status change is invalid -> see Status#isValidStatusChange(int, int
+                        // any other status change is invalid -> see Status0#isValidStatusChange(int, int
+                        break;
                 }
                 break;
-            case Status.EXISTING_MODIFIED:
+            case EXISTING_MODIFIED:
                 // transition from EXISTING to EXISTING_MODIFIED
                 modifiedStates.add(state);
                 break;
-            case Status.EXISTING_REMOVED:
+            case EXISTING_REMOVED:
                 // transition from EXISTING or EXISTING_MODIFIED to EXISTING_REMOVED
                 removed(state);
                 break;
-            case Status.REMOVED:
+            case REMOVED:
                 switch (previousStatus) {
-                    case Status.EXISTING_REMOVED:
+                    case EXISTING_REMOVED:
                         // was transiently removed and removal was persisted.
                         // -> ignore
                         break;
-                    case Status.NEW:
+                    case NEW:
                         // a new entry was removed again: remember as removed
                         // in order to keep the operations and the affected
                         // states in sync
                         removed(state);
                         break;
+                    case _UNDEFINED_:
+                    case INVALIDATED:
+                    case EXISTING:
+                    case EXISTING_MODIFIED:
+                    case STALE_MODIFIED:
+                    case STALE_DESTROYED:
+                    case MODIFIED:
+                    case REMOVED:
+                        break;
                 }
                 // in any case: stop listening to status changes
                 state.removeListener(this);
                 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)}
+            case STALE_DESTROYED:
+            case 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 Status0#isValidStatusChange(int, int)}
                 modifiedStates.remove(state);
                 staleStates.add(state);
                 break;
-            case Status.MODIFIED:
-            case Status.INVALIDATED:
+            case MODIFIED:
+            case 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 " + previousStatus +
+                        " to " + state.getStatus() + '.');
+                break;
+            case _UNDEFINED_:
+            case NEW:
+                log.error("ItemState " + state.getName() + " has invalid status: " + state.getStatus());
                 break;
-            default:
-                log.error("ItemState "+ state.getName() + " has invalid status: " + state.getStatus());
         }
     }
 
@@ -420,7 +437,7 @@ public class TransientItemStateManager i
     @Override
     public void created(ItemState state) {
         // new state has been created
-        if (state.getStatus() == Status.NEW) {
+        if (state.getStatus() == Status0.NEW) {
             addedStates.add(state);
         }
     }

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=1167238&r1=1167237&r2=1167238&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 Fri Sep  9 15:04:41 2011
@@ -16,17 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.state;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.jcr.ItemExistsException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
@@ -35,6 +24,7 @@ import org.apache.jackrabbit.spi.ChildIn
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.spi.ItemInfoCache;
+import org.apache.jackrabbit.spi.ItemInfoCache.Entry;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.NodeInfo;
@@ -44,11 +34,20 @@ import org.apache.jackrabbit.spi.Propert
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.SessionInfo;
-import org.apache.jackrabbit.spi.ItemInfoCache.Entry;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
 /**
  * {@code WorkspaceItemStateFactory}...
  */
@@ -317,8 +316,8 @@ public class WorkspaceItemStateFactory e
             parent.setUniqueID(uniqueID);
         }
 
-        int previousStatus = entry.getStatus();
-        if (Status.isTransient(previousStatus) || Status.isStale(previousStatus)) {
+        Status0 previousStatus = entry.getStatus();
+        if (Status0.isTransient(previousStatus) || Status0.isStale(previousStatus)) {
             log.debug("Node has pending changes; omit resetting the state.");
             return entry.getNodeState();
         }
@@ -349,7 +348,7 @@ public class WorkspaceItemStateFactory e
         entry.setItemState(tmp);
 
         NodeState nState = entry.getNodeState();
-        if (previousStatus == Status._UNDEFINED_) {
+        if (previousStatus == Status0._UNDEFINED_) {
             // tmp state was used as resolution for the given entry i.e. the
             // entry was not available before. otherwise the 2 states were
             // merged. see HierarchyEntryImpl#setItemState
@@ -379,8 +378,8 @@ public class WorkspaceItemStateFactory e
             parent.setUniqueID(uniqueID);
         }
 
-        int previousStatus = entry.getStatus();
-        if (Status.isTransient(previousStatus) || Status.isStale(previousStatus)) {
+        Status0 previousStatus = entry.getStatus();
+        if (Status0.isTransient(previousStatus) || Status0.isStale(previousStatus)) {
             log.debug("Property has pending changes; omit resetting the state.");
             return entry.getPropertyState();
         }
@@ -390,7 +389,7 @@ public class WorkspaceItemStateFactory e
         entry.setItemState(tmp);
 
         PropertyState pState = entry.getPropertyState();
-        if (previousStatus == Status._UNDEFINED_) {
+        if (previousStatus == Status0._UNDEFINED_) {
             // tmp state was used as resolution for the given entry i.e. the
             // entry was not available before. otherwise the 2 states were
             // merged. see HierarchyEntryImpl#setItemState

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=1167238&r1=1167237&r2=1167238&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 Fri Sep  9 15:04:41 2011
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.jcr2spi.ut
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
@@ -47,7 +47,7 @@ public final class StateUtility {
         if (!NameConstants.JCR_MIXINTYPES.equals(ps.getName())) {
             throw new IllegalArgumentException();
         }
-        if (ps.getStatus() == Status.REMOVED) {
+        if (ps.getStatus() == Status0.REMOVED) {
             return Name.EMPTY_ARRAY;
         } else {
             QValue[] values = ps.getValues();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java Fri Sep  9 15:04:41 2011
@@ -16,18 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.version;
 
-import java.util.Iterator;
-
-import javax.jcr.AccessDeniedException;
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.MergeException;
-import javax.jcr.NoSuchWorkspaceException;
-import javax.jcr.RepositoryException;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.lock.LockException;
-import javax.jcr.version.VersionException;
-
 import org.apache.jackrabbit.jcr2spi.WorkspaceManager;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.operation.AddLabel;
@@ -45,13 +33,18 @@ import org.apache.jackrabbit.jcr2spi.ope
 import org.apache.jackrabbit.jcr2spi.operation.Restore;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.version.VersionException;
+import java.util.Iterator;
+
 /**
  * {@code VersionManagerImpl}...
  */
@@ -106,7 +99,7 @@ public class VersionManagerImpl implemen
     @Override
     public boolean isCheckedOut(NodeState nodeState) throws RepositoryException {
         // shortcut: if state is new, its ancestor must be checkout
-        if (nodeState.getStatus() == Status.NEW) {
+        if (nodeState.getStatus() == Status0.NEW) {
             return true;
         }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java Fri Sep  9 15:04:41 2011
@@ -32,7 +32,7 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
 import org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.util.ReferenceChangeTracker;
 import org.apache.jackrabbit.spi.Name;
@@ -268,7 +268,7 @@ public class SessionImporter implements 
         // ignore
     }
 
-    //--------------------------------------------< Importer/Session Status >---
+    //--------------------------------------------< Importer/Session Status0 >---
     private void setClosed(boolean isClosed) {
         importerClosed = isClosed;
         if (isClosed) {
@@ -380,7 +380,7 @@ public class SessionImporter implements 
             // attributes of its parent element) we have to rename the conflicting property;
             // see http://issues.apache.org/jira/browse/JCR-61
             PropertyState conflicting = parent.getPropertyState(nodeInfo.getName());
-            if (conflicting.getStatus() == Status.NEW) {
+            if (conflicting.getStatus() == Status0.NEW) {
                 // assume this property has been imported as well;
                 // rename conflicting property
                 // TODO: use better reversible escaping scheme to create unique name

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java Fri Sep  9 15:04:41 2011
@@ -16,17 +16,17 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.RepositoryException;
-
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+
 /** <code>AddPropertyTest</code>... */
 public class AddPropertyTest extends AbstractJCRTest {
 
@@ -48,12 +48,12 @@ public class AddPropertyTest extends Abs
         super.tearDown();
     }
 
-    private static void assertItemStatus(Item item, int status) throws NotExecutableException {
+    private static void assertItemStatus(Item item, Status0 status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        int st = ((ItemImpl) item).getItemState().getStatus();
-        assertEquals("Expected status to be " + Status.getName(status) + ", was " + Status.getName(st), status, st);
+        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        assertEquals("Expected status to be " + status + ", was " + st, status, st);
     }
 
     public void testReplacingProperty() throws RepositoryException,
@@ -70,9 +70,9 @@ public class AddPropertyTest extends Abs
         assertTrue(testNode.hasProperty(propertyName1));
         assertEquals("value3", testNode.getProperty(propertyName1).getString());
 
-        assertItemStatus(p1, Status.REMOVED);
-        assertItemStatus(p2, Status.REMOVED);
-        assertItemStatus(p3, Status.EXISTING);
+        assertItemStatus(p1, Status0.REMOVED);
+        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(p3, Status0.EXISTING);
     }
 
     public void testReplacingProperty2() throws RepositoryException,
@@ -89,9 +89,9 @@ public class AddPropertyTest extends Abs
 
         assertFalse(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status.REMOVED);
-        assertItemStatus(p2, Status.REMOVED);
-        assertItemStatus(p3, Status.REMOVED);
+        assertItemStatus(p1, Status0.REMOVED);
+        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(p3, Status0.REMOVED);
     }
 
     public void testRevertReplacingProperty() throws RepositoryException,
@@ -109,9 +109,9 @@ public class AddPropertyTest extends Abs
         assertTrue(testNode.hasProperty(propertyName1));
         assertEquals(val, p1.getString());
 
-        assertItemStatus(p1, Status.EXISTING);
-        assertItemStatus(p2, Status.REMOVED);
-        assertItemStatus(p3, Status.REMOVED);
+        assertItemStatus(p1, Status0.EXISTING);
+        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(p3, Status0.REMOVED);
     }
 
     public void testAddingProperty() throws RepositoryException,
@@ -127,9 +127,9 @@ public class AddPropertyTest extends Abs
 
         assertTrue(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status.REMOVED);
-        assertItemStatus(p2, Status.REMOVED);
-        assertItemStatus(p3, Status.EXISTING);
+        assertItemStatus(p1, Status0.REMOVED);
+        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(p3, Status0.EXISTING);
     }
 
     public void testAddingProperty2() throws RepositoryException,
@@ -146,9 +146,9 @@ public class AddPropertyTest extends Abs
 
         assertFalse(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status.REMOVED);
-        assertItemStatus(p2, Status.REMOVED);
-        assertItemStatus(p3, Status.REMOVED);
+        assertItemStatus(p1, Status0.REMOVED);
+        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(p3, Status0.REMOVED);
     }
 
     public void testRevertAddingProperty() throws RepositoryException,
@@ -164,8 +164,8 @@ public class AddPropertyTest extends Abs
 
         assertFalse(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status.REMOVED);
-        assertItemStatus(p2, Status.REMOVED);
-        assertItemStatus(p3, Status.REMOVED);
+        assertItemStatus(p1, Status0.REMOVED);
+        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(p3, Status0.REMOVED);
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java Fri Sep  9 15:04:41 2011
@@ -16,6 +16,12 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
+import org.apache.jackrabbit.jcr2spi.state.Status0;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import javax.jcr.InvalidItemStateException;
 import javax.jcr.Item;
 import javax.jcr.Node;
@@ -23,12 +29,6 @@ import javax.jcr.Property;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.jackrabbit.jcr2spi.state.Status;
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /** <code>ExternalModificationTest</code>... */
 public class ExternalModificationTest extends AbstractJCRTest {
 
@@ -62,20 +62,20 @@ public class ExternalModificationTest ex
         super.tearDown();
     }
 
-    private static boolean isItemStatus(Item item, int status) throws NotExecutableException {
+    private static boolean isItemStatus(Item item, Status0 status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        int st = ((ItemImpl) item).getItemState().getStatus();
+        Status0 st = ((ItemImpl) item).getItemState().getStatus();
         return st == status;
     }
 
-    private static void assertItemStatus(Item item, int status) throws NotExecutableException {
+    private static void assertItemStatus(Item item, Status0 status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        int st = ((ItemImpl) item).getItemState().getStatus();
-        assertEquals("Expected status to be " + Status.getName(status) + ", was " + Status.getName(st), status, st);
+        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        assertEquals("Expected status to be " + status + ", was " + st, status, st);
     }
 
     public void testMovedReferenceableNode() throws RepositoryException, NotExecutableException {
@@ -108,16 +108,16 @@ public class ExternalModificationTest ex
             Node parent = refNode2.getParent();
             if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                 // node has been automatically moved to new place
-                assertItemStatus(refNode2, Status.EXISTING);
+                assertItemStatus(refNode2, Status0.EXISTING);
             } else {
-                assertItemStatus(refNode2, Status.REMOVED);
+                assertItemStatus(refNode2, Status0.REMOVED);
             }
         } catch (InvalidItemStateException e) {
             // no automatic move of the externally moved node. ok.
             log.debug(e.getMessage());
             // since node had no pending changes -> status should be changed
             // to REMOVED.
-            assertItemStatus(refNode2, Status.REMOVED);
+            assertItemStatus(refNode2, Status0.REMOVED);
         }
     }
 
@@ -133,18 +133,18 @@ public class ExternalModificationTest ex
             Node parent = refNode2.getParent();
             if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                 // node has been automatically moved to new place
-                assertItemStatus(refNode2, Status.EXISTING_MODIFIED);
-            } else if (!isItemStatus(refNode2, Status.EXISTING_MODIFIED)) {
+                assertItemStatus(refNode2, Status0.EXISTING_MODIFIED);
+            } else if (!isItemStatus(refNode2, Status0.EXISTING_MODIFIED)) {
                 // external removal was detected either by observation or be
                 // batch-reading the parent -> status must be stale.
-                assertItemStatus(refNode2, Status.STALE_DESTROYED);
+                assertItemStatus(refNode2, Status0.STALE_DESTROYED);
             }
         } catch (InvalidItemStateException e) {
             // no automatic move of the externally moved node. ok.
             log.debug(e.getMessage());
             // since refNode2 has pending modifications its status should be
             // changed to STALE_DESTROYED.
-            assertItemStatus(refNode2, Status.STALE_DESTROYED);
+            assertItemStatus(refNode2, Status0.STALE_DESTROYED);
             Node refAgain = testSession.getNodeByUUID(refNode.getUUID());
             assertTrue(refAgain.getParent().isSame(testSession.getItem(destParentNode.getPath())));
             assertFalse(refAgain.isNodeType(mixLockable));
@@ -160,7 +160,7 @@ public class ExternalModificationTest ex
 
         testSession.getItem(destParentNode.getPath() + "/" + nodeName2);
 
-        assertItemStatus(refNode2, Status.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
         try {
             refNode2.refresh(false);
             fail();
@@ -178,9 +178,9 @@ public class ExternalModificationTest ex
 
         testSession.getItem(destParentNode.getPath() + "/" + nodeName2);
 
-        assertItemStatus(refNode2, Status.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
         testSession.refresh(false);
-        assertItemStatus(refNode2, Status.REMOVED);
+        assertItemStatus(refNode2, Status0.REMOVED);
     }
 
     public void testStaleDestroyed3() throws RepositoryException, NotExecutableException {
@@ -198,7 +198,7 @@ public class ExternalModificationTest ex
 
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
         // the uuid must be transferred to the 'moved' node
         Node n = testSession.getNodeByUUID(uuid);
         assertTrue(n.isSame(testSession.getItem(destPath)));
@@ -221,7 +221,7 @@ public class ExternalModificationTest ex
         } catch (InvalidItemStateException e) {
         }
 
-        assertItemStatus(refNode2, Status.REMOVED);
+        assertItemStatus(refNode2, Status0.REMOVED);
         // the uuid must be transferred to the 'moved' node
         Node n = testSession.getNodeByUUID(uuid);
         assertTrue(n.isSame(testSession.getItem(destPath)));
@@ -250,9 +250,9 @@ public class ExternalModificationTest ex
         } catch (InvalidItemStateException e) {
         }
 
-        assertItemStatus(refNode2, Status.REMOVED);
-        assertItemStatus(c2, Status.STALE_DESTROYED);
-        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(refNode2, Status0.REMOVED);
+        assertItemStatus(c2, Status0.STALE_DESTROYED);
+        assertItemStatus(p2, Status0.REMOVED);
     }
 
     public void testExternalRemoval3() throws RepositoryException, NotExecutableException {
@@ -278,9 +278,9 @@ public class ExternalModificationTest ex
         } catch (InvalidItemStateException e) {
         }
 
-        assertItemStatus(refNode2, Status.REMOVED);
-        assertItemStatus(c2, Status.REMOVED);
-        assertItemStatus(p2, Status.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status0.REMOVED);
+        assertItemStatus(c2, Status0.REMOVED);
+        assertItemStatus(p2, Status0.STALE_DESTROYED);
         assertEquals("changedValue", p2.getString());
     }
 
@@ -302,11 +302,11 @@ public class ExternalModificationTest ex
         testSession.refresh(true);
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status.STALE_DESTROYED);
-        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status.STALE_DESTROYED);
-        assertItemStatus(childN, Status.NEW);
-        assertItemStatus(childP, Status.NEW);
-        assertItemStatus(childN.getProperty(jcrPrimaryType), Status.NEW);
+        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status0.STALE_DESTROYED);
+        assertItemStatus(childN, Status0.NEW);
+        assertItemStatus(childP, Status0.NEW);
+        assertItemStatus(childN.getProperty(jcrPrimaryType), Status0.NEW);
 
         assertTrue(testSession.itemExists(childNPath));
         assertTrue(childN.isSame(testSession.getItem(childNPath)));
@@ -316,8 +316,8 @@ public class ExternalModificationTest ex
 
         testSession.refresh(false);
 
-        assertItemStatus(childN, Status.REMOVED);
-        assertItemStatus(childP, Status.REMOVED);
+        assertItemStatus(childN, Status0.REMOVED);
+        assertItemStatus(childP, Status0.REMOVED);
         assertFalse(testSession.itemExists(childNPath));
         assertFalse(testSession.itemExists(childPPath));
     }
@@ -343,17 +343,17 @@ public class ExternalModificationTest ex
         testSession.refresh(true);
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status.STALE_DESTROYED);
-        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status.STALE_DESTROYED);
-        assertItemStatus(child, Status.REMOVED);
-        assertItemStatus(child2, Status.STALE_DESTROYED);
-        assertItemStatus(child3, Status.NEW);
-        assertItemStatus(child3.getProperty(jcrPrimaryType), Status.NEW);
+        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status0.STALE_DESTROYED);
+        assertItemStatus(child, Status0.REMOVED);
+        assertItemStatus(child2, Status0.STALE_DESTROYED);
+        assertItemStatus(child3, Status0.NEW);
+        assertItemStatus(child3.getProperty(jcrPrimaryType), Status0.NEW);
 
         testSession.refresh(false);
 
-        assertItemStatus(child2, Status.REMOVED);
-        assertItemStatus(child3, Status.REMOVED);
+        assertItemStatus(child2, Status0.REMOVED);
+        assertItemStatus(child3, Status0.REMOVED);
     }
 
     public void testUnmodifiedAncestorRemoved() throws RepositoryException, NotExecutableException {
@@ -383,10 +383,10 @@ public class ExternalModificationTest ex
         testSession.refresh(true);
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status.REMOVED);
-        assertItemStatus(node3, Status.STALE_DESTROYED);
-        assertItemStatus(childN, Status.NEW);
-        assertItemStatus(childP, Status.NEW);
+        assertItemStatus(refNode2, Status0.REMOVED);
+        assertItemStatus(node3, Status0.STALE_DESTROYED);
+        assertItemStatus(childN, Status0.NEW);
+        assertItemStatus(childP, Status0.NEW);
 
         // since 'refNode2' is removed -> child items must not be accessible
         // any more.
@@ -396,8 +396,8 @@ public class ExternalModificationTest ex
         // revert all pending changes...
         testSession.refresh(false);
         // must mark all modified/new items as removed.
-        assertItemStatus(node3, Status.REMOVED);
-        assertItemStatus(childN, Status.REMOVED);
-        assertItemStatus(childP, Status.REMOVED);
+        assertItemStatus(node3, Status0.REMOVED);
+        assertItemStatus(childN, Status0.REMOVED);
+        assertItemStatus(childP, Status0.REMOVED);
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java Fri Sep  9 15:04:41 2011
@@ -16,30 +16,30 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
+import org.apache.jackrabbit.jcr2spi.state.Status0;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.test.NotExecutableException;
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.jcr2spi.state.Status;
 
 import javax.jcr.Item;
-import javax.jcr.RepositoryException;
+import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.Property;
+import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.ItemNotFoundException;
 
 /** <code>MixinModificationTest</code>... */
 public class MixinModificationTest extends AbstractJCRTest {
 
     private static Logger log = LoggerFactory.getLogger(MixinModificationTest.class);
 
-    private static void assertItemStatus(Item item, int status) throws NotExecutableException {
+    private static void assertItemStatus(Item item, Status0 status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        int st = ((ItemImpl) item).getItemState().getStatus();
-        assertEquals("Expected status to be " + Status.getName(status) + ", was " + Status.getName(st), status, st);
+        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        assertEquals("Expected status to be " + status + ", was " + st, status, st);
     }
 
     public void testAddMixin() throws RepositoryException,
@@ -56,7 +56,7 @@ public class MixinModificationTest exten
             throw new NotExecutableException();
         }
 
-        assertItemStatus(n, Status.EXISTING_MODIFIED);
+        assertItemStatus(n, Status0.EXISTING_MODIFIED);
         assertTrue(n.hasProperty(jcrMixinTypes));
         Property p = n.getProperty(jcrMixinTypes);
 
@@ -64,8 +64,8 @@ public class MixinModificationTest exten
 
         // after saving the affected target node must be marked 'invalidated'.
         // the property however should be set existing.
-        assertItemStatus(n, Status.INVALIDATED);
-        assertItemStatus(p, Status.EXISTING);
+        assertItemStatus(n, Status0.INVALIDATED);
+        assertItemStatus(p, Status0.EXISTING);
     }
 
     public void testAddMixin2() throws RepositoryException,
@@ -82,7 +82,7 @@ public class MixinModificationTest exten
         // after saving the affected target node must be marked 'invalidated'
         // even if adding the node and setting a mixin was achieved in the
         // same batch.
-        assertItemStatus(n, Status.INVALIDATED);
+        assertItemStatus(n, Status0.INVALIDATED);
     }
 
     public void testRemoveMixin() throws RepositoryException, NotExecutableException {
@@ -115,7 +115,7 @@ public class MixinModificationTest exten
             }
 
             // however: the added node should still be valid. but not referenceable
-            assertItemStatus(n, Status.EXISTING);
+            assertItemStatus(n, Status0.EXISTING);
             assertFalse(n.isNodeType(mixReferenceable));
             assertTrue(testSession.itemExists(nPath));
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java Fri Sep  9 15:04:41 2011
@@ -276,7 +276,7 @@ public class MoveTest extends AbstractMo
         destParentNode.remove();
 
         // JCR-2528 caused this call to throw a javax.jcr.InvalidItemStateException: Item has already
-        // been removed by someone else. Status = REMOVED
+        // been removed by someone else. Status0 = REMOVED
         destParentNode.getSession().save();
     }
 



Mime
View raw message