jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r501583 - /jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Date Tue, 30 Jan 2007 21:43:32 GMT
Author: jukka
Date: Tue Jan 30 13:43:31 2007
New Revision: 501583

URL: http://svn.apache.org/viewvc?view=rev&rev=501583
Log:
1.2: Merged revision 497809 (JCR-713)

Modified:
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?view=diff&rev=501583&r1=501582&r2=501583
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
(original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Tue Jan 30 13:43:31 2007
@@ -905,7 +905,6 @@
         eventChannel.setListener(this);
     }
 
-
     /**
      * @param ntName
      * @param entCache
@@ -1741,12 +1740,8 @@
     private void notifyRegistered(QName ntName) {
         // copy listeners to array to avoid ConcurrentModificationException
         NodeTypeRegistryListener[] la =
-                new NodeTypeRegistryListener[listeners.size()];
-        Iterator iter = listeners.values().iterator();
-        int cnt = 0;
-        while (iter.hasNext()) {
-            la[cnt++] = (NodeTypeRegistryListener) iter.next();
-        }
+                (NodeTypeRegistryListener[]) listeners.values().toArray(
+                        new NodeTypeRegistryListener[listeners.size()]); 
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {
                 la[i].nodeTypeRegistered(ntName);
@@ -1760,12 +1755,8 @@
     private void notifyReRegistered(QName ntName) {
         // copy listeners to array to avoid ConcurrentModificationException
         NodeTypeRegistryListener[] la =
-                new NodeTypeRegistryListener[listeners.size()];
-        Iterator iter = listeners.values().iterator();
-        int cnt = 0;
-        while (iter.hasNext()) {
-            la[cnt++] = (NodeTypeRegistryListener) iter.next();
-        }
+                (NodeTypeRegistryListener[]) listeners.values().toArray(
+                        new NodeTypeRegistryListener[listeners.size()]);
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {
                 la[i].nodeTypeReRegistered(ntName);
@@ -1779,12 +1770,8 @@
     private void notifyUnregistered(QName ntName) {
         // copy listeners to array to avoid ConcurrentModificationException
         NodeTypeRegistryListener[] la =
-                new NodeTypeRegistryListener[listeners.size()];
-        Iterator iter = listeners.values().iterator();
-        int cnt = 0;
-        while (iter.hasNext()) {
-            la[cnt++] = (NodeTypeRegistryListener) iter.next();
-        }
+                (NodeTypeRegistryListener[]) listeners.values().toArray(
+                        new NodeTypeRegistryListener[listeners.size()]);
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {
                 la[i].nodeTypeUnregistered(ntName);



Mime
View raw message