jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r448890 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state: NodeState.java PropertyState.java
Date Fri, 22 Sep 2006 11:29:34 GMT
Author: angela
Date: Fri Sep 22 04:29:33 2006
New Revision: 448890

URL: http://svn.apache.org/viewvc?view=rev&rev=448890
Log:
work in progress

ItemState.revert failed for new states

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java?view=diff&rev=448890&r1=448889&r2=448890
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
Fri Sep 22 04:29:33 2006
@@ -528,7 +528,9 @@
      * @see ItemState#revert(Set)
      */
     public void revert(Set affectedItemStates) {
-        if (overlayedState == null) {
+        // all states except for 'new' ones must have an overlayed state in order
+        // to be 'reverted'.
+        if (status != STATUS_NEW && overlayedState == null) {
             throw new IllegalStateException("revert cannot be called on workspace state");
         }
         // copy to new list, when a property is reverted it may call this node

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java?view=diff&rev=448890&r1=448889&r2=448890
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
Fri Sep 22 04:29:33 2006
@@ -108,7 +108,9 @@
      * @see ItemState#revert(Set)
      */
     public void revert(Set affectedItemStates) {
-        if (overlayedState == null) {
+        // all states except for 'new' ones must have an overlayed state in order
+        // to be 'reverted'.
+        if (status != STATUS_NEW && overlayedState == null) {
             throw new IllegalStateException("revert cannot be called on workspace state");
         }
         switch (status) {



Mime
View raw message