jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r490593 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: ./ cluster/ nodetype/ nodetype/compact/ nodetype/xml/ query/lucene/ query/sql/ query/xpath/ value/ version/ xml/
Date Wed, 27 Dec 2006 23:25:46 GMT
Author: jukka
Date: Wed Dec 27 15:25:41 2006
New Revision: 490593

URL: http://svn.apache.org/viewvc?view=rev&rev=490593
Log:
JCR-688: Use NameException instead of subclasses where appropriate.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordInput.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
    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/RowIteratorImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Wed Dec 27 15:25:41 2006
@@ -41,13 +41,11 @@
 import org.apache.jackrabbit.core.version.DateVersionSelector;
 import org.apache.jackrabbit.core.version.VersionImpl;
 import org.apache.jackrabbit.core.lock.LockManager;
-import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.MalformedPathException;
 import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.PathFormat;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.util.ChildrenCollectorFilter;
@@ -399,10 +397,8 @@
         QName qName;
         try {
             qName = NameFormat.parse(name, session.getNamespaceResolver());
-        } catch (IllegalNameException ine) {
-            throw new RepositoryException("invalid property name: " + name, ine);
-        } catch (UnknownPrefixException upe) {
-            throw new RepositoryException("invalid property name: " + name, upe);
+        } catch (NameException e) {
+            throw new RepositoryException("invalid property name: " + name, e);
         }
         return getOrCreateProperty(qName, type, multiValued, exactTypeMatch, status);
     }
@@ -576,12 +572,9 @@
         QName qName;
         try {
             qName = NameFormat.parse(propName, session.getNamespaceResolver());
-        } catch (IllegalNameException ine) {
-            throw new RepositoryException("invalid property name: "
-                    + propName, ine);
-        } catch (UnknownPrefixException upe) {
-            throw new RepositoryException("invalid property name: "
-                    + propName, upe);
+        } catch (NameException e) {
+            throw new RepositoryException(
+                    "invalid property name: " + propName, e);
         }
         removeChildProperty(qName);
     }
@@ -2562,10 +2555,9 @@
         QName ntName;
         try {
             ntName = NameFormat.parse(nodeTypeName, session.getNamespaceResolver());
-        } catch (IllegalNameException ine) {
-            throw new RepositoryException("invalid node type name: " + nodeTypeName, ine);
-        } catch (UnknownPrefixException upe) {
-            throw new RepositoryException("invalid node type name: " + nodeTypeName, upe);
+        } catch (NameException e) {
+            throw new RepositoryException(
+                    "invalid node type name: " + nodeTypeName, e);
         }
         return isNodeType(ntName);
     }
@@ -2609,10 +2601,9 @@
         QName ntName;
         try {
             ntName = NameFormat.parse(mixinName, session.getNamespaceResolver());
-        } catch (IllegalNameException ine) {
-            throw new RepositoryException("invalid mixin type name: " + mixinName, ine);
-        } catch (UnknownPrefixException upe) {
-            throw new RepositoryException("invalid mixin type name: " + mixinName, upe);
+        } catch (NameException e) {
+            throw new RepositoryException(
+                    "invalid mixin type name: " + mixinName, e);
         }
 
         addMixin(ntName);
@@ -2627,10 +2618,9 @@
         QName ntName;
         try {
             ntName = NameFormat.parse(mixinName, session.getNamespaceResolver());
-        } catch (IllegalNameException ine) {
-            throw new RepositoryException("invalid mixin type name: " + mixinName, ine);
-        } catch (UnknownPrefixException upe) {
-            throw new RepositoryException("invalid mixin type name: " + mixinName, upe);
+        } catch (NameException e) {
+            throw new RepositoryException(
+                    "invalid mixin type name: " + mixinName, e);
         }
 
         removeMixin(ntName);
@@ -2664,12 +2654,9 @@
         QName ntName;
         try {
             ntName = NameFormat.parse(mixinName, session.getNamespaceResolver());
-        } catch (IllegalNameException ine) {
-            throw new RepositoryException("invalid mixin type name: "
-                    + mixinName, ine);
-        } catch (UnknownPrefixException upe) {
-            throw new RepositoryException("invalid mixin type name: "
-                    + mixinName, upe);
+        } catch (NameException e) {
+            throw new RepositoryException(
+                    "invalid mixin type name: " + mixinName, e);
         }
 
         NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordInput.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordInput.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordInput.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordInput.java
