jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792453 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: SearchManager.java query/AbstractQueryHandler.java query/QueryHandler.java query/lucene/SearchIndex.java state/NodeStateIterator.java
Date Thu, 09 Jul 2009 08:45:07 GMT
Author: jukka
Date: Thu Jul  9 08:45:06 2009
New Revision: 792453

URL: http://svn.apache.org/viewvc?rev=792453&view=rev
Log:
JCR-2087: Upgrade to Java 5 as the base platform

Use Iterator<NodeState> instead of NodeStateIterator

Removed:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateIterator.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java?rev=792453&r1=792452&r2=792453&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
Thu Jul  9 08:45:06 2009
@@ -23,7 +23,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Set;
 
 import javax.jcr.NamespaceException;
@@ -49,7 +48,6 @@
 import org.apache.jackrabbit.core.query.QueryObjectModelImpl;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.core.state.NodeStateIterator;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
@@ -425,8 +423,8 @@
             }
         }
 
-        NodeStateIterator addedStates = new NodeStateIterator() {
-            private final Iterator iter = addedNodes.keySet().iterator();
+        Iterator<NodeState> addedStates = new Iterator<NodeState>() {
+            private final Iterator<NodeId> iter = addedNodes.keySet().iterator();
 
             public void remove() {
                 throw new UnsupportedOperationException();
@@ -437,10 +435,6 @@
             }
 
             public NodeState next() {
-                return nextNodeState();
-            }
-
-            public NodeState nextNodeState() {
                 NodeState item = null;
                 NodeId id = (NodeId) iter.next();
                 try {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java?rev=792453&r1=792452&r2=792453&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java
Thu Jul  9 08:45:06 2009
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.query;
 
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.state.NodeStateIterator;
+import org.apache.jackrabbit.core.state.NodeState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -96,13 +96,14 @@
      * @throws RepositoryException if an error occurs while indexing a node.
      * @throws IOException if an error occurs while updating the index.
      */
-    public synchronized void updateNodes(Iterator<NodeId> remove, NodeStateIterator
add)
+    public synchronized void updateNodes(
+            Iterator<NodeId> remove, Iterator<NodeState> add)
             throws RepositoryException, IOException {
         while (remove.hasNext()) {
             deleteNode(remove.next());
         }
         while (add.hasNext()) {
-            addNode(add.nextNodeState());
+            addNode(add.next());
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java?rev=792453&r1=792452&r2=792453&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandler.java
Thu Jul  9 08:45:06 2009
@@ -20,7 +20,6 @@
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.core.state.NodeStateIterator;
 import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
 
 import javax.jcr.RepositoryException;
@@ -80,7 +79,7 @@
      * @throws RepositoryException if an error occurs while indexing a node.
      * @throws IOException if an error occurs while updating the index.
      */
-    void updateNodes(Iterator<NodeId> remove, NodeStateIterator add)
+    void updateNodes(Iterator<NodeId> remove, Iterator<NodeState> add)
             throws RepositoryException, IOException;
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=792453&r1=792452&r2=792453&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Thu Jul  9 08:45:06 2009
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.core.query.lucene.directory.DirectoryManager;
 import org.apache.jackrabbit.core.query.lucene.directory.FSDirectoryManager;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.core.state.NodeStateIterator;
 import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.ItemStateException;
@@ -592,7 +591,7 @@
      * @throws RepositoryException if an error occurs while indexing a node.
      * @throws IOException         if an error occurs while updating the index.
      */
-    public void updateNodes(Iterator<NodeId> remove, NodeStateIterator add)
+    public void updateNodes(Iterator<NodeId> remove, Iterator<NodeState> add)
             throws RepositoryException, IOException {
         checkOpen();
 
@@ -609,7 +608,7 @@
 
         Collection<Document> addCollection = new ArrayList<Document>();
         while (add.hasNext()) {
-            NodeState state = add.nextNodeState();
+            NodeState state = add.next();
             if (state != null) {
                 UUID uuid = state.getNodeId().getUUID();
                 addedUUIDs.add(uuid);



Mime
View raw message