jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r677226 - in /jackrabbit/trunk: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/...
Date Wed, 16 Jul 2008 10:11:30 GMT
Author: mreutegg
Date: Wed Jul 16 03:11:29 2008
New Revision: 677226

URL: http://svn.apache.org/viewvc?rev=677226&view=rev
Log:
JCR-1674: Provide means for exception handling for QueryNodeVisitor implementations

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/AndQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeVisitor.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DerefQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/ExactQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/LocationStepQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NAryQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NodeTypeQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NotQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeDump.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/QueryFormat.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/SimpleNode.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java Wed Jul 16 03:11:29 2008
@@ -16,12 +16,26 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeIterator;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.query.InvalidQueryException;
+
 import org.apache.jackrabbit.core.HierarchyManager;
 import org.apache.jackrabbit.core.HierarchyManagerImpl;
 import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.SearchManager;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.query.PropertyTypeRegistry;
 import org.apache.jackrabbit.core.query.lucene.fulltext.ParseException;
 import org.apache.jackrabbit.core.query.lucene.fulltext.QueryParser;
@@ -55,26 +69,13 @@
 import org.apache.jackrabbit.util.XMLChar;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.BooleanClause.Occur;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.NamespaceException;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.NodeTypeIterator;
-import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.query.InvalidQueryException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * Implements a query builder that takes an abstract query tree and creates
  * a lucene {@link org.apache.lucene.search.Query} tree that can be executed
@@ -91,57 +92,57 @@
     /**
      * Root node of the abstract query tree
      */
-    private QueryRootNode root;
+    private final QueryRootNode root;
 
     /**
      * Session of the user executing this query
      */
-    private SessionImpl session;
+    private final SessionImpl session;
 
     /**
      * The shared item state manager of the workspace.
      */
-    private ItemStateManager sharedItemMgr;
+    private final ItemStateManager sharedItemMgr;
 
     /**
      * A hierarchy manager based on {@link #sharedItemMgr} to resolve paths.
      */
-    private HierarchyManager hmgr;
+    private final HierarchyManager hmgr;
 
     /**
      * Namespace mappings to internal prefixes
      */
-    private NamespaceMappings nsMappings;
+    private final NamespaceMappings nsMappings;
 
     /**
      * Name and Path resolver
      */
-    private NamePathResolver resolver;
+    private final NamePathResolver resolver;
 
     /**
      * The analyzer instance to use for contains function query parsing
      */
-    private Analyzer analyzer;
+    private final Analyzer analyzer;
 
     /**
      * The property type registry.
      */
-    private PropertyTypeRegistry propRegistry;
+    private final PropertyTypeRegistry propRegistry;
 
     /**
      * The synonym provider or <code>null</code> if none is configured.
      */
-    private SynonymProvider synonymProvider;
+    private final SynonymProvider synonymProvider;
 
     /**
      * Wether the index format is new or old.
      */
-    private IndexFormatVersion indexFormatVersion;
+    private final IndexFormatVersion indexFormatVersion;
 
     /**
      * Exceptions thrown during tree translation
      */
-    private List exceptions = new ArrayList();
+    private final List exceptions = new ArrayList();
 
     /**
      * Creates a new <code>LuceneQueryBuilder</code> instance.
@@ -230,14 +231,15 @@
      * {@link org.apache.lucene.search.Query}.
      *
      * @return the lucene <code>Query</code>.
+     * @throws RepositoryException
      */