Wed Dec 27 15:25:41 2006
@@ -21,11 +21,10 @@
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader;
 import org.apache.jackrabbit.core.nodetype.compact.ParseException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.name.NameFormat;
-import org.apache.jackrabbit.name.IllegalNameException;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.PathFormat;
 import org.apache.jackrabbit.name.MalformedPathException;
@@ -144,10 +143,9 @@
      *
      * @return name
      * @throws IOException if an I/O error occurs
-     * @throws IllegalNameException if the name retrieved is illegal
-     * @throws UnknownPrefixException if the prefix is unknown
+     * @throws NameException if the name retrieved is illegal
      */
-    public QName readQName() throws IOException, IllegalNameException, UnknownPrefixException
{
+    public QName readQName() throws IOException, NameException {
         checkOpen();
 
         return NameFormat.parse(readString(), resolver);
@@ -158,10 +156,9 @@
      *
      * @return path element
      * @throws IOException if an I/O error occurs
-     * @throws IllegalNameException if the name retrieved is illegal
-     * @throws UnknownPrefixException if the prefix is unknown
+     * @throws NameException if the name retrieved is illegal
      */
-    public Path.PathElement readPathElement() throws IOException, IllegalNameException, UnknownPrefixException
{
+    public Path.PathElement readPathElement() throws IOException, NameException {
         checkOpen();
 
         QName name = NameFormat.parse(readString(), resolver);
@@ -220,10 +217,9 @@
      *
      * @return property id
      * @throws IOException if an I/O error occurs
-     * @throws IllegalNameException if the name retrieved is illegal
-     * @throws UnknownPrefixException if the prefix is unknown
+     * @throws NameException if the name retrieved is illegal
      */
-    public PropertyId readPropertyId() throws IOException, IllegalNameException, UnknownPrefixException
 {
+    public PropertyId readPropertyId() throws IOException, NameException  {
         checkOpen();
 
         return new PropertyId(readNodeId(), readQName());

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
Wed Dec 27 15:25:41 2006
@@ -17,12 +17,10 @@
 package org.apache.jackrabbit.core.nodetype;
 
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.apache.jackrabbit.value.ValueFactoryImpl;
@@ -256,11 +254,8 @@
         QName ntName;
         try {
             ntName = NameFormat.parse(nodeTypeName, nsResolver);
-        } catch (IllegalNameException ine) {
-            log.warn("invalid node type name: " + nodeTypeName, ine);
-            return false;
-        } catch (UnknownPrefixException upe) {
-            log.warn("invalid node type name: " + nodeTypeName, upe);
+        } catch (NameException e) {
+            log.warn("invalid node type name: " + nodeTypeName, e);
             return false;
         }
         return (getQName().equals(ntName) || isDerivedFrom(ntName));

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
Wed Dec 27 15:25:41 2006
@@ -17,11 +17,9 @@
 package org.apache.jackrabbit.core.nodetype;
 
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.util.IteratorHelper;
 import org.apache.jackrabbit.util.name.NamespaceMapping;
@@ -237,10 +235,8 @@
 
                     NodeTypeDef[] defs = ntr.getNodeTypeDefs();
                     nodeTypeDefs.addAll(Arrays.asList(defs));
-                } catch (IllegalNameException e) {
-                    throw new RepositoryException("Illegal JCR name syntax", e);
-                } catch (UnknownPrefixException e) {
-                    throw new RepositoryException("Unknown namespace prefix", e);
+                } catch (NameException e) {
+                    throw new RepositoryException("Illegal JCR name", e);
                 }
             } else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND)) {
                 try {
@@ -412,10 +408,8 @@
             throws NoSuchNodeTypeException {
         try {
             return getNodeType(NameFormat.parse(nodeTypeName, nsResolver));
-        } catch (UnknownPrefixException upe) {
-            throw new NoSuchNodeTypeException(nodeTypeName, upe);
-        } catch (IllegalNameException ine) {
-            throw new NoSuchNodeTypeException(nodeTypeName, ine);
+        } catch (NameException e) {
+            throw new NoSuchNodeTypeException(nodeTypeName, e);
         }
     }
 
@@ -490,7 +484,7 @@
             return getNodeTypeRegistry().isRegistered(qname);
         } catch (NameException e) {
            throw new RepositoryException();
-        }      
+        }
     }
 
     //-------------------------------------------------------------< Dumpable >
@@ -501,5 +495,5 @@
         ps.println("NodeTypeManager (" + this + ")");
         ps.println();
         ntReg.dump(ps);
-    }  
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
Wed Dec 27 15:25:41 2006
@@ -18,13 +18,12 @@
 
 import org.apache.jackrabbit.core.value.BLOBFileValue;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.PathFormat;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.value.DateValue;
