jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r658630 - in /jackrabbit/trunk/jackrabbit-jcr-commons: ./ src/main/java/org/apache/jackrabbit/commons/packaging/ src/main/java/org/apache/jackrabbit/commons/predicate/ src/main/java/org/apache/jackrabbit/commons/repository/ src/main/java/or...
Date Wed, 21 May 2008 11:31:01 GMT
Author: jukka
Date: Wed May 21 04:31:00 2008
New Revision: 658630

URL: http://svn.apache.org/viewvc?rev=658630&view=rev
Log:
JCR-1617: Remove commons-collections and slf4j-api dependencies from jcr-commons

Added:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/Predicate.java
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/pom.xml
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/packaging/FilterContentPackage.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/DepthPredicate.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/NtFilePredicate.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/PathPredicate.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/repository/ProxyRepository.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/visitor/FilteringItemVisitor.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/name/NamespaceExtractor.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/pom.xml?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/pom.xml Wed May 21 04:31:00 2008
@@ -69,24 +69,11 @@
       <artifactId>jcr</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>cglib</groupId>
       <artifactId>cglib</artifactId>
       <scope>test</scope>

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/packaging/FilterContentPackage.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/packaging/FilterContentPackage.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/packaging/FilterContentPackage.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/packaging/FilterContentPackage.java
Wed May 21 04:31:00 2008
@@ -28,8 +28,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.commons.collections.Predicate;
-
+import org.apache.jackrabbit.commons.predicate.Predicate;
 
 public class FilterContentPackage implements ContentPackage {
 

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/DepthPredicate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/DepthPredicate.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/DepthPredicate.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/DepthPredicate.java
Wed May 21 04:31:00 2008
@@ -19,8 +19,6 @@
 import javax.jcr.Item;
 import javax.jcr.RepositoryException;
 
-import org.apache.commons.collections.Predicate;
-
 /**
  * Implements a filter that filters item according to their (passed) depth.
  *

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/NtFilePredicate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/NtFilePredicate.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/NtFilePredicate.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/NtFilePredicate.java
Wed May 21 04:31:00 2008
@@ -20,8 +20,6 @@
 import javax.jcr.Property;
 import javax.jcr.RepositoryException;
 
-import org.apache.commons.collections.Predicate;
-
 /**
  * The nt file item filter matches all properties that are defined my the
  * nt:file or nt:resource nodetype. the later only, if the respective nodes

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/PathPredicate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/PathPredicate.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/PathPredicate.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/PathPredicate.java
Wed May 21 04:31:00 2008
@@ -21,8 +21,6 @@
 import javax.jcr.Item;
 import javax.jcr.RepositoryException;
 
-import org.apache.commons.collections.Predicate;
-
 /**
  * The path filter provides hierarchical filtering.
  *

Added: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/Predicate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/Predicate.java?rev=658630&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/Predicate.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/Predicate.java
Wed May 21 04:31:00 2008
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.commons.predicate;
+
+/**
+ * Interface for object predicates, i.e. functions that evalute a given
+ * object to a boolean value.
+ */
+public interface Predicate {
+
+    /**
+     * Evaluates the predicate for the given object.
+     *
+     * @param object some object
+     * @return predicate result
+     */
+    boolean evaluate(Object object);
+
+    /**
+     * Constant predicate that returns <code>true</code> for all objects.
+     */
+    static final Predicate TRUE = new Predicate() {
+        public boolean evaluate(Object object) {
+            return true;
+        }
+    };
+
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/predicate/Predicate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/repository/ProxyRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/repository/ProxyRepository.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/repository/ProxyRepository.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/repository/ProxyRepository.java
Wed May 21 04:31:00 2008
@@ -21,8 +21,6 @@
 import javax.jcr.Session;
 
 import org.apache.jackrabbit.commons.AbstractRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Repository that proxies all method calls to another repository.
@@ -34,12 +32,6 @@
 public class ProxyRepository extends AbstractRepository {
 
     /**
-     * Logger instance.
-     */
-    private static final Logger logger =
-        LoggerFactory.getLogger(ProxyRepository.class);
-
-    /**
      * Factory for accessing the proxied repository.
      */
     private final RepositoryFactory factory;
@@ -64,7 +56,6 @@
         try {
             return factory.getRepository().getDescriptorKeys();
         } catch (RepositoryException e) {
-            logger.warn("Unable to access proxied repository", e);
             return new String[0];
         }
     }
@@ -80,7 +71,6 @@
         try {
             return factory.getRepository().getDescriptor(key);
         } catch (RepositoryException e) {
-            logger.warn("Unable to access proxied repository", e);
             return null;
         }
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/visitor/FilteringItemVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/visitor/FilteringItemVisitor.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/visitor/FilteringItemVisitor.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/visitor/FilteringItemVisitor.java
Wed May 21 04:31:00 2008
@@ -26,20 +26,19 @@
 import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
 
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.functors.TruePredicate;
+import org.apache.jackrabbit.commons.predicate.Predicate;
 
 public abstract class FilteringItemVisitor implements ItemVisitor {
 
     /**
      * Predicate that defines which items are included.
      */
-    protected Predicate includePredicate = TruePredicate.INSTANCE;
+    protected Predicate includePredicate = Predicate.TRUE;
 
     /**
      * Predicate that defines which items are traversed.
      */
-    protected Predicate traversalPredicate = TruePredicate.INSTANCE;
+    protected Predicate traversalPredicate = Predicate.TRUE;
 
     /**
      * Do we want to walk all properties of nodes?

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/name/NamespaceExtractor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/name/NamespaceExtractor.java?rev=658630&r1=658629&r2=658630&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/name/NamespaceExtractor.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/name/NamespaceExtractor.java
Wed May 21 04:31:00 2008
@@ -22,8 +22,6 @@
 import org.xml.sax.ContentHandler;
 import org.xml.sax.helpers.XMLReaderFactory;
 import org.xml.sax.helpers.DefaultHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.jcr.NamespaceException;
 import java.io.FileInputStream;
@@ -46,7 +44,6 @@
  *             the jackrabbit-spi-commons component.
  */
 public class NamespaceExtractor {
-    private static Logger log = LoggerFactory.getLogger(NamespaceExtractor.class);
     private final NamespaceMapping mapping = new NamespaceMapping();
     private final Map basePrefixes = new HashMap();
     private String defaultBasePrefix;
@@ -104,9 +101,8 @@
                     prefix = prefix + "_" + c;
                 }
                 mapping.setMapping(prefix, uri);
-            } catch(NamespaceException e){
-                String msg = e.getMessage();
-                log.debug(msg);
+            } catch (NamespaceException e) {
+                throw new SAXException(e);
             }
         }
     }



Mime
View raw message