jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r777509 - 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 Fri, 22 May 2009 13:17:17 GMT
Author: jukka
Date: Fri May 22 13:17:17 2009
New Revision: 777509

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

Generify the set of valid /jcr:system node type names

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeFactory.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/sql/JCRSQLQueryBuilder.java

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=777509&r1=777508&r2=777509&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
Fri May 22 13:17:17 2009
@@ -93,26 +93,32 @@
  */
 public class SearchIndex extends AbstractQueryHandler {
 
-    public static final List VALID_SYSTEM_INDEX_NODE_TYPE_NAMES
-        = Collections.unmodifiableList(Arrays.asList(new Name[]{
-            NameConstants.NT_CHILDNODEDEFINITION,
-            NameConstants.NT_FROZENNODE,
-            NameConstants.NT_NODETYPE,
-            NameConstants.NT_PROPERTYDEFINITION,
-            NameConstants.NT_VERSION,
-            NameConstants.NT_VERSIONEDCHILD,
-            NameConstants.NT_VERSIONHISTORY,
-            NameConstants.NT_VERSIONLABELS,
-            NameConstants.REP_NODETYPES,
-            NameConstants.REP_SYSTEM,
-            NameConstants.REP_VERSIONSTORAGE,
-            // Supertypes
-            NameConstants.NT_BASE,
-            NameConstants.MIX_REFERENCEABLE
-        }));
-
-    private static final DefaultQueryNodeFactory DEFAULT_QUERY_NODE_FACTORY = new DefaultQueryNodeFactory(
-            VALID_SYSTEM_INDEX_NODE_TYPE_NAMES);
+    /**
+     * Valid node type names under /jcr:system. Used to determine if a
+     * query needs to be executed also against the /jcr:system tree.
+     */
+    public static final Collection<Name> VALID_SYSTEM_INDEX_NODE_TYPE_NAMES =
+        Collections.unmodifiableCollection(Arrays.asList(
+                NameConstants.NT_CHILDNODEDEFINITION,
+                NameConstants.NT_FROZENNODE,
+                NameConstants.NT_NODETYPE,
+                NameConstants.NT_PROPERTYDEFINITION,
+                NameConstants.NT_VERSION,
+                NameConstants.NT_VERSIONEDCHILD,
+                NameConstants.NT_VERSIONHISTORY,
+                NameConstants.NT_VERSIONLABELS,
+                NameConstants.REP_NODETYPES,
+                NameConstants.REP_SYSTEM,
+                NameConstants.REP_VERSIONSTORAGE,
+                // Supertypes
+                NameConstants.NT_BASE,
+                NameConstants.MIX_REFERENCEABLE));
+        
+    /**
+     * Default query node factory.
+     */
+    private static final DefaultQueryNodeFactory DEFAULT_QUERY_NODE_FACTORY =
+        new DefaultQueryNodeFactory(VALID_SYSTEM_INDEX_NODE_TYPE_NAMES);
 
     /** The logger instance for this class */
     private static final Logger log = LoggerFactory.getLogger(SearchIndex.class);

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeFactory.java?rev=777509&r1=777508&r2=777509&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/DefaultQueryNodeFactory.java
Fri May 22 13:17:17 2009
@@ -16,26 +16,26 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
-import java.util.List;
+import java.util.Collection;
 
 import org.apache.jackrabbit.spi.Name;
 
 /**
- * Default implementetation of a {@link QueryNodeFactory}.
+ * Default implementation of a {@link QueryNodeFactory}.
  */
 public class DefaultQueryNodeFactory implements QueryNodeFactory {
 
     /**
-     * List of valid node type names under /jcr:system
+     * Valid node type names under /jcr:system
      */
-    private final List validJcrSystemNodeTypeNames;
+    private final Collection<Name> validJcrSystemNodeTypeNames;
 
     /**
      * Creates a DefaultQueryNodeFactory with the given node types under
      * /jcr:system .
      */
-    public DefaultQueryNodeFactory(List validJcrSystemNodeTypeNames) {
-        super();
+    public DefaultQueryNodeFactory(
+            Collection<Name> validJcrSystemNodeTypeNames) {
         this.validJcrSystemNodeTypeNames = validJcrSystemNodeTypeNames;
     }
 

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=777509&r1=777508&r2=777509&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
Fri May 22 13:17:17 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.spi.commons.query;
 
-import java.util.List;
+import java.util.Collection;
 
 import javax.jcr.RepositoryException;
 
@@ -34,9 +34,10 @@
     private boolean absolute = false;
 
     /**
-     * List of valid node type names under /jcr:system
+     * Valid node type names under /jcr:system. Used to determine if a
+     * query needs to be executed also against the /jcr:system tree.
      */
-    private final List validJcrSystemNodeTypeNames;
+    private final Collection<Name> validJcrSystemNodeTypeNames;
 
     /**
      * Empty step node array.
@@ -45,21 +46,23 @@
 
     /**
      * Creates a relative <code>PathQueryNode</code> with no location steps and
-     * the list of node types under /jcr:system.
+     * the collection of node types under /jcr:system.
      *
      * @param parent the parent query node.
+     * @param validJcrSystemNodeTypeNames valid node types under /jcr:system
      */
-    protected PathQueryNode(QueryNode parent, List validJcrSystemNodeTypeNames) {
+    protected PathQueryNode(
+            QueryNode parent, Collection<Name> validJcrSystemNodeTypeNames) {
         super(parent);
         this.validJcrSystemNodeTypeNames = validJcrSystemNodeTypeNames;
     }
 
     /**
-     * Returns a list of valid node types under /jcr:system. List&lt;Name>.
+     * Returns the collection of valid node types under /jcr:system.
      *
-     * @return a list of valid node types under /jcr:system.
+     * @return valid node types under /jcr:system.
      */
-    public List getValidJcrSystemNodeTypeNames() {
+    public Collection<Name> getValidJcrSystemNodeTypeNames() {
         return validJcrSystemNodeTypeNames;
     }
 

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/JCRSQLQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/JCRSQLQueryBuilder.java?rev=777509&r1=777508&r2=777509&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/JCRSQLQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql/JCRSQLQueryBuilder.java
Fri May 22 13:17:17 2009
@@ -50,6 +50,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
+import java.util.Collection;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
@@ -838,7 +839,8 @@
          * @param validJcrSystemNodeTypeNames names of valid node types under
          *        /jcr:system.
          */
-        MergingPathQueryNode(int operation, List validJcrSystemNodeTypeNames) {
+        MergingPathQueryNode(
+                int operation, Collection<Name> validJcrSystemNodeTypeNames) {
             super(null, validJcrSystemNodeTypeNames);
             if (operation != QueryNode.TYPE_OR && operation != QueryNode.TYPE_AND
&& operation != QueryNode.TYPE_NOT) {
                 throw new IllegalArgumentException("operation");



Mime
View raw message