You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by an...@apache.org on 2010/02/25 01:25:23 UTC

svn commit: r916058 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java

Author: angela
Date: Thu Feb 25 00:25:23 2010
New Revision: 916058

URL: http://svn.apache.org/viewvc?rev=916058&view=rev
Log:
minor improvement

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

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=916058&r1=916057&r2=916058&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java Thu Feb 25 00:25:23 2010
@@ -286,9 +286,8 @@
      * @see SessionInfo#removeLockToken(String)
      */
     public void removeLockToken(String lt) throws UnsupportedRepositoryOperationException, LockException, RepositoryException {
-        String[] tokems = sessionInfo.getLockTokens();
-        for (int i = 0; i < tokems.length; i++) {
-            if (tokems[i].equals(lt)) {
+        for (String token : sessionInfo.getLockTokens()) {
+            if (token.equals(lt)) {
                 sessionInfo.removeLockToken(lt);
                 return;
             }
@@ -693,9 +692,8 @@
      * @see AccessManager#canAccess(String)
      */
     public boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException {
-        String[] wspNames = getWorkspaceNames();
-        for (int i = 0; i < wspNames.length; i++) {
-            if (wspNames[i].equals(workspaceName)) {
+        for (String wspName : getWorkspaceNames()) {
+            if (wspName.equals(workspaceName)) {
                 return true;
             }
         }
@@ -738,10 +736,10 @@
                                  InternalEventListener[] lstnrs)
             throws InterruptedException {
         if (log.isDebugEnabled()) {
-            log.debug("received {} event bundles.", new Integer(eventBundles.length));
-            for (int i = 0; i < eventBundles.length; i++) {
-                log.debug("IsLocal:  {}", Boolean.valueOf(eventBundles[i].isLocal()));
-                for (Iterator<Event> it = eventBundles[i].getEvents(); it.hasNext(); ) {
+            log.debug("received {} event bundles.", eventBundles.length);
+            for (EventBundle eventBundle : eventBundles) {
+                log.debug("IsLocal:  {}", eventBundle.isLocal());
+                for (Iterator<Event> it = eventBundle.getEvents(); it.hasNext();) {
                     Event e = it.next();
                     String type;
                     switch (e.getType()) {
@@ -778,9 +776,9 @@
         updateSync.acquire();
         try {
             // notify listener
-            for (int i = 0; i < eventBundles.length; i++) {
-                for (int j = 0; j < lstnrs.length; j++) {
-                    lstnrs[j].onEvent(eventBundles[i]);
+            for (EventBundle eventBundle : eventBundles) {
+                for (InternalEventListener lstnr : lstnrs) {
+                    lstnr.onEvent(eventBundle);
                 }
             }
         } finally {