-    private Query createLuceneQuery() {
+    private Query createLuceneQuery() throws RepositoryException {
         return (Query) root.accept(this, null);
     }
 
     //---------------------< QueryNodeVisitor interface >-----------------------
 
-    public Object visit(QueryRootNode node, Object data) {
+    public Object visit(QueryRootNode node, Object data) throws RepositoryException {
         BooleanQuery root = new BooleanQuery();
 
         Query wrapped = root;
@@ -248,7 +250,7 @@
         return wrapped;
     }
 
-    public Object visit(OrQueryNode node, Object data) {
+    public Object visit(OrQueryNode node, Object data) throws RepositoryException {
         BooleanQuery orQuery = new BooleanQuery();
         Object[] result = node.acceptOperands(this, null);
         for (int i = 0; i < result.length; i++) {
@@ -258,7 +260,7 @@
         return orQuery;
     }
 
-    public Object visit(AndQueryNode node, Object data) {
+    public Object visit(AndQueryNode node, Object data) throws RepositoryException {
         Object[] result = node.acceptOperands(this, null);
         if (result.length == 0) {
             return null;
@@ -271,7 +273,7 @@
         return andQuery;
     }
 
-    public Object visit(NotQueryNode node, Object data) {
+    public Object visit(NotQueryNode node, Object data) throws RepositoryException {
         Object[] result = node.acceptOperands(this, null);
         if (result.length == 0) {
             return data;
@@ -449,7 +451,7 @@
         return null;
     }
 
-    public Object visit(PathQueryNode node, Object data) {
+    public Object visit(PathQueryNode node, Object data) throws RepositoryException {
         Query context = null;
         LocationStepQueryNode[] steps = node.getPathSteps();
         if (steps.length > 0) {
@@ -495,7 +497,7 @@
         return context;
     }
 
-    public Object visit(LocationStepQueryNode node, Object data) {
+    public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException {
         Query context = (Query) data;
         BooleanQuery andQuery = new BooleanQuery();
 
@@ -578,7 +580,7 @@
         return andQuery;
     }
 
-    public Object visit(DerefQueryNode node, Object data) {
+    public Object visit(DerefQueryNode node, Object data) throws RepositoryException {
         Query context = (Query) data;
         if (context == null) {
             exceptions.add(new IllegalArgumentException("Unsupported query"));
@@ -614,7 +616,7 @@
         return context;
     }
 
-    public Object visit(RelationQueryNode node, Object data) {
+    public Object visit(RelationQueryNode node, Object data) throws RepositoryException {
         Query query;
         String[] stringValues = new String[1];
         switch (node.getValueType()) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,15 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.query.QueryResult;
+
 import org.apache.jackrabbit.core.ItemManager;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
@@ -32,17 +41,9 @@
 import org.apache.jackrabbit.spi.commons.query.QueryNodeFactory;
 import org.apache.jackrabbit.spi.commons.query.QueryParser;
 import org.apache.jackrabbit.spi.commons.query.QueryRootNode;
+import org.apache.lucene.search.Query;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.lucene.search.Query;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.PropertyDefinition;
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.query.QueryResult;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
 
 /**
  * Implements the {@link org.apache.jackrabbit.core.query.ExecutableQuery}
@@ -149,7 +150,7 @@
             final Name[] ntName = new Name[1];
             steps[steps.length - 1].acceptOperands(new DefaultQueryNodeVisitor() {
 
-                public Object visit(AndQueryNode node, Object data) {
+                public Object visit(AndQueryNode node, Object data) throws RepositoryException {
                     return node.acceptOperands(this, data);
                 }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/AndQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/AndQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/AndQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/AndQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Implements a query node that defines an AND operation between arbitrary
  * other {@link QueryNode}s.
@@ -36,8 +38,9 @@
      * This method can return <code>null</code> to indicate that this
      * <code>AndQueryNode</code> does not contain any operands.
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeVisitor.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeVisitor.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeVisitor.java Wed Jul 16 03:11:29 2008
@@ -16,61 +16,63 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Implements the <code>QueryNodeVisitor</code> interface with default behaviour.
  * All methods are no-ops and return the <code>data</code> argument.
  */
 public class DefaultQueryNodeVisitor implements QueryNodeVisitor {
 
-    public Object visit(QueryRootNode node, Object data) {
+    public Object visit(QueryRootNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(OrQueryNode node, Object data) {
+    public Object visit(OrQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(AndQueryNode node, Object data) {
+    public Object visit(AndQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(NotQueryNode node, Object data) {
+    public Object visit(NotQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(ExactQueryNode node, Object data) {
+    public Object visit(ExactQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(NodeTypeQueryNode node, Object data) {
+    public Object visit(NodeTypeQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(TextsearchQueryNode node, Object data) {
+    public Object visit(TextsearchQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(PathQueryNode node, Object data) {
+    public Object visit(PathQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(LocationStepQueryNode node, Object data) {
+    public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(RelationQueryNode node, Object data) {
+    public Object visit(RelationQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(OrderQueryNode node, Object data) {
+    public Object visit(OrderQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(DerefQueryNode node, Object data) {
+    public Object visit(DerefQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 
-    public Object visit(PropertyFunctionQueryNode node, Object data) {
+    public Object visit(PropertyFunctionQueryNode node, Object data) throws RepositoryException {
         return data;
     }
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DerefQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DerefQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DerefQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DerefQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
 
 /**
@@ -69,8 +71,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/ExactQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/ExactQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/ExactQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/ExactQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
 
 /**
@@ -52,8 +54,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/LocationStepQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/LocationStepQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/LocationStepQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/LocationStepQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,8 +16,10 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
-import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 
 /**
  * Defines a location step for querying the path of a node.
@@ -156,8 +158,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NAryQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NAryQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NAryQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NAryQueryNode.java Wed Jul 16 03:11:29 2008
@@ -21,6 +21,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Defines an abstract query node for nodes that have child nodes.
  */
@@ -129,8 +131,9 @@
      * @param visitor the visitor to call back.
      * @param data    arbitrary data for the visitor.
      * @return the return values of the <code>visitor.visit()</code> calls.
+     * @throws RepositoryException
      */
-    public Object[] acceptOperands(QueryNodeVisitor visitor, Object data) {
+    public Object[] acceptOperands(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         if (operands == null) {
             return EMPTY;
         }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NodeTypeQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NodeTypeQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NodeTypeQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NodeTypeQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,8 +16,10 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
 
 /**
  * Implements a query node that defines a node type match.
@@ -39,8 +41,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NotQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NotQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NotQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NotQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Implements a query node that defines a not operation on the child query.
  */
@@ -32,8 +34,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Implements a query node that defines an OR operation between arbitrary
  * other {@link QueryNode}s.
@@ -34,8 +36,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/OrderQueryNode.java Wed Jul 16 03:11:29 2008
@@ -19,6 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
 
 /**
@@ -73,8 +75,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 
@@ -123,7 +126,7 @@
         /**
          * The name of the property
          */
-        private Name property;
+        private final Name property;
 
         /**
          * If <code>true</code> this property is orderd ascending

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java Wed Jul 16 03:11:29 2008
@@ -18,8 +18,10 @@
 
 import java.util.List;
 
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
 
 /**
  * Implements a query node that defines a path restriction.
@@ -63,8 +65,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,9 +16,11 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
-import java.util.Set;
-import java.util.HashSet;
 import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
 
 /**
  * <code>PropertyFunctionQueryNode</code> allows to place function calls on properties
@@ -81,8 +83,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Implements an abstract base class for nodes of a query tree that represents
  * a query. The query tree is independent from the query syntax which is used
@@ -66,7 +68,7 @@
      * References the parent of this <code>QueryNode</code>. If this is the root
      * of a query tree, then <code>parent</code> is <code>null</code>.
      */
-    private QueryNode parent;
+    private final QueryNode parent;
 
     /**
      * Constructs a new <code>QueryNode</code> with a reference to it's parent.
@@ -92,8 +94,9 @@
     /**
      * Dumps this QueryNode and its child nodes to a String.
      * @return the query tree as a String.
+     * @throws RepositoryException
      */
-    public String dump() {
+    public String dump() throws RepositoryException {
         StringBuffer tmp = new StringBuffer();
         QueryTreeDump.dump(this, tmp);
         return tmp.toString();
@@ -107,8 +110,9 @@
      * @param visitor the visitor to call back.
      * @param data    arbitrary data for the visitor.
      * @return the return value of the <code>visitor.visit()</code> call.
+     * @throws RepositoryException
      */
-    public abstract Object accept(QueryNodeVisitor visitor, Object data);
+    public abstract Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException;
 
     /**
      * Returns the type of this query node.

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java Wed Jul 16 03:11:29 2008
@@ -16,34 +16,36 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Defines the interface for a <code>QueryNodeVisitor</code>.
  */
 public interface QueryNodeVisitor {
 
-    Object visit(QueryRootNode node, Object data);
+    Object visit(QueryRootNode node, Object data) throws RepositoryException;
 
-    Object visit(OrQueryNode node, Object data);
+    Object visit(OrQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(AndQueryNode node, Object data);
+    Object visit(AndQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(NotQueryNode node, Object data);
+    Object visit(NotQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(ExactQueryNode node, Object data);
+    Object visit(ExactQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(NodeTypeQueryNode node, Object data);
+    Object visit(NodeTypeQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(TextsearchQueryNode node, Object data);
+    Object visit(TextsearchQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(PathQueryNode node, Object data);
+    Object visit(PathQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(LocationStepQueryNode node, Object data);
+    Object visit(LocationStepQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(RelationQueryNode node, Object data);
+    Object visit(RelationQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(OrderQueryNode node, Object data);
+    Object visit(OrderQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(DerefQueryNode node, Object data);
+    Object visit(DerefQueryNode node, Object data) throws RepositoryException;
 
-    Object visit(PropertyFunctionQueryNode node, Object data);
+    Object visit(PropertyFunctionQueryNode node, Object data) throws RepositoryException;
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java Wed Jul 16 03:11:29 2008
@@ -19,6 +19,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
 
 /**
@@ -35,7 +37,7 @@
      * The list of property names (as {@link org.apache.jackrabbit.spi.Name}s
      * to select.
      */
-    private List selectProperties = new ArrayList();
+    private final List selectProperties = new ArrayList();
 
     /**
      * The list of property names to order the result nodes. Might be null
@@ -107,8 +109,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeDump.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeDump.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeDump.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeDump.java Wed Jul 16 03:11:29 2008
@@ -18,6 +18,8 @@
 
 import java.util.Arrays;
 
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 
@@ -49,8 +51,9 @@
      * Dumps the node tree to buffer.
      * @param node the root node.
      * @param buffer where to dump the tree.
+     * @throws RepositoryException
      */
-    private QueryTreeDump(QueryNode node, StringBuffer buffer) {
+    private QueryTreeDump(QueryNode node, StringBuffer buffer) throws RepositoryException {
         node.accept(this, buffer);
     }
 
@@ -58,12 +61,13 @@
      * Dumps a query node tree to the string <code>buffer</code>.
      * @param node the root node of a query tree.
      * @param buffer a string buffer where to dump the tree structure.
+     * @throws RepositoryException
      */
-    public static void dump(QueryNode node, StringBuffer buffer) {
+    public static void dump(QueryNode node, StringBuffer buffer) throws RepositoryException {
         new QueryTreeDump(node, buffer);
     }
 
-    public Object visit(QueryRootNode node, Object data) {
+    public Object visit(QueryRootNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append("+ Root node");
         buffer.append("\n");
@@ -91,7 +95,7 @@
         return buffer;
     }
 
-    public Object visit(OrQueryNode node, Object data) {
+    public Object visit(OrQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ OrQueryNode");
@@ -100,7 +104,7 @@
         return buffer;
     }
 
-    public Object visit(AndQueryNode node, Object data) {
+    public Object visit(AndQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ AndQueryNode");
@@ -109,7 +113,7 @@
         return buffer;
     }
 
-    public Object visit(NotQueryNode node, Object data) {
+    public Object visit(NotQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ NotQueryNode");
@@ -163,7 +167,7 @@
         return buffer;
     }
 
-    public Object visit(PathQueryNode node, Object data) {
+    public Object visit(PathQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ PathQueryNode");
@@ -172,7 +176,7 @@
         return buffer;
     }
 
-    public Object visit(LocationStepQueryNode node, Object data) {
+    public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ LocationStepQueryNode: ");
@@ -196,7 +200,7 @@
         return buffer;
     }
 
-    public Object visit(RelationQueryNode node, Object data) {
+    public Object visit(RelationQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ RelationQueryNode: Op: ");
@@ -290,7 +294,7 @@
         return buffer;
     }
 
-    public Object visit(DerefQueryNode node, Object data) {
+    public Object visit(DerefQueryNode node, Object data) throws RepositoryException {
         StringBuffer buffer = (StringBuffer) data;
         buffer.append(PADDING, 0, indent);
         buffer.append("+ DerefQueryNode: ");
@@ -323,7 +327,7 @@
         return buffer;
     }
 
-    private void traverse(QueryNode[] node, StringBuffer buffer) {
+    private void traverse(QueryNode[] node, StringBuffer buffer) throws RepositoryException {
         indent += 2;
         if (indent > PADDING.length) {
             char[] tmp = new char[indent * 2];

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java Wed Jul 16 03:11:29 2008
@@ -20,11 +20,11 @@
 
 import javax.jcr.RepositoryException;
 
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.PathBuilder;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.Path;
 
 /**
  * Implements a query node that defines property value relation.
@@ -82,7 +82,7 @@
      * The operation type of this relation. One of the operation values defined
      * in {@link QueryConstants}.
      */
-    private int operation;
+    private final int operation;
 
     /**
      * The value type of this relation. One of {@link #TYPE_DATE}, {@link
@@ -103,8 +103,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java Wed Jul 16 03:11:29 2008
@@ -16,10 +16,12 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.name.PathBuilder;
-import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.Name;
 
 /**
  * Implements a query node that defines a textsearch clause.
@@ -62,8 +64,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws RepositoryException
      */
-    public Object accept(QueryNodeVisitor visitor, Object data) {
+    public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
         return visitor.visit(this, data);
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java Wed Jul 16 03:11:29 2008
@@ -16,21 +16,23 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
+import javax.jcr.RepositoryException;
+
 /**
  * <code>TraversingQueryNodeVisitor</code> implements a base class for a
  * traversing query node visitor.
  */
 public class TraversingQueryNodeVisitor extends DefaultQueryNodeVisitor {
 
-    public Object visit(OrQueryNode node, Object data) {
+    public Object visit(OrQueryNode node, Object data) throws RepositoryException {
         return node.acceptOperands(this, data);
     }
 
-    public Object visit(AndQueryNode node, Object data) {
+    public Object visit(AndQueryNode node, Object data) throws RepositoryException {
         return node.acceptOperands(this, data);
     }
 
-    public Object visit(QueryRootNode node, Object data) {
+    public Object visit(QueryRootNode node, Object data) throws RepositoryException {
         PathQueryNode pathNode = node.getLocationNode();
         if (pathNode != null) {
             pathNode.accept(this, data);
@@ -42,19 +44,19 @@
         return data;
     }
 
-    public Object visit(NotQueryNode node, Object data) {
+    public Object visit(NotQueryNode node, Object data) throws RepositoryException {
         return node.acceptOperands(this, data);
     }
 
-    public Object visit(PathQueryNode node, Object data) {
+    public Object visit(PathQueryNode node, Object data) throws RepositoryException {
         return node.acceptOperands(this, data);
     }
 
-    public Object visit(LocationStepQueryNode node, Object data) {
+    public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException {
         return node.acceptOperands(this, data);
     }
 
-    public Object visit(DerefQueryNode node, Object data) {
+    public Object visit(DerefQueryNode node, Object data) throws RepositoryException {
         return node.acceptOperands(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/QueryFormat.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,19 @@
  */
 package org.apache.jackrabbit.spi.commons.query.sql;
 
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TimeZone;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
+import javax.jcr.query.InvalidQueryException;
+
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.query.AndQueryNode;
 import org.apache.jackrabbit.spi.commons.query.DerefQueryNode;
@@ -33,18 +46,7 @@
 import org.apache.jackrabbit.spi.commons.query.QueryRootNode;
 import org.apache.jackrabbit.spi.commons.query.RelationQueryNode;
 import org.apache.jackrabbit.spi.commons.query.TextsearchQueryNode;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.util.ISO8601;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.NamespaceException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Iterator;
-import java.util.List;
-import java.util.TimeZone;
 
 /**
  * Implements the query node tree serialization into a String.
@@ -59,20 +61,20 @@
     /**
      * The String representation of the query node tree
      */
-    private String statement;
+    private final String statement;
 
     /**
      * List of exception objects created while creating the SQL string
      */
-    private List exceptions = new ArrayList();
+    private final List exceptions = new ArrayList();
 
     /**
      * List of node types
      */
-    private List nodeTypes = new ArrayList();
+    private final List nodeTypes = new ArrayList();
 
     private QueryFormat(QueryRootNode root, NameResolver resolver)
-            throws InvalidQueryException {
+            throws RepositoryException {
         this.resolver = resolver;
         statement = root.accept(this, new StringBuffer()).toString();
         if (exceptions.size() > 0) {
@@ -93,7 +95,12 @@
      */
     public static String toString(QueryRootNode root, NameResolver resolver)
             throws InvalidQueryException {
-        return new QueryFormat(root, resolver).toString();
+        try {
+            return new QueryFormat(root, resolver).toString();
+        }
+        catch (RepositoryException e) {
+            throw new InvalidQueryException(e);
+        }
     }
 
     /**
@@ -107,7 +114,7 @@
 
     //-------------< QueryNodeVisitor interface >-------------------------------
 
-    public Object visit(QueryRootNode node, Object data) {
+    public Object visit(QueryRootNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         try {
             sb.append("SELECT");
@@ -192,7 +199,7 @@
         return sb;
     }
 
-    public Object visit(OrQueryNode node, Object data) {
+    public Object visit(OrQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         boolean bracket = false;
         if (node.getParent() instanceof LocationStepQueryNode
@@ -216,7 +223,7 @@
         return sb;
     }
 
-    public Object visit(AndQueryNode node, Object data) {
+    public Object visit(AndQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         boolean bracket = false;
         if (node.getParent() instanceof NotQueryNode) {
@@ -245,7 +252,7 @@
         return sb;
     }
 
-    public Object visit(NotQueryNode node, Object data) {
+    public Object visit(NotQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         QueryNode[] operands = node.getOperands();
         if (operands.length > 0) {
@@ -295,7 +302,7 @@
         return sb;
     }
 
-    public Object visit(PathQueryNode node, Object data) {
+    public Object visit(PathQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         try {
             if (containsDescendantOrSelf(node)) {
@@ -395,7 +402,7 @@
         return data;
     }
 
-    public Object visit(RelationQueryNode node, Object data) {
+    public Object visit(RelationQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         try {
             StringBuffer propName = new StringBuffer();

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/QueryFormat.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/QueryFormat.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/QueryFormat.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/QueryFormat.java Wed Jul 16 03:11:29 2008
@@ -16,10 +16,17 @@
  */
 package org.apache.jackrabbit.spi.commons.query.xpath;
 
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import java.util.TimeZone;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
+import javax.jcr.query.InvalidQueryException;
+
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.util.ISO8601;
-import org.apache.jackrabbit.util.ISO9075;
 import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.query.AndQueryNode;
@@ -39,13 +46,8 @@
 import org.apache.jackrabbit.spi.commons.query.QueryRootNode;
 import org.apache.jackrabbit.spi.commons.query.RelationQueryNode;
 import org.apache.jackrabbit.spi.commons.query.TextsearchQueryNode;
-
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.NamespaceException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.TimeZone;
+import org.apache.jackrabbit.util.ISO8601;
+import org.apache.jackrabbit.util.ISO9075;
 
 /**
  * Implements the query node tree serialization into a String.
@@ -60,15 +62,15 @@
     /**
      * The String representation of the query node tree
      */
-    private String statement;
+    private final String statement;
 
     /**
      * List of exception objects created while creating the XPath string
      */
-    private List exceptions = new ArrayList();
+    private final List exceptions = new ArrayList();
 
     private QueryFormat(QueryRootNode root, NameResolver resolver)
-            throws InvalidQueryException {
+            throws RepositoryException {
         this.resolver = resolver;
         statement = root.accept(this, new StringBuffer()).toString();
         if (exceptions.size() > 0) {
@@ -89,7 +91,12 @@
      */
     public static String toString(QueryRootNode root, NameResolver resolver)
             throws InvalidQueryException {
-        return new QueryFormat(root, resolver).toString();
+        try {
+            return new QueryFormat(root, resolver).toString();
+        }
+        catch (RepositoryException e) {
+            throw new InvalidQueryException(e);
+        }
     }
 
     /**
@@ -103,7 +110,7 @@
 
     //-------------< QueryNodeVisitor interface >-------------------------------
 
-    public Object visit(QueryRootNode node, Object data) {
+    public Object visit(QueryRootNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         node.getLocationNode().accept(this, data);
         if (node.getOrderNode() != null) {
@@ -134,7 +141,7 @@
         return data;
     }
 
-    public Object visit(OrQueryNode node, Object data) {
+    public Object visit(OrQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         boolean bracket = false;
         if (node.getParent() instanceof AndQueryNode) {
@@ -156,7 +163,7 @@
         return sb;
     }
 
-    public Object visit(AndQueryNode node, Object data) {
+    public Object visit(AndQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         String and = "";
         QueryNode[] operands = node.getOperands();
@@ -168,7 +175,7 @@
         return sb;
     }
 
-    public Object visit(NotQueryNode node, Object data) {
+    public Object visit(NotQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         QueryNode[] operands = node.getOperands();
         if (operands.length > 0) {
@@ -241,7 +248,7 @@
         return sb;
     }
 
-    public Object visit(PathQueryNode node, Object data) {
+    public Object visit(PathQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         if (node.isAbsolute()) {
             sb.append("/");
@@ -256,7 +263,7 @@
         return sb;
     }
 
-    public Object visit(LocationStepQueryNode node, Object data) {
+    public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         if (node.getIncludeDescendants()) {
             sb.append('/');
@@ -332,7 +339,7 @@
         return sb;
     }
 
-    public Object visit(RelationQueryNode node, Object data) {
+    public Object visit(RelationQueryNode node, Object data) throws RepositoryException {
         StringBuffer sb = (StringBuffer) data;
         try {
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/SimpleNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/SimpleNode.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/SimpleNode.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/SimpleNode.java Wed Jul 16 03:11:29 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.spi.commons.query.xpath;
 
+
 /**
  * Implements a JavaCC Node interface.
  * This Class was initially created by JavaCC and then adapted for our needs.
@@ -149,3 +150,4 @@
 
 }
 
+

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java?rev=677226&r1=677225&r2=677226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java Wed Jul 16 03:11:29 2008
@@ -16,14 +16,29 @@
  */
 package org.apache.jackrabbit.spi.commons.query.xpath;
 
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
+import javax.jcr.query.InvalidQueryException;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NameException;
+import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.PathBuilder;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.query.DefaultQueryNodeVisitor;
 import org.apache.jackrabbit.spi.commons.query.DerefQueryNode;
 import org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode;
@@ -39,22 +54,8 @@
 import org.apache.jackrabbit.spi.commons.query.QueryRootNode;
 import org.apache.jackrabbit.spi.commons.query.RelationQueryNode;
 import org.apache.jackrabbit.spi.commons.query.TextsearchQueryNode;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.NameFactory;
-import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.jackrabbit.util.ISO9075;
-import org.apache.commons.collections.map.ReferenceMap;
-
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.RepositoryException;
-import javax.jcr.NamespaceException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Map;
 
 /**
  * Query builder that translates a XPath statement into a query tree structure.
@@ -707,18 +708,23 @@
         node.childrenAccept(this, rqn);
 
         // check if string transformation is valid
-        rqn.acceptOperands(new DefaultQueryNodeVisitor() {
-            public Object visit(PropertyFunctionQueryNode node, Object data) {
-                String functionName = node.getFunctionName();
-                if ((functionName.equals(PropertyFunctionQueryNode.LOWER_CASE)
-                        || functionName.equals(PropertyFunctionQueryNode.UPPER_CASE))
-                            && rqn.getValueType() != QueryConstants.TYPE_STRING) {
-                    String msg = "Upper and lower case function are only supported with String literals";
-                    exceptions.add(new InvalidQueryException(msg));
+        try {
+            rqn.acceptOperands(new DefaultQueryNodeVisitor() {
+                public Object visit(PropertyFunctionQueryNode node, Object data) {
+                    String functionName = node.getFunctionName();
+                    if ((functionName.equals(PropertyFunctionQueryNode.LOWER_CASE)
+                            || functionName.equals(PropertyFunctionQueryNode.UPPER_CASE))
+                                && rqn.getValueType() != QueryConstants.TYPE_STRING) {
+                        String msg = "Upper and lower case function are only supported with String literals";
+                        exceptions.add(new InvalidQueryException(msg));
+                    }
+                    return data;
                 }
-                return data;
-            }
-        }, null);
+            }, null);
+        }
+        catch (RepositoryException e) {
+            exceptions.add(e);
+        }
 
         queryNode.addOperand(rqn);
     }



Mime
View raw message