jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1170842 - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbi...
Date Wed, 14 Sep 2011 20:43:00 GMT
Author: mduerig
Date: Wed Sep 14 20:42:58 2011
New Revision: 1170842

URL: http://svn.apache.org/viewvc?rev=1170842&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
refactor: prefer IAE, ISE to assertions

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateActivity.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateConfiguration.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveVersion.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPrimaryType.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/WorkspaceImport.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/IdentifierPath.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java Wed Sep 14 20:42:58 2011
@@ -259,7 +259,9 @@ public abstract class ItemImpl implement
      */
     @Override
     public void statusChanged(ItemState state, Status previousStatus) {
-        assert state == this.state;
+        if (state != this.state) {
+            throw new IllegalArgumentException("Invalid argument: ItemState with changed status must be this.state.");
+        }
 
         switch (state.getStatus()) {
             //   Notify listeners about an update (status was MODIFIED before)

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java Wed Sep 14 20:42:58 2011
@@ -243,11 +243,10 @@ abstract class HierarchyEntryImpl implem
      */
     @Override
     public synchronized void setItemState(ItemState state) {
-        assert state != null;
-        assert denotesNode() == state.isNode();
-
         ItemState currentState = internalGetItemState();
-        assert state != currentState;
+        if (state == null || state == currentState || denotesNode() != state.isNode()) {
+            throw new IllegalArgumentException();
+        }
 
         if (currentState == null) {
             // not connected yet to an item state. either a new entry or

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java Wed Sep 14 20:42:58 2011
@@ -100,7 +100,9 @@ public class PropertyEntryImpl extends H
      */
     @Override
     public void complete(Operation operation) throws RepositoryException {
-        assert operation instanceof SetPropertyValue;
+        if (!(operation instanceof SetPropertyValue)) {
+            throw new IllegalArgumentException();
+        }
 
         SetPropertyValue op = (SetPropertyValue) operation;
         if (op.getPropertyState().getHierarchyEntry() != this) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java Wed Sep 14 20:42:58 2011
@@ -71,7 +71,7 @@ public abstract class AbstractCopy exten
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         destParentState.getHierarchyEntry().invalidate(false);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java Wed Sep 14 20:42:58 2011
@@ -20,6 +20,8 @@ import org.apache.jackrabbit.jcr2spi.hie
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.spi.Path;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
@@ -31,6 +33,7 @@ import java.util.Collections;
  * {@code AbstractOperation}...
  */
 public abstract class AbstractOperation implements Operation {
+    private static final Logger log = LoggerFactory.getLogger(AbstractOperation.class);
 
     /**
      * The collection of affected ItemStates.
@@ -61,7 +64,7 @@ public abstract class AbstractOperation 
 
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         throw new UnsupportedOperationException("Undo not supported.");
     }
 
@@ -100,4 +103,12 @@ public abstract class AbstractOperation 
     protected static void assertChildNodeEntries(NodeState parentState) throws RepositoryException {
         parentState.getNodeEntry().getNodeEntries();
     }
+
+    protected final void assertStatus(Status status) {
+        if (this.status != status) {
+            String msg = "Illegal status: found " + this.status + ", expected " + status;
+            log.debug(msg);
+            throw new IllegalStateException(msg);
+        }
+    }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java Wed Sep 14 20:42:58 2011
@@ -44,7 +44,7 @@ public abstract class AbstractRemove ext
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         parent.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java Wed Sep 14 20:42:58 2011
@@ -67,7 +67,7 @@ public class AddLabel extends AbstractOp
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -80,7 +80,7 @@ public class AddLabel extends AbstractOp
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         try {
             NodeEntry vhEntry = (NodeEntry) versionHistoryState.getHierarchyEntry();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java Wed Sep 14 20:42:58 2011
@@ -63,7 +63,7 @@ public class AddNode extends TransientOp
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -74,7 +74,7 @@ public class AddNode extends TransientOp
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         parentState.getHierarchyEntry().complete(this);
     }
@@ -84,7 +84,7 @@ public class AddNode extends TransientOp
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         parentState.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java Wed Sep 14 20:42:58 2011
@@ -64,7 +64,7 @@ public class AddProperty extends Transie
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -73,7 +73,7 @@ public class AddProperty extends Transie
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         parentState.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java Wed Sep 14 20:42:58 2011
@@ -51,7 +51,7 @@ public class Checkin extends AbstractOpe
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -62,7 +62,7 @@ public class Checkin extends AbstractOpe
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         try {
             NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java Wed Sep 14 20:42:58 2011
@@ -58,7 +58,7 @@ public class Checkout extends AbstractOp
 
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -69,7 +69,7 @@ public class Checkout extends AbstractOp
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         try {
             NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java Wed Sep 14 20:42:58 2011
@@ -61,7 +61,7 @@ public class Checkpoint extends Abstract
 
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -72,7 +72,7 @@ public class Checkpoint extends Abstract
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         try {
             NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java Wed Sep 14 20:42:58 2011
@@ -45,7 +45,7 @@ public class Clone extends AbstractCopy 
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -54,7 +54,7 @@ public class Clone extends AbstractCopy 
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         if (removeExisting) {
             status = Status.PERSISTED;
             // invalidate the complete tree -> find root-hierarchy-entry

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java Wed Sep 14 20:42:58 2011
@@ -40,7 +40,7 @@ public class Copy extends AbstractCopy  
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateActivity.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateActivity.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateActivity.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateActivity.java Wed Sep 14 20:42:58 2011
@@ -38,7 +38,7 @@ public class CreateActivity extends Abst
 
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -49,7 +49,7 @@ public class CreateActivity extends Abst
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         
         // TODO: check if invalidation of the activity store is required.

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateConfiguration.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateConfiguration.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateConfiguration.java Wed Sep 14 20:42:58 2011
@@ -38,7 +38,7 @@ public class CreateConfiguration extends
 
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -49,7 +49,7 @@ public class CreateConfiguration extends
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
 
         // TODO: check if the configuration store needs to be invalidated.

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java Wed Sep 14 20:42:58 2011
@@ -53,7 +53,7 @@ public class LockOperation extends Abstr
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -64,7 +64,7 @@ public class LockOperation extends Abstr
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         // non-recursive invalidation
         nodeState.getHierarchyEntry().invalidate(false);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java Wed Sep 14 20:42:58 2011
@@ -40,7 +40,7 @@ public class LockRefresh extends Abstrac
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -49,7 +49,7 @@ public class LockRefresh extends Abstrac
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         // nothing to do.
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java Wed Sep 14 20:42:58 2011
@@ -43,7 +43,7 @@ public class LockRelease extends Abstrac
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -55,7 +55,7 @@ public class LockRelease extends Abstrac
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         // non-recursive invalidation but including all properties
         NodeEntry nodeEntry = nodeState.getNodeEntry();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java Wed Sep 14 20:42:58 2011
@@ -58,7 +58,7 @@ public class Merge extends AbstractOpera
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -69,7 +69,7 @@ public class Merge extends AbstractOpera
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         if (isActivityMerge()) {
             // TODO be more specific about what needs to be invalidated

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java Wed Sep 14 20:42:58 2011
@@ -81,7 +81,7 @@ public class Move extends TransientOpera
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -94,7 +94,7 @@ public class Move extends TransientOpera
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         if (sessionMove) {
             srcState.getNodeEntry().complete(this);
@@ -118,7 +118,7 @@ public class Move extends TransientOpera
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         if (sessionMove) {
             status = Status.UNDO;
             srcState.getHierarchyEntry().complete(this);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java Wed Sep 14 20:42:58 2011
@@ -56,7 +56,7 @@ public class Remove extends TransientOpe
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -65,7 +65,7 @@ public class Remove extends TransientOpe
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         parent.getHierarchyEntry().complete(this);
     }
@@ -75,7 +75,7 @@ public class Remove extends TransientOpe
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         parent.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java Wed Sep 14 20:42:58 2011
@@ -46,7 +46,7 @@ public class RemoveActivity extends Abst
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -58,7 +58,7 @@ public class RemoveActivity extends Abst
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
 
         // invalidate all references to the removed activity

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java Wed Sep 14 20:42:58 2011
@@ -66,7 +66,7 @@ public class RemoveLabel extends Abstrac
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveVersion.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveVersion.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveVersion.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveVersion.java Wed Sep 14 20:42:58 2011
@@ -50,7 +50,7 @@ public class RemoveVersion extends Abstr
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -62,7 +62,7 @@ public class RemoveVersion extends Abstr
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         // Invalidate the versionable node as well (version related properties)
         if (versionableEntry != null) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java Wed Sep 14 20:42:58 2011
@@ -57,7 +57,7 @@ public class ReorderNodes extends Transi
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -68,7 +68,7 @@ public class ReorderNodes extends Transi
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         insert.getHierarchyEntry().complete(this);
     }
@@ -78,7 +78,7 @@ public class ReorderNodes extends Transi
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         insert.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java Wed Sep 14 20:42:58 2011
@@ -48,7 +48,7 @@ public class ResolveMergeConflict extend
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -60,7 +60,7 @@ public class ResolveMergeConflict extend
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         // non-recursive invalidation BUT including all properties
         Iterator<PropertyEntry> propEntries = ((NodeEntry) nodeState.getHierarchyEntry()).getPropertyEntries();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java Wed Sep 14 20:42:58 2011
@@ -49,7 +49,7 @@ public class Restore extends AbstractOpe
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -62,7 +62,7 @@ public class Restore extends AbstractOpe
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         NodeEntry entry;
         if (nodeState == null || removeExisting) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java Wed Sep 14 20:42:58 2011
@@ -67,7 +67,7 @@ public class SetMixin extends TransientO
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -76,7 +76,7 @@ public class SetMixin extends TransientO
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         nodeState.getHierarchyEntry().complete(this);
     }
@@ -86,7 +86,7 @@ public class SetMixin extends TransientO
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         nodeState.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPrimaryType.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPrimaryType.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPrimaryType.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPrimaryType.java Wed Sep 14 20:42:58 2011
@@ -58,7 +58,7 @@ public class SetPrimaryType extends Tran
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -67,7 +67,7 @@ public class SetPrimaryType extends Tran
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         nodeState.getHierarchyEntry().complete(this);
     }
@@ -77,7 +77,7 @@ public class SetPrimaryType extends Tran
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         nodeState.getHierarchyEntry().complete(this);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java Wed Sep 14 20:42:58 2011
@@ -71,7 +71,7 @@ public class SetPropertyValue extends Tr
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -80,7 +80,7 @@ public class SetPropertyValue extends Tr
      */
     @Override
     public void persisted() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         try {
             propertyState.getHierarchyEntry().complete(this);
@@ -97,7 +97,7 @@ public class SetPropertyValue extends Tr
      */
     @Override
     public void undo() throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.UNDO;
         propertyState.getHierarchyEntry().complete(this);
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java Wed Sep 14 20:42:58 2011
@@ -42,7 +42,7 @@ public class Update extends AbstractOper
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -54,7 +54,7 @@ public class Update extends AbstractOper
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         nodeState.getHierarchyEntry().invalidate(true);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/WorkspaceImport.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/WorkspaceImport.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/WorkspaceImport.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/WorkspaceImport.java Wed Sep 14 20:42:58 2011
@@ -50,7 +50,7 @@ public class WorkspaceImport extends Abs
      */
     @Override
     public void accept(OperationVisitor visitor) throws RepositoryException {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         visitor.visit(this);
     }
 
@@ -62,7 +62,7 @@ public class WorkspaceImport extends Abs
      */
     @Override
     public void persisted() {
-        assert status == Status.PENDING;
+        assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         NodeEntry entry;
         if (uuidBehaviour == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING ||

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=1170842&r1=1170841&r2=1170842&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 Wed Sep 14 20:42:58 2011
@@ -125,7 +125,9 @@ public class PropertyState extends ItemS
     public MergeResult merge(ItemState another, boolean keepChanges) {
         boolean modified = false;
         if (another != null && another != this) {
-            assert !another.isNode();
+            if (another.isNode()) {
+                throw new IllegalArgumentException("Attempt to merge property state with node state.");
+            }
 
             PropertyDiffer result = new PropertyDiffer(data, ((PropertyState) another).data);
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/IdentifierPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/IdentifierPath.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/IdentifierPath.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/IdentifierPath.java Wed Sep 14 20:42:58 2011
@@ -29,7 +29,9 @@ final class IdentifierPath extends Abstr
     private final String identifier;
 
     public IdentifierPath(String identifier) {
-        assert identifier != null;
+        if (identifier == null) {
+            throw new IllegalArgumentException("Identifier must not be null");
+        }
         this.identifier = identifier;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java?rev=1170842&r1=1170841&r2=1170842&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java Wed Sep 14 20:42:58 2011
@@ -40,8 +40,13 @@ final class NamePath extends RelativePat
 
     public NamePath(Path parent, Name name, int index) {
         super(parent);
-        assert name != null;
-        assert index >= 0;
+        if (name == null) {
+            throw new IllegalArgumentException("Name must not be null");
+        }
+        if (index < 0) {
+            throw new IllegalArgumentException("Index must be non negative");
+        }
+
         this.name = name;
         this.index = index;
     }



Mime
View raw message