jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1092736 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
Date Fri, 15 Apr 2011 15:18:25 GMT
Author: jukka
Date: Fri Apr 15 15:18:25 2011
New Revision: 1092736

URL: http://svn.apache.org/viewvc?rev=1092736&view=rev
Log:
JCR-2944: Remove unnecessary NodeImpl references from LuceneQueryFactory

Patch by Alex Parvulescu

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java?rev=1092736&r1=1092735&r2=1092736&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactory.java
Fri Apr 15 15:18:25 2011
@@ -54,6 +54,7 @@ import java.util.List;
 import java.util.Map;
 
 import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -91,9 +92,7 @@ import org.apache.jackrabbit.commons.pre
 import org.apache.jackrabbit.commons.predicate.Predicates;
 import org.apache.jackrabbit.commons.predicate.RowPredicate;
 import org.apache.jackrabbit.commons.query.qom.OperandEvaluator;
-import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.query.lucene.join.SelectorRow;
 import org.apache.jackrabbit.core.query.lucene.join.ValueComparator;
 import org.apache.jackrabbit.spi.Name;
@@ -413,18 +412,18 @@ public class LuceneQueryFactory {
         BooleanQuery query = new BooleanQuery();
 
         try {
-            LinkedList<NodeId> ids = new LinkedList<NodeId>();
-            NodeImpl ancestor = (NodeImpl) session.getNode(dn.getAncestorPath());
-            ids.add(ancestor.getNodeId());
+            LinkedList<String> ids = new LinkedList<String>();
+            Node ancestor = session.getNode(dn.getAncestorPath());
+            ids.add(ancestor.getIdentifier());
             while (!ids.isEmpty()) {
-                String id = ids.removeFirst().toString();
+                String id = ids.removeFirst();
                 Query q = new JackrabbitTermQuery(new Term(FieldNames.PARENT, id));
                 QueryHits hits = searcher.evaluate(q);
                 ScoreNode sn = hits.nextScoreNode();
                 if (sn != null) {
                     query.add(q, SHOULD);
                     do {
-                        ids.add(sn.getNodeId());
+                        ids.add(sn.getNodeId().toString());
                         sn = hits.nextScoreNode();
                     } while (sn != null);
                 }
@@ -632,8 +631,7 @@ public class LuceneQueryFactory {
             throws RepositoryException {
         String value;
         try {
-            NodeImpl node = (NodeImpl) session.getNode(path);
-            value = node.getNodeId().toString();
+            value = session.getNode(path).getIdentifier();
         } catch (PathNotFoundException e) {
             value = "invalid-node-id"; // can never match a node
         }



Mime
View raw message