jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1171815 [3/3] - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ jackrabbit-jcr2spi/src/main/java/org/apache/jac...
Date Fri, 16 Sep 2011 21:51:46 GMT
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
Fri Sep 16 21:51:43 2011
@@ -46,6 +46,8 @@ import org.apache.jackrabbit.spi.commons
 import org.apache.jackrabbit.spi.commons.util.Unchecked;
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.jackrabbit.util.ISO9075;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.NamespaceException;
 import javax.jcr.RepositoryException;
@@ -112,6 +114,7 @@ import static org.apache.jackrabbit.spi.
  * Query builder that translates a XPath statement into a query tree structure.
  */
 public class XPathQueryBuilder implements XPathVisitor {
+    private static final Logger log = LoggerFactory.getLogger(XPathQueryBuilder.class);
 
     private static final NameFactory NAME_FACTORY = NameFactoryImpl.getInstance();
     private static final PathFactory PATH_FACTORY = PathFactoryImpl.getInstance();
@@ -748,7 +751,9 @@ public class XPathQueryBuilder implement
      */
     private void createExpression(SimpleNode node, NAryQueryNode<QueryNode> queryNode)
{
         if (node.getId() != JJTCOMPARISONEXPR) {
-            throw new IllegalArgumentException("node must be of type ComparisonExpr");
+            IllegalArgumentException e = new IllegalArgumentException("node must be of type
ComparisonExpr");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         // get operation type
         String opType = node.getValue();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Arrays.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Arrays.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Arrays.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Arrays.java
Fri Sep 16 21:51:43 2011
@@ -19,6 +19,9 @@
 
 package org.apache.jackrabbit.spi.commons.util;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.lang.reflect.Array;
 import java.util.HashSet;
 import java.util.Set;
@@ -26,6 +29,8 @@ import java.util.Set;
 import static org.apache.jackrabbit.spi.commons.util.Unchecked.cast;
 
 public final class Arrays {
+    private static final Logger log = LoggerFactory.getLogger(Arrays.class);
+
     private Arrays() {}
 
     public static <T> boolean contains(T[] array, T element) {
@@ -64,7 +69,9 @@ public final class Arrays {
                 to[k] = f.apply(from[k]);
             }
             catch (Exception e) {
-                throw new IllegalArgumentException("Function1 must not throw unchecked exceptions",
e);
+                IllegalArgumentException e0 = new IllegalArgumentException("Function1 must
not throw unchecked exceptions", e);
+                log.error(e0.getMessage(), e0);
+                throw e0;
             }
         }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/BoundedIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/BoundedIterator.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/BoundedIterator.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/BoundedIterator.java
Fri Sep 16 21:51:43 2011
@@ -17,6 +17,9 @@
 
 package org.apache.jackrabbit.spi.commons.util;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
@@ -27,6 +30,8 @@ import java.util.NoSuchElementException;
  * @param <T>  element type
  */
 public class BoundedIterator<T> implements Iterator<T> {
+    private static final Logger log = LoggerFactory.getLogger(BoundedIterator.class);
+
     private final Iterator<T> iterator;
     private final long offset;
     private final long max;
@@ -43,7 +48,9 @@ public class BoundedIterator<T> implemen
      */
     public BoundedIterator(long offset, long max, Iterator<T> iterator) {
         if (offset < 0) {
-            throw new IllegalArgumentException("Offset must not be negative");
+            IllegalArgumentException e = new IllegalArgumentException("Offset must not be
negative");
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         this.iterator = iterator;
@@ -90,7 +97,9 @@ public class BoundedIterator<T> implemen
 
     @Override
     public void remove() {
-        throw new UnsupportedOperationException();
+        UnsupportedOperationException e = new UnsupportedOperationException("remove");
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     //------------------------------------------< private >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Iterators.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Iterators.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Iterators.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/Iterators.java
Fri Sep 16 21:51:43 2011
@@ -22,6 +22,8 @@ import org.apache.commons.collections.it
 import org.apache.commons.collections.iterators.IteratorChain;
 import org.apache.commons.collections.iterators.SingletonIterator;
 import org.apache.commons.collections.iterators.TransformIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
@@ -37,6 +39,7 @@ import static org.apache.jackrabbit.spi.
  * commons-collections.
  */
 public final class Iterators {
+    private static final Logger log = LoggerFactory.getLogger(Iterators.class);
 
     private Iterators() {
     }
@@ -130,7 +133,10 @@ public final class Iterators {
                     return predicate.apply(Unchecked.<T>cast(object));
                 }
                 catch (Exception e) {
-                    throw new IllegalArgumentException("Predicate must not throw unchecked
exceptions", e);
+                    IllegalArgumentException e0 = new IllegalArgumentException("Predicate
must not throw unchecked " +
+                            "exceptions", e);
+                    log.error(e.getMessage(), e0);
+                    throw e0;
                 }
             }
         }));
@@ -157,7 +163,10 @@ public final class Iterators {
                     return transformer.apply(Unchecked.<S>cast(input));
                 }
                 catch (Exception e) {
-                    throw new IllegalArgumentException("Transformer must not throw unchecked
exceptions", e);
+                    IllegalArgumentException e0 = new IllegalArgumentException("Transformer
must not throw unchecked " +
+                            "exceptions", e);
+                    log.error(e.getMessage(), e0);
+                    throw e0;
                 }
             }
         }));

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java
Fri Sep 16 21:51:43 2011
@@ -16,6 +16,9 @@
  */
 package org.apache.jackrabbit.spi.commons.util;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
@@ -35,6 +38,7 @@ import static org.apache.jackrabbit.spi.
  * to the method {@link #toArray()} in both its variants.
  */
 public class WeakIdentityCollection<E> implements Collection<E> {
+    private static final Logger log = LoggerFactory.getLogger(WeakIdentityCollection.class);
 
     /**
      * The weak references.
@@ -60,7 +64,9 @@ public class WeakIdentityCollection<E> i
      */
     public WeakIdentityCollection(int initialCapacity) {
         if (initialCapacity < 0) {
-            throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity);
+            IllegalArgumentException e = new IllegalArgumentException("Illegal Capacity:
" + initialCapacity);
+            log.error(e.getMessage(), e);
+            throw e;
         }
         elementData = new ArrayList<WeakReferenceWithIndex>(initialCapacity);
     }
@@ -161,7 +167,9 @@ public class WeakIdentityCollection<E> i
      */
     @Override
     public boolean addAll(Collection<? extends E> c) {
-        throw new UnsupportedOperationException("addAll");
+        UnsupportedOperationException e = new UnsupportedOperationException("addAll");
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     /**
@@ -169,7 +177,9 @@ public class WeakIdentityCollection<E> i
      */
     @Override
     public boolean containsAll(Collection<?> c) {
-        throw new UnsupportedOperationException("containsAll");
+        UnsupportedOperationException e = new UnsupportedOperationException("containsAll");
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     /**
@@ -177,7 +187,9 @@ public class WeakIdentityCollection<E> i
      */
     @Override
     public boolean removeAll(Collection<?> c) {
-        throw new UnsupportedOperationException("removeAll");
+        UnsupportedOperationException e = new UnsupportedOperationException("removeAll");
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     /**
@@ -185,7 +197,9 @@ public class WeakIdentityCollection<E> i
      */
     @Override
     public boolean retainAll(Collection<?> c) {
-        throw new UnsupportedOperationException("retainAll");
+        UnsupportedOperationException e = new UnsupportedOperationException("retainAll");
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
Fri Sep 16 21:51:43 2011
@@ -16,24 +16,25 @@
  */
 package org.apache.jackrabbit.spi.commons.value;
 
-import org.apache.jackrabbit.spi.QValue;
+import org.apache.commons.io.IOUtils;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.util.ISO8601;
-import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import javax.jcr.Binary;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
-import javax.jcr.Binary;
-
-import java.util.Calendar;
-import java.util.TimeZone;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.io.InputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.Serializable;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.util.Calendar;
+import java.util.TimeZone;
 
 import static org.apache.jackrabbit.spi.commons.util.Unchecked.cast;
 
@@ -41,6 +42,7 @@ import static org.apache.jackrabbit.spi.
  * {@code AbstractQValue}...
  */
 public abstract class AbstractQValue implements QValue, Serializable {
+    static final Logger log = LoggerFactory.getLogger(AbstractQValue.class);
 
     private static final long serialVersionUID = 6976433831974695272L;
 
@@ -57,7 +59,9 @@ public abstract class AbstractQValue imp
      */
     protected AbstractQValue(Object value, int type) {
         if (value == null) {
-            throw new IllegalArgumentException("null value");
+            IllegalArgumentException e = new IllegalArgumentException("null value");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         val = value;
         this.type = type;
@@ -74,10 +78,14 @@ public abstract class AbstractQValue imp
      */
     protected AbstractQValue(String value, int type) {
         if (value == null) {
-            throw new IllegalArgumentException("null value");
+            IllegalArgumentException e = new IllegalArgumentException("null value");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         if (!(type == PropertyType.STRING || type == PropertyType.REFERENCE || type == PropertyType.WEAKREFERENCE))
{
-            throw new IllegalArgumentException();
+            IllegalArgumentException e = new IllegalArgumentException("Invalid type: " +
type);
+            log.error(e.getMessage(), e);
+            throw e;
         }
         val = value;
         this.type = type;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValueFactory.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValueFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValueFactory.java
Fri Sep 16 21:51:43 2011
@@ -27,6 +27,8 @@ import org.apache.jackrabbit.spi.commons
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
 import org.apache.jackrabbit.util.ISO8601;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -41,6 +43,7 @@ import java.util.UUID;
  * {@code AbstractQValueFactory}...
  */
 public abstract class AbstractQValueFactory implements QValueFactory {
+    private static final Logger log = LoggerFactory.getLogger(AbstractQValueFactory.class);
 
     /**
      * the default encoding
@@ -77,7 +80,9 @@ public abstract class AbstractQValueFact
     @Override
     public QValue create(String value, int type) throws RepositoryException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         try {
@@ -121,7 +126,9 @@ public abstract class AbstractQValueFact
         }
 
         // invalid type specified:
-        throw new IllegalArgumentException("illegal type " + type);
+        IllegalArgumentException e = new IllegalArgumentException("illegal type " + type);
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     /**
@@ -130,7 +137,9 @@ public abstract class AbstractQValueFact
     @Override
     public QValue create(Calendar value) throws RepositoryException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new DefaultQValue(value);
     }
@@ -169,7 +178,9 @@ public abstract class AbstractQValueFact
     @Override
     public QValue create(Name value) throws RepositoryException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new DefaultQValue(value);
     }
@@ -180,7 +191,9 @@ public abstract class AbstractQValueFact
     @Override
     public QValue create(Path value) throws RepositoryException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new DefaultQValue(value);
     }
@@ -191,7 +204,9 @@ public abstract class AbstractQValueFact
     @Override
     public QValue create(URI value) throws RepositoryException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new DefaultQValue(value);
     }
@@ -202,7 +217,9 @@ public abstract class AbstractQValueFact
     @Override
     public QValue create(BigDecimal value) throws RepositoryException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new DefaultQValue(value);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
Fri Sep 16 21:51:43 2011
@@ -21,6 +21,8 @@ import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.util.TransientFileFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -43,6 +45,7 @@ import static org.apache.jackrabbit.spi.
  * {@code QValueFactoryImpl}...
  */
 public class QValueFactoryImpl extends AbstractQValueFactory {
+    private static final Logger log = LoggerFactory.getLogger(QValueFactoryImpl.class);
 
     private static final QValueFactory INSTANCE = new QValueFactoryImpl();
 
@@ -59,7 +62,9 @@ public class QValueFactoryImpl extends A
     @Override
     public QValue create(byte[] value) {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new BinaryQValue(value);
     }
@@ -70,7 +75,9 @@ public class QValueFactoryImpl extends A
     @Override
     public QValue create(InputStream value) throws IOException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new BinaryQValue(value);
     }
@@ -81,7 +88,9 @@ public class QValueFactoryImpl extends A
     @Override
     public QValue create(File value) throws IOException {
         if (value == null) {
-            throw new IllegalArgumentException("Cannot create QValue from null value.");
+            IllegalArgumentException e = new IllegalArgumentException("Cannot create QValue
from null value.");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         return new BinaryQValue(value);
     }
@@ -294,7 +303,9 @@ public class QValueFactoryImpl extends A
          */
         @Override
         public Name getName() throws RepositoryException {
-            throw new UnsupportedOperationException();
+            UnsupportedOperationException e = new UnsupportedOperationException("getName");
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         /**
@@ -302,7 +313,9 @@ public class QValueFactoryImpl extends A
          */
         @Override
         public Path getPath() throws RepositoryException {
-            throw new UnsupportedOperationException();
+            UnsupportedOperationException e = new UnsupportedOperationException("getPath");
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
Fri Sep 16 21:51:43 2011
@@ -16,25 +16,28 @@
  */
 package org.apache.jackrabbit.spi.commons.value;
 
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.util.Unchecked;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import javax.jcr.RepositoryException;
 import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 import java.io.IOException;
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * {@code ValueFormat}...
  */
 public final class ValueFormat {
+    private static final Logger log = LoggerFactory.getLogger(ValueFormat.class);
 
     private ValueFormat() {
     }
@@ -50,7 +53,9 @@ public final class ValueFormat {
     public static QValue getQValue(Value jcrValue, NamePathResolver resolver,
                                    QValueFactory factory) throws RepositoryException {
         if (jcrValue == null) {
-            throw new IllegalArgumentException("null value");
+            IllegalArgumentException e = new IllegalArgumentException("null value");
+            log.error(e.getMessage(), e);
+            throw e;
         } else if (jcrValue instanceof QValueValue) {
             return Unchecked.<QValueValue>cast(jcrValue).getQValue();
         } else if (jcrValue.getType() == PropertyType.BINARY) {
@@ -86,7 +91,9 @@ public final class ValueFormat {
                                       NamePathResolver resolver,
                                       QValueFactory factory) throws RepositoryException {
         if (jcrValues == null) {
-            throw new IllegalArgumentException("null value");
+            IllegalArgumentException e = new IllegalArgumentException("null value");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         List<QValue> qValues = new ArrayList<QValue>();
         for (Value jcrValue : jcrValues) {
@@ -134,7 +141,9 @@ public final class ValueFormat {
                 qValue = factory.create(qPath);
                 break;
             default:
-                throw new IllegalArgumentException("Invalid property type.");
+                IllegalArgumentException e = new IllegalArgumentException("Invalid property
type.");
+                log.error(e.getMessage(), e);
+                throw e;
         }
         return qValue;
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/CommitMessage.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/CommitMessage.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/CommitMessage.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/CommitMessage.java
Fri Sep 16 21:51:43 2011
@@ -3,8 +3,12 @@ package org.apache.jackrabbit.spi2microk
 
 import org.apache.jackrabbit.spi.commons.util.Unchecked;
 import org.apache.jackrabbit.util.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CommitMessage {
+    private static final Logger log = LoggerFactory.getLogger(CommitMessage.class);
+
     private final String userId;
     private final String userData;
 
@@ -13,7 +17,9 @@ public class CommitMessage {
 
     public static CommitMessage parse(String s) {
         if (s == null) {
-            throw new IllegalArgumentException("null");
+            IllegalArgumentException e = new IllegalArgumentException("null");
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         int k = s.indexOf(SEPARATOR_CHAR);
@@ -22,7 +28,9 @@ public class CommitMessage {
         }
 
         if (k == -1) {
-            throw new IllegalArgumentException(s);
+            IllegalArgumentException e = new IllegalArgumentException(s);
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         return new CommitMessage(unescape(s.substring(0, k)), unescape(s.substring(k + 1,
s.length())));
@@ -30,10 +38,14 @@ public class CommitMessage {
 
     public CommitMessage(String userId, String userData) {
         if (userId == null) {
-            throw new IllegalArgumentException("UserId is null");
+            IllegalArgumentException e = new IllegalArgumentException("UserId is null");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         if (userData == null) {
-            throw new IllegalArgumentException("UserData is null");
+            IllegalArgumentException e = new IllegalArgumentException("UserData is null");
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         this.userId = userId;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
Fri Sep 16 21:51:43 2011
@@ -27,6 +27,8 @@ import org.apache.jackrabbit.spi.Path.El
 import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.RepositoryException;
 import java.util.LinkedList;
@@ -40,6 +42,8 @@ import static org.apache.jackrabbit.spi.
  * Its always good to have at least 3 representations of the same thing... :(
  */
 public final class Paths {
+    private static final Logger log = LoggerFactory.getLogger(Paths.class);
+    
     private static final NameFactory NAME_FACTORY = NameFactoryImpl.getInstance();
     private static final PathFactory PATH_FACTORY = PathFactoryImpl.getInstance();
     private static final ConcurrentMap<String, String> KNOWN_NAME_SPACES = new ConcurrentHashMap<String,
String>();
@@ -51,7 +55,9 @@ public final class Paths {
         if (name.startsWith("{")) {
             int i = name.indexOf('}');
             if (i == -1 || i == name.length() - 1) {
-                throw new IllegalArgumentException("Invalid name: " + name);
+                IllegalArgumentException e = new IllegalArgumentException("Invalid name:
" + name);
+                log.error(e.getMessage(), e);
+                throw e;
             }
 
             String ns = unescapeNameSpaceURI(name.substring(1, i));
@@ -95,7 +101,9 @@ public final class Paths {
             throw new RepositoryException("Invalid workspace name: " + wspName);
         }
         if (!absPath.isAbsolute()) {
-            throw new IllegalArgumentException("Path is not absolute: " + absPath);
+            IllegalArgumentException e = new IllegalArgumentException("Path is not absolute:
" + absPath);
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         String wspPath = '/' + wspName;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryInfoImpl.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryInfoImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryInfoImpl.java
Fri Sep 16 21:51:43 2011
@@ -91,7 +91,9 @@ public class QueryInfoImpl implements Qu
 
             @Override
             public void remove() {
-                throw new UnsupportedOperationException();
+                UnsupportedOperationException e = new UnsupportedOperationException("remove");
+                log.error(e.getMessage(), e);
+                throw e;
             }
 
         };

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
Fri Sep 16 21:51:43 2011
@@ -54,8 +54,7 @@ import java.util.Map;
  * A tool to run a list of hardcoded queries.
  */
 public class QueryProcessor {
-
-    static final Logger log = LoggerFactory.getLogger(QueryProcessor.class);
+    private static final Logger log = LoggerFactory.getLogger(QueryProcessor.class);
 
     final RepositoryServiceImpl rep;
     final MicroKernel microKernel;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Fri Sep 16 21:51:43 2011
@@ -128,12 +128,13 @@ import static org.apache.jackrabbit.spi.
 import static org.apache.jackrabbit.spi2microkernel.ItemInfos.buildItemInfos;
 
 public class RepositoryServiceImpl extends AbstractRepositoryService {
+    private static final Logger log = LoggerFactory.getLogger(RepositoryServiceImpl.class);
+
     private static final long BINARY_VALUE_INLINE_THRESHOLD = 0x1000;
     private static final String DEFAULT_DEFAULT_WORKSPACE = "default";
     private static final String DEFAULT_SYSTEM_WORKSPACE = "system";
-    private static final String[] SUPPORTED_LANGUAGES = new String[]{Query.SQL, Query.JCR_JQOM,
Query.JCR_SQL2, Query.XPATH};
 
-    static final Logger log = LoggerFactory.getLogger(RepositoryServiceImpl.class);
+    private static final String[] SUPPORTED_LANGUAGES = new String[]{Query.SQL, Query.JCR_JQOM,
Query.JCR_SQL2, Query.XPATH};
 
     private static final QNodeDefinition ROOT_NODE_DEFINITION = new QNodeDefinitionImpl(ROOT,
REP_ROOT, true, true,
             OnParentVersionAction.VERSION, false, REP_ROOT, new Name[]{ REP_ROOT }, false);
@@ -177,7 +178,9 @@ public class RepositoryServiceImpl exten
             put(QUERY_LANGUAGES, toQValues(SUPPORTED_LANGUAGES));
         }
         catch (RepositoryException e) {
-            throw new IllegalStateException(e); // should not happen
+            IllegalStateException e1 = new IllegalStateException(e.getMessage(), e);
+            log.error(e1.getMessage(), e1);
+            throw e1;
         }
     }};
 
@@ -422,8 +425,9 @@ public class RepositoryServiceImpl exten
                     return idFactory.createPropertyId(parentId, path.getName());
                 }
                 catch (RepositoryException e) {
-                    log.debug(e.getMessage(), e);
-                    throw new IllegalStateException(e.getMessage(), e);
+                    IllegalStateException e1 = new IllegalStateException(e.getMessage(),
e);
+                    log.error(e1.getMessage(), e1);
+                    throw e1;
                 }
             }
         });

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Fri Sep 16 21:51:43 2011
@@ -58,7 +58,7 @@ import java.util.concurrent.ExecutionExc
 import java.util.concurrent.FutureTask;
 
 public class SubscriptionImpl implements Subscription {
-    static final Logger log = LoggerFactory.getLogger(SubscriptionImpl.class);
+    private static final Logger log = LoggerFactory.getLogger(SubscriptionImpl.class);
 
     private final MicroKernel microKernel;
     private final SessionState sessionState;
@@ -118,7 +118,9 @@ public class SubscriptionImpl implements
             return (JSONArray) jsonArray;
         }
         else {
-            throw new IllegalArgumentException("Not a JSONArray: " + jsonArray);
+            IllegalArgumentException e = new IllegalArgumentException("Not a JSONArray: "
+ jsonArray);
+            log.error(e.getMessage(), e);
+            throw e;
         }
     }
 
@@ -127,7 +129,9 @@ public class SubscriptionImpl implements
             return (JSONObject) jsonObject;
         }
         else {
-            throw new IllegalArgumentException("Not a JSONObject: " + jsonObject);
+            IllegalArgumentException e = new IllegalArgumentException("Not a JSONObject:
" + jsonObject);
+            log.error(e.getMessage(), e);
+            throw e;
         }
     }
 
@@ -174,10 +178,14 @@ public class SubscriptionImpl implements
 
         public synchronized String wait(final String baseRevision, final long timeout) throws
RepositoryException {
             if (baseRevision == null) {
-                throw new IllegalArgumentException("IteratorImpl revision may not be null");
+                IllegalArgumentException e = new IllegalArgumentException("IteratorImpl revision
may not be null");
+                log.error(e.getMessage(), e);
+                throw e;
             }
             if (waitForCommit != null) {
-                throw new IllegalStateException("Wait already in progress");
+                IllegalStateException e = new IllegalStateException("Wait already in progress");
+                log.error(e.getMessage(), e);
+                throw e;
             }
 
             waitForCommit = new FutureTask<String>(new Callable<String>(){
@@ -484,7 +492,9 @@ public class SubscriptionImpl implements
                 return (String) o;
             }
             else {
-                throw new IllegalArgumentException("Not a string: " + jsonObject);
+                IllegalArgumentException e = new IllegalArgumentException("Not a string:
" + jsonObject);
+                log.error(e.getMessage(), e);
+                throw e;
             }
         }
 
@@ -494,7 +504,9 @@ public class SubscriptionImpl implements
                 return (Long) o;
             }
             else {
-                throw new IllegalArgumentException("Not a long: " + jsonObject);
+                IllegalArgumentException e = new IllegalArgumentException("Not a long: "
+ jsonObject);
+                log.error(e.getMessage(), e);
+                throw e;
             }
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java?rev=1171815&r1=1171814&r2=1171815&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java
Fri Sep 16 21:51:43 2011
@@ -66,7 +66,7 @@ import static org.apache.jackrabbit.spi.
 import static org.apache.jackrabbit.spi2microkernel.NodeTypes.isSubType;
 
 public final class Values {
-    static final Logger log = LoggerFactory.getLogger(Values.class);
+    private static final Logger log = LoggerFactory.getLogger(Values.class);
 
     private static final QValueFactory FACTORY = QValueFactoryImpl.getInstance();
 
@@ -266,7 +266,10 @@ public final class Values {
                 if (type == toHex(BLOB_REF_TYPE)) {
                     try {
                         if (binaryHandler == null) {
-                            throw new IllegalArgumentException("Binary value found but binaryHandler
is null");
+                            IllegalArgumentException e = new IllegalArgumentException("Binary
value found but " +
+                                    "binaryHandler is null");
+                            log.error(e.getMessage(), e);
+                            throw e;
                         }
                         return binaryHandler.apply(val.substring(2));
                     }
@@ -445,7 +448,7 @@ public final class Values {
                 }
                 else {
                     IllegalStateException e = new IllegalStateException("No default value
for property " + propertyName);
-                    log.debug(e.getMessage(), e);
+                    log.error(e.getMessage(), e);
                     throw e;
                 }
             }
@@ -478,7 +481,9 @@ public final class Values {
         }
         catch (RepositoryException e) {
             // Should not happen
-            throw new IllegalStateException(e.getMessage(), e);
+            IllegalStateException e1 = new IllegalStateException(e.getMessage(), e);
+            log.error(e1.getMessage(), e1);
+            throw e1;
         }
     }
 



Mime
View raw message