@@ -622,16 +621,11 @@
         try {
             NameFormat.checkFormat(definition);
             name = NameFormat.parse(definition, nsResolver);
-        } catch (IllegalNameException ine) {
+        } catch (NameException e) {
             String msg = "invalid name specified as value constraint: "
                     + definition;
             log.debug(msg);
-            throw new InvalidConstraintException(msg, ine);
-        } catch (UnknownPrefixException upe) {
-            String msg = "invalid name specified as value constraint: "
-                    + definition;
-            log.debug(msg);
-            throw new InvalidConstraintException(msg, upe);
+            throw new InvalidConstraintException(msg, e);
         }
     }
 
@@ -680,16 +674,11 @@
         // format: node type name
         try {
             ntName = NameFormat.parse(definition, nsResolver);
-        } catch (IllegalNameException ine) {
-            String msg = "invalid node type name specified as value constraint: "
-                    + definition;
-            log.debug(msg);
-            throw new InvalidConstraintException(msg, ine);
-        } catch (UnknownPrefixException upe) {
+        } catch (NameException e) {
             String msg = "invalid node type name specified as value constraint: "
                     + definition;
             log.debug(msg);
-            throw new InvalidConstraintException(msg, upe);
+            throw new InvalidConstraintException(msg, e);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
Wed Dec 27 15:25:41 2006
@@ -25,10 +25,9 @@
 import org.apache.jackrabbit.core.nodetype.PropDefImpl;
 import org.apache.jackrabbit.core.nodetype.ValueConstraint;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.util.name.NamespaceMapping;
 import org.apache.jackrabbit.value.ValueHelper;
@@ -634,10 +633,7 @@
     private QName toQName(String stringName) throws ParseException {
         try {
             return NameFormat.parse(stringName, nsMapping);
-        } catch (IllegalNameException e) {
-            lexer.fail("Error while parsing '" + stringName + "'", e);
-            return null;
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             lexer.fail("Error while parsing '" + stringName + "'", e);
             return null;
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
Wed Dec 27 15:25:41 2006
@@ -27,10 +27,9 @@
 import org.apache.jackrabbit.core.nodetype.ValueConstraint;
 import org.apache.jackrabbit.core.util.DOMWalker;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.apache.jackrabbit.value.ValueFactoryImpl;
@@ -66,10 +65,7 @@
         try {
             NodeTypeReader reader = new NodeTypeReader(xml);
             return reader.getNodeTypeDefs();
-        } catch (IllegalNameException e) {
-            throw new InvalidNodeTypeDefException(
-                    "Invalid namespace reference in a node type definition", e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new InvalidNodeTypeDefException(
                     "Invalid namespace reference in a node type definition", e);
         }
@@ -110,14 +106,11 @@
      *
      * @return node type definitions
      * @throws InvalidNodeTypeDefException if a definition is invalid
-     * @throws IllegalNameException        if a definition contains an
+     * @throws NameException               if a definition contains an
      *                                     illegal name
-     * @throws UnknownPrefixException      if a definition contains an
-     *                                     unknown namespace prefix
      */
     public NodeTypeDef[] getNodeTypeDefs()
-            throws InvalidNodeTypeDefException, IllegalNameException,
-            UnknownPrefixException {
+            throws InvalidNodeTypeDefException, NameException {
         Vector defs = new Vector();
         while (walker.iterateElements(Constants.NODETYPE_ELEMENT)) {
             defs.add(getNodeTypeDef());
@@ -130,14 +123,11 @@
      *
      * @return node type definition
      * @throws InvalidNodeTypeDefException if the definition is invalid
-     * @throws IllegalNameException        if the definition contains an
+     * @throws NameException               if the definition contains an
      *                                     illegal name
-     * @throws UnknownPrefixException      if the definition contains an
-     *                                     unknown namespace prefix
      */
     private NodeTypeDef getNodeTypeDef()
-            throws InvalidNodeTypeDefException, IllegalNameException,
-            UnknownPrefixException {
+            throws InvalidNodeTypeDefException, NameException {
         NodeTypeDef type = new NodeTypeDef();
 
         type.setName(NameFormat.parse(
@@ -195,14 +185,11 @@
      *
      * @return property definition
      * @throws InvalidNodeTypeDefException if the definition is invalid
-     * @throws IllegalNameException        if the definition contains an
+     * @throws NameException               if the definition contains an
      *                                     illegal name
-     * @throws UnknownPrefixException      if the definition contains an
-     *                                     unknown namespace prefix
      */
     private PropDefImpl getPropDef()
-            throws InvalidNodeTypeDefException, IllegalNameException,
-            UnknownPrefixException {
+            throws InvalidNodeTypeDefException, NameException {
         PropDefImpl def = new PropDefImpl();
         String name = walker.getAttribute(Constants.NAME_ATTRIBUTE);
         if (name.equals("*")) {
@@ -277,13 +264,9 @@
      * Returns the child node definition specified by the current element.
      *
      * @return child node definition
-     * @throws IllegalNameException        if the definition contains an
-     *                                     illegal name
-     * @throws UnknownPrefixException      if the definition contains an
-     *                                     unknown namespace prefix
+     * @throws NameException if the definition contains an illegal name
      */
-    private NodeDefImpl getChildNodeDef()
-            throws IllegalNameException, UnknownPrefixException {
+    private NodeDefImpl getChildNodeDef() throws NameException {
         NodeDefImpl def = new NodeDefImpl();
         String name = walker.getAttribute(Constants.NAME_ATTRIBUTE);
         if (name.equals("*")) {

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?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- 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 Dec 27 15:25:41 2006
@@ -38,12 +38,11 @@
 import org.apache.jackrabbit.core.query.lucene.fulltext.QueryParser;
 import org.apache.jackrabbit.core.query.lucene.fulltext.ParseException;
 import org.apache.jackrabbit.core.state.ItemStateManager;
-import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.name.PathFormat;
 import org.apache.jackrabbit.util.ISO8601;
@@ -294,12 +293,7 @@
                     terms.add(t);
                 }
             }
-        } catch (IllegalNameException e) {
-            exceptions.add(e);
-        } catch (UnknownPrefixException e) {
-            exceptions.add(e);
-        } catch (NoPrefixDeclaredException e) {
-            // should never happen
+        } catch (NameException e) {
             exceptions.add(e);
         } catch (RepositoryException e) {
             exceptions.add(e);
@@ -883,9 +877,7 @@
                     try {
                         values.add(nsMappings.translatePropertyName(literal, session.getNamespaceResolver()));
                         log.debug("Coerced " + literal + " into NAME.");
-                    } catch (IllegalNameException e) {
-                        log.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
-                    } catch (UnknownPrefixException e) {
+                    } catch (NameException e) {
                         log.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
                     }
                     break;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
Wed Dec 27 15:25:41 2006
@@ -18,10 +18,9 @@
 
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.PropertyImpl;
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.value.LongValue;
 import org.apache.jackrabbit.value.PathValue;
@@ -273,9 +272,7 @@
                         return null;
                     }
                 }
-            } catch (IllegalNameException e) {
-                throw new RepositoryException(e.getMessage(), e);
-            } catch (UnknownPrefixException e) {
+            } catch (NameException e) {
                 throw new RepositoryException(e.getMessage(), e);
             }
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
Wed Dec 27 15:25:41 2006
@@ -30,10 +30,9 @@
 import org.apache.jackrabbit.core.query.RelationQueryNode;
 import org.apache.jackrabbit.core.query.TextsearchQueryNode;
 import org.apache.jackrabbit.core.query.PropertyFunctionQueryNode;
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.MalformedPathException;
@@ -654,10 +653,8 @@
                 if (name != null) {
                     try {
                         qName = NameFormat.parse(name, resolver);
-                    } catch (IllegalNameException e) {
+                    } catch (NameException e) {
                         throw new IllegalArgumentException("Illegal name: " + name);
-                    } catch (UnknownPrefixException e) {
-                        throw new IllegalArgumentException("Unknown prefix: " + name);
                     }
                 }
                 // if name test is % this means also search descendants

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Wed Dec 27 15:25:41 2006
@@ -32,11 +32,10 @@
 import org.apache.jackrabbit.core.query.TextsearchQueryNode;
 import org.apache.jackrabbit.core.query.PropertyFunctionQueryNode;
 import org.apache.jackrabbit.core.query.DefaultQueryNodeVisitor;
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.util.ISO8601;
@@ -410,10 +409,8 @@
                         QName nt = NameFormat.parse(ntName, resolver);
                         NodeTypeQueryNode nodeType = new NodeTypeQueryNode(loc, nt);
                         loc.addPredicate(nodeType);
-                    } catch (IllegalNameException e) {
+                    } catch (NameException e) {
                         exceptions.add(new InvalidQueryException("Not a valid name: " + ntName));
-                    } catch (UnknownPrefixException e) {
-                        exceptions.add(new InvalidQueryException("Unknown prefix in name:
" + ntName));
                     }
                 }
                 break;
@@ -562,10 +559,8 @@
                             ts.setReferencesProperty(true);
                         }
                     }
-                } catch (IllegalNameException e) {
+                } catch (NameException e) {
                     exceptions.add(new InvalidQueryException("Illegal name: " + child.getValue()));
-                } catch (UnknownPrefixException e) {
-                    exceptions.add(new InvalidQueryException("Unknown prefix: " + child.getValue()));
                 }
             } else if (child.getId() == JJTSTAR) {
                 if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
@@ -862,10 +857,8 @@
                                 QName name = null;
                                 try {
                                     name = ISO9075.decode(NameFormat.parse(value, resolver));
-                                } catch (IllegalNameException e) {
+                                } catch (NameException e) {
                                     exceptions.add(new InvalidQueryException("Illegal name:
" + value));
-                                } catch (UnknownPrefixException e) {
-                                    exceptions.add(new InvalidQueryException("Unknown prefix:
" + value));
                                 }
                                 derefNode.setNameTest(name);
                             }
@@ -929,9 +922,7 @@
                     QName name = NameFormat.parse(fName + "()", resolver);
                     RelationQueryNode relNode = (RelationQueryNode) queryNode;
                     relNode.setRelativePath(Path.create(name, 0));
-                } catch (IllegalNameException e) {
-                    exceptions.add(e);
-                } catch (UnknownPrefixException e) {
+                } catch (NameException e) {
                     exceptions.add(e);
                 }
             } else {
@@ -957,10 +948,8 @@
             QName name = ISO9075.decode(NameFormat.parse(propName, resolver));
             spec = new OrderQueryNode.OrderSpec(name, true);
             queryNode.addOrderSpec(spec);
-        } catch (IllegalNameException e) {
+        } catch (NameException e) {
             exceptions.add(new InvalidQueryException("Illegal name: " + child.getValue()));
-        } catch (UnknownPrefixException e) {
-            exceptions.add(new InvalidQueryException("Unknown prefix: " + child.getValue()));
         }
         return spec;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
Wed Dec 27 15:25:41 2006
@@ -17,13 +17,12 @@
 package org.apache.jackrabbit.core.value;
 
 import org.apache.jackrabbit.core.fs.FileSystemResource;
-import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.name.PathFormat;
 import org.apache.jackrabbit.util.ISO8601;
@@ -124,10 +123,8 @@
             case PropertyType.NAME:
                 try {
                     return new InternalValue(NameFormat.parse(value.getString(), nsResolver));
-                } catch (IllegalNameException ine) {
-                    throw new ValueFormatException(ine.getMessage());
-                } catch (UnknownPrefixException upe) {
-                    throw new ValueFormatException(upe.getMessage());
+                } catch (NameException e) {
+                    throw new ValueFormatException(e.getMessage());
                 }
             case PropertyType.PATH:
                 try {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
Wed Dec 27 15:25:41 2006
@@ -22,10 +22,9 @@
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -111,9 +110,7 @@
                 throw new VersionException("No version with name '" + versionName + "' exists
in this version history.");
             }
             return (Version) session.getNodeById(v.getId());
-        } catch (IllegalNameException e) {
-            throw new VersionException(e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new VersionException(e);
         }
     }
@@ -129,9 +126,7 @@
                 throw new VersionException("No version with label '" + label + "' exists
in this version history.");
             }
             return (Version) session.getNodeById(v.getId());
-        } catch (IllegalNameException e) {
-            throw new VersionException(e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new VersionException(e);
         }
     }
@@ -146,9 +141,7 @@
                     NameFormat.parse(versionName, session.getNamespaceResolver()),
                     NameFormat.parse(label, session.getNamespaceResolver()),
                     move);
-        } catch (IllegalNameException e) {
-            throw new VersionException(e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new VersionException(e);
         }
     }
@@ -165,9 +158,7 @@
             if (existing == null) {
                 throw new VersionException("No version with label '" + label + "' exists
in this version history.");
             }
-        } catch (IllegalNameException e) {
-            throw new VersionException(e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new VersionException(e);
         }
     }
@@ -214,9 +205,7 @@
         try {
             QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
             return getInternalVersionHistory().getVersionByLabel(qLabel) != null;
-        } catch (IllegalNameException e) {
-            throw new IllegalArgumentException("Unable to resolve label: " + e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new IllegalArgumentException("Unable to resolve label: " + e);
         }
     }
@@ -230,9 +219,7 @@
         try {
             QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
             return ((VersionImpl) version).getInternalVersion().hasLabel(qLabel);
-        } catch (IllegalNameException e) {
-            throw new VersionException(e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new VersionException(e);
         }
     }
@@ -246,9 +233,7 @@
         try {
             session.getVersionManager().removeVersion(this,
                     NameFormat.parse(versionName, session.getNamespaceResolver()));
-        } catch (IllegalNameException e) {
-            throw new RepositoryException(e);
-        } catch (UnknownPrefixException e) {
+        } catch (NameException e) {
             throw new RepositoryException(e);
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java?view=diff&rev=490593&r1=490592&r2=490593
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
Wed Dec 27 15:25:41 2006
@@ -16,9 +16,8 @@
  */
 package org.apache.jackrabbit.core.xml;
 
-import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.core.NodeId;
 import org.xml.sax.Attributes;
@@ -137,10 +136,8 @@
             ImportState state = new ImportState();
             try {
                 state.nodeName = NameFormat.parse(name, nsContext);
-            } catch (IllegalNameException ine) {
-                throw new SAXException(new InvalidSerializedDataException("illegal node name:
" + name, ine));
-            } catch (UnknownPrefixException upe) {
-                throw new SAXException(new InvalidSerializedDataException("illegal node name:
" + name, upe));
+            } catch (NameException e) {
+                throw new SAXException(new InvalidSerializedDataException("illegal node name:
" + name, e));
             }
             stack.push(state);
         } else if (SysViewSAXEventGenerator.PROPERTY_ELEMENT.equals(localName)) {
@@ -157,10 +154,8 @@
             }
             try {
                 currentPropName = NameFormat.parse(name, nsContext);
-            } catch (IllegalNameException ine) {
-                throw new SAXException(new InvalidSerializedDataException("illegal property
name: " + name, ine));
-            } catch (UnknownPrefixException upe) {
-                throw new SAXException(new InvalidSerializedDataException("illegal property
name: " + name, upe));
+            } catch (NameException e) {
+                throw new SAXException(new InvalidSerializedDataException("illegal property
name: " + name, e));
             }
             // property type (sv:type attribute)
             String type = atts.getValue(SysViewSAXEventGenerator.PREFIXED_TYPE_ATTRIBUTE);
@@ -247,10 +242,8 @@
                     state.nodeTypeName = NameFormat.parse(s, nsContext);
                 } catch (IOException ioe) {
                     throw new SAXException("error while retrieving value", ioe);
-                } catch (IllegalNameException ine) {
-                    throw new SAXException(new InvalidSerializedDataException("illegal node
type name: " + s, ine));
-                } catch (UnknownPrefixException upe) {
-                    throw new SAXException(new InvalidSerializedDataException("illegal node
type name: " + s, upe));
+                } catch (NameException e) {
+                    throw new SAXException(new InvalidSerializedDataException("illegal node
type name: " + s, e));
                 }
             } else if (currentPropName.equals(QName.JCR_MIXINTYPES)) {
                 if (state.mixinNames == null) {
@@ -266,10 +259,8 @@
                         state.mixinNames.add(mixin);
                     } catch (IOException ioe) {
                         throw new SAXException("error while retrieving value", ioe);
-                    } catch (IllegalNameException ine) {
-                        throw new SAXException(new InvalidSerializedDataException("illegal
mixin type name: " + s, ine));
-                    } catch (UnknownPrefixException upe) {
-                        throw new SAXException(new InvalidSerializedDataException("illegal
mixin type name: " + s, upe));
+                    } catch (NameException e) {
+                        throw new SAXException(new InvalidSerializedDataException("illegal
mixin type name: " + s, e));
                     }
                 }
             } else if (currentPropName.equals(QName.JCR_UUID)) {



Mime
View raw message