jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1156998 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: NodeImpl.java SessionImpl.java
Date Fri, 12 Aug 2011 08:12:39 GMT
Author: angela
Date: Fri Aug 12 08:12:38 2011
New Revision: 1156998

URL: http://svn.apache.org/viewvc?rev=1156998&view=rev
Log:
minor improvement: add checks for repo-options, remove unused imports

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=1156998&r1=1156997&r2=1156998&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Fri Aug 12 08:12:38 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.commons.AbstractProperty;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.lock.LockStateManager;
@@ -65,10 +64,8 @@ import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
 import javax.jcr.PropertyIterator;
 import javax.jcr.PropertyType;
-import javax.jcr.ReferentialIntegrityException;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
@@ -78,7 +75,6 @@ import javax.jcr.nodetype.ConstraintViol
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.PropertyDefinition;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionException;
 import javax.jcr.version.VersionHistory;
@@ -1268,6 +1264,8 @@ public class NodeImpl extends ItemImpl i
      * @see javax.jcr.Node#followLifecycleTransition(String)
      */
     public void followLifecycleTransition(String transition) throws RepositoryException {
+        session.checkSupportedOption(Repository.OPTION_LIFECYCLE_SUPPORTED);
+
         // TODO: implementation missing
         throw new UnsupportedRepositoryOperationException("JCR-1104");
     }
@@ -1276,6 +1274,8 @@ public class NodeImpl extends ItemImpl i
      * @see javax.jcr.Node#getAllowedLifecycleTransistions()
      */
     public String[] getAllowedLifecycleTransistions() throws RepositoryException {
+        session.checkSupportedOption(Repository.OPTION_LIFECYCLE_SUPPORTED);
+        
         // TODO: implementation missing
         throw new UnsupportedRepositoryOperationException("JCR-1104");
     }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=1156998&r1=1156997&r2=1156998&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Fri Aug 12 08:12:38 2011
@@ -675,9 +675,9 @@ public class SessionImpl extends Abstrac
     private void notifyLoggingOut() {
         // copy listeners to array to avoid ConcurrentModificationException
         SessionListener[] la = listeners.values().toArray(new SessionListener[listeners.size()]);
-        for (int i = 0; i < la.length; i++) {
-            if (la[i] != null) {
-                la[i].loggingOut(this);
+        for (SessionListener sl : la) {
+            if (sl != null) {
+                sl.loggingOut(this);
             }
         }
     }
@@ -688,9 +688,9 @@ public class SessionImpl extends Abstrac
     private void notifyLoggedOut() {
         // copy listeners to array to avoid ConcurrentModificationException
         SessionListener[] la = listeners.values().toArray(new SessionListener[listeners.size()]);
-        for (int i = 0; i < la.length; i++) {
-            if (la[i] != null) {
-                la[i].loggedOut(this);
+        for (SessionListener sl : la) {
+            if (sl != null) {
+                sl.loggedOut(this);
             }
         }
     }
@@ -1042,7 +1042,7 @@ public class SessionImpl extends Abstrac
          */
         public void checkFormat(String identifier) throws MalformedPathException {
             try {
-                NodeId id = getIdFactory().fromJcrIdentifier(identifier);
+                getIdFactory().fromJcrIdentifier(identifier);
             } catch (Exception e) {
                 throw new MalformedPathException("Invalid identifier '" + identifier + "'.");
             }



Mime
View raw message