jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r580332 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ name/ nodetype/ observation/ query/ state/
Date Fri, 28 Sep 2007 12:44:48 GMT
Author: reschke
Date: Fri Sep 28 05:44:47 2007
New Revision: 580332

URL: http://svn.apache.org/viewvc?rev=580332&view=rev
Log:
JCR-1150: use "Integer.valueOf" instead of "new Integer", uses entry sets instead of key sets
when value is needed as well
 

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceCache.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Fri Sep 28 05:44:47 2007
@@ -613,7 +613,7 @@
                                  InternalEventListener[] lstnrs)
             throws InterruptedException {
         if (log.isDebugEnabled()) {
-            log.debug("received {} event bundles.", new Integer(eventBundles.length));
+            log.debug("received {} event bundles.", Integer.valueOf(eventBundles.length));
             for (int i = 0; i < eventBundles.length; i++) {
                 log.debug("BundleId: {}", eventBundles[i].getBundleId());
                 log.debug("IsLocal:  {}", Boolean.valueOf(eventBundles[i].isLocal()));

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceCache.java?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceCache.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceCache.java
Fri Sep 28 05:44:47 2007
@@ -188,10 +188,9 @@
         prefixToURI.clear();
         prefixToURI.putAll(namespaces);
         uriToPrefix.clear();
-        for (Iterator it = namespaces.keySet().iterator(); it.hasNext(); ) {
-            String prefix = (String) it.next();
-            String uri = (String) namespaces.get(prefix);
-            uriToPrefix.put(uri, prefix);
+        for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) {
+            Map.Entry entry = (Map.Entry) it.next();
+            uriToPrefix.put(entry.getKey(), entry.getValue());
         }
     }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
Fri Sep 28 05:44:47 2007
@@ -174,7 +174,7 @@
                 i = (Integer) nameIndex.get(name);
                 if (i == null) {
                     int idx = nameIndex.size();
-                    i = new Integer(idx);
+                    i = Integer.valueOf(idx);
                     nameIndex.put(name, i);
                     if (idx >= names.length) {
                         QName[] newNames = new QName[names.length*2];

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
Fri Sep 28 05:44:47 2007
@@ -518,10 +518,10 @@
     }
 
     private void internalRegister(Map defMap) {
-        Iterator it = defMap.keySet().iterator();
-        while (it.hasNext()) {
-            QNodeTypeDefinition ntd = (QNodeTypeDefinition)it.next();
-            internalRegister(ntd, (EffectiveNodeTypeImpl)defMap.get(ntd));
+        for (Iterator it = defMap.entrySet().iterator(); it.hasNext(); ) {
+            Map.Entry entry = (Map.Entry)it.next();
+            QNodeTypeDefinition ntd = (QNodeTypeDefinition)entry.getKey();
+            internalRegister(ntd, (EffectiveNodeTypeImpl)entry.getValue());
         }
     }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
Fri Sep 28 05:44:47 2007
@@ -184,9 +184,10 @@
             ensureReadOnlyMap();
             activeListeners = readOnlySubscriptions;
         }
-        for (Iterator it = activeListeners.keySet().iterator(); it.hasNext(); ) {
-            EventListener listener = (EventListener) it.next();
-            EventFilter filter = (EventFilter) activeListeners.get(listener);
+        for (Iterator it = activeListeners.entrySet().iterator(); it.hasNext(); ) {
+            Map.Entry entry = (Map.Entry) it.next();
+            EventListener listener = (EventListener) entry.getKey();
+            EventFilter filter = (EventFilter) entry.getValue();
             FilteredEventIterator eventIter = new FilteredEventIterator(eventBundle, filter,
nsResolver);
             if (eventIter.hasNext()) {
                 try {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
Fri Sep 28 05:44:47 2007
@@ -244,7 +244,7 @@
                 // create the map first
                 Map tmp = new HashMap();
                 for (int i = 0; i < columnNames.length; i++) {
-                    tmp.put(columnNames[i], new Integer(i));
+                    tmp.put(columnNames[i], Integer.valueOf(i));
                 }
                 propertyMap = tmp;
             }

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?rev=580332&r1=580331&r2=580332&view=diff
==============================================================================
--- 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 28 05:44:47 2007
@@ -270,9 +270,10 @@
         /* process all parent states that are marked modified and eventually
            need their uniqueID or mixin-types being adjusted because that property
            has been added, modified or removed */
-        for (Iterator it = modParents.keySet().iterator(); it.hasNext();) {
-            NodeState parent = (NodeState) it.next();
-            List l = (List) modParents.get(parent);
+        for (Iterator it = modParents.entrySet().iterator(); it.hasNext();) {
+            Map.Entry entry = (Map.Entry) it.next();
+            NodeState parent = (NodeState) entry.getKey();
+            List l = (List) entry.getValue();
             adjustNodeState(parent, (PropertyState[]) l.toArray(new PropertyState[l.size()]));
         }
 



Mime
View raw message