jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r421219 [2/2] - in /jackrabbit/trunk/jackrabbit/src: main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/lock/ main/java/org/apache/jackrabbit/core/nodetype/ main/java/org/apache/jackrabbit/core/nodetype/compact/ main...
Date Wed, 12 Jul 2006 10:15:19 GMT
Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java Wed Jul 12 03:15:17 2006
@@ -36,6 +36,7 @@
 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.ISO8601;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.commons.collections.map.ReferenceMap;
@@ -195,7 +196,7 @@
     /**
      * Map of reusable XPath parser instances indexed by NamespaceResolver.
      */
-    private static Map parsers = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
+    private static final Map parsers = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
 
     /**
      * The root <code>QueryNode</code>
@@ -273,8 +274,7 @@
     public static QueryRootNode createQuery(String statement,
                                             NamespaceResolver resolver)
             throws InvalidQueryException {
-        QueryRootNode root = new XPathQueryBuilder(statement, resolver).getRootNode();
-        return root;
+        return new XPathQueryBuilder(statement, resolver).getRootNode();
     }
 
     /**
@@ -391,7 +391,7 @@
                     LocationStepQueryNode loc = (LocationStepQueryNode) queryNode;
                     String ntName = ((SimpleNode) node.jjtGetChild(0)).getValue();
                     try {
-                        QName nt = QName.fromJCRName(ntName, resolver);
+                        QName nt = NameFormat.parse(ntName, resolver);
                         NodeTypeQueryNode nodeType = new NodeTypeQueryNode(loc, nt);
                         loc.addPredicate(nodeType);
                     } catch (IllegalNameException e) {
@@ -516,25 +516,25 @@
             if (child.getId() == JJTQNAME || child.getId() == JJTQNAMEFORITEMTYPE) {
                 try {
                     if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
-                        QName name = ISO9075.decode(QName.fromJCRName(child.getValue(), resolver));
+                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                         if (name.equals(JCR_ROOT)) {
                             name = LocationStepQueryNode.EMPTY_NAME;
                         }
                         ((LocationStepQueryNode) queryNode).setNameTest(name);
                     } else if (queryNode.getType() == QueryNode.TYPE_DEREF) {
-                        QName name = ISO9075.decode(QName.fromJCRName(child.getValue(), resolver));
+                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                         ((DerefQueryNode) queryNode).setRefProperty(name);
                     } else if (queryNode.getType() == QueryNode.TYPE_RELATION) {
-                        QName name = ISO9075.decode(QName.fromJCRName(child.getValue(), resolver));
+                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                         ((RelationQueryNode) queryNode).setProperty(name);
                     } else if (queryNode.getType() == QueryNode.TYPE_PATH) {
-                        QName name = ISO9075.decode(QName.fromJCRName(child.getValue(), resolver));
+                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                         root.addSelectProperty(name);
                     } else if (queryNode.getType() == QueryNode.TYPE_ORDER) {
-                        QName name = ISO9075.decode(QName.fromJCRName(child.getValue(), resolver));
+                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                         root.getOrderNode().addOrderSpec(name, true);
                     } else if (queryNode.getType() == QueryNode.TYPE_TEXTSEARCH) {
-                        QName name = ISO9075.decode(QName.fromJCRName(child.getValue(), resolver));
+                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                         ((TextsearchQueryNode) queryNode).setPropertyName(name);
                     }
                 } catch (IllegalNameException e) {
@@ -606,7 +606,7 @@
      * Creates the primary path query node.
      *
      * @param node xpath node representing the root of the parsed tree.
-     * @return
+     * @return the path qurey node
      */
     private PathQueryNode createPathQueryNode(SimpleNode node) {
         root.setLocationNode(new PathQueryNode(root));
@@ -646,15 +646,15 @@
      *
      * @param node      the function node from the xpath tree.
      * @param queryNode the current query node.
-     * @return
+     * @return the function node
      */
     private QueryNode createFunction(SimpleNode node, QueryNode queryNode) {
         // find out function name
         String fName = ((SimpleNode) node.jjtGetChild(0)).getValue();
         fName = fName.substring(0, fName.length() - 1);
         try {
-            if (FN_NOT.toJCRName(resolver).equals(fName)
-                    || FN_NOT_10.toJCRName(resolver).equals(fName)) {
+            if (NameFormat.format(FN_NOT, resolver).equals(fName)
+                    || NameFormat.format(FN_NOT_10, resolver).equals(fName)) {
                 if (queryNode instanceof NAryQueryNode) {
                     QueryNode not = new NotQueryNode(queryNode);
                     ((NAryQueryNode) queryNode).addOperand(not);
@@ -669,7 +669,7 @@
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for function fn:not"));
                 }
-            } else if (XS_DATETIME.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(XS_DATETIME, resolver).equals(fName)) {
                 // check arguments
                 if (node.jjtGetNumChildren() == 2) {
                     if (queryNode instanceof RelationQueryNode) {
@@ -695,7 +695,7 @@
                     // wrong number of arguments
                     exceptions.add(new InvalidQueryException("Wrong number of arguments for xs:dateTime"));
                 }
-            } else if (JCR_CONTAINS.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(JCR_CONTAINS, resolver).equals(fName)) {
                 // check number of arguments
                 if (node.jjtGetNumChildren() == 3) {
                     if (queryNode instanceof NAryQueryNode) {
@@ -715,7 +715,7 @@
                     // wrong number of arguments
                     exceptions.add(new InvalidQueryException("Wrong number of arguments for jcr:contains"));
                 }
-            } else if (JCR_LIKE.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(JCR_LIKE, resolver).equals(fName)) {
                 // check number of arguments
                 if (node.jjtGetNumChildren() == 3) {
                     if (queryNode instanceof NAryQueryNode) {
@@ -742,21 +742,21 @@
                     // wrong number of arguments
                     exceptions.add(new InvalidQueryException("Wrong number of arguments for jcr:like"));
                 }
-            } else if (FN_TRUE.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(FN_TRUE, resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_RELATION) {
                     RelationQueryNode rel = (RelationQueryNode) queryNode;
                     rel.setStringValue("true");
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for true()"));
                 }
-            } else if (FN_FALSE.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(FN_FALSE, resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_RELATION) {
                     RelationQueryNode rel = (RelationQueryNode) queryNode;
                     rel.setStringValue("false");
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for false()"));
                 }
-            } else if (FN_POSITION.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(FN_POSITION, resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_RELATION) {
                     RelationQueryNode rel = (RelationQueryNode) queryNode;
                     if (rel.getOperation() == RelationQueryNode.OPERATION_EQ_GENERAL) {
@@ -770,7 +770,7 @@
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for position()"));
                 }
-            } else if (FN_FIRST.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(FN_FIRST, resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_RELATION) {
                     ((RelationQueryNode) queryNode).setPositionValue(1);
                 } else if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
@@ -778,7 +778,7 @@
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for first()"));
                 }
-            } else if (FN_LAST.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(FN_LAST, resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_RELATION) {
                     ((RelationQueryNode) queryNode).setPositionValue(LocationStepQueryNode.LAST);
                 } else if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
@@ -786,7 +786,7 @@
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for last()"));
                 }
-            } else if (JCR_DEREF.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(JCR_DEREF, resolver).equals(fName)) {
                 // check number of arguments
                 if (node.jjtGetNumChildren() == 3) {
                     boolean descendant = false;
@@ -816,7 +816,7 @@
                             if (!value.equals("*")) {
                                 QName name = null;
                                 try {
-                                    name = ISO9075.decode(QName.fromJCRName(value, resolver));
+                                    name = ISO9075.decode(NameFormat.parse(value, resolver));
                                 } catch (IllegalNameException e) {
                                     exceptions.add(new InvalidQueryException("Illegal name: " + value));
                                 } catch (UnknownPrefixException e) {
@@ -846,7 +846,7 @@
                         exceptions.add(new InvalidQueryException("Unsupported location for jcr:deref()"));
                     }
                 }
-            } else if (JCR_SCORE.toJCRName(resolver).equals(fName)) {
+            } else if (NameFormat.format(JCR_SCORE, resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_ORDER) {
                     createOrderSpec(node, (OrderQueryNode) queryNode);
                 } else {
@@ -870,9 +870,9 @@
             if (child.getId() == JJTQNAMELPAR) {
                 // function name
                 // cut off left parenthesis at end
-                propName.substring(0, propName.length() - 1);
+                propName = propName.substring(0, propName.length() - 1);
             }
-            QName name = ISO9075.decode(QName.fromJCRName(propName, resolver));
+            QName name = ISO9075.decode(NameFormat.parse(propName, resolver));
             spec = new OrderQueryNode.OrderSpec(name, true);
             queryNode.addOrderSpec(spec);
         } catch (IllegalNameException e) {

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java Wed Jul 12 03:15:17 2006
@@ -24,6 +24,8 @@
 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;
 import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.value.BinaryValue;
@@ -121,7 +123,7 @@
                 return new InternalValue(new UUID(value.getString()));
             case PropertyType.NAME:
                 try {
-                    return new InternalValue(QName.fromJCRName(value.getString(), nsResolver));
+                    return new InternalValue(NameFormat.parse(value.getString(), nsResolver));
                 } catch (IllegalNameException ine) {
                     throw new ValueFormatException(ine.getMessage());
                 } catch (UnknownPrefixException upe) {
@@ -129,7 +131,7 @@
                 }
             case PropertyType.PATH:
                 try {
-                    return new InternalValue(Path.create(value.getString(), nsResolver, false));
+                    return new InternalValue(PathFormat.parse(value.getString(), nsResolver));
                 } catch (MalformedPathException mpe) {
                     throw new ValueFormatException(mpe.getMessage());
                 }
@@ -143,7 +145,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(String value) {
         return new InternalValue(value);
@@ -151,7 +153,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(long value) {
         return new InternalValue(value);
@@ -159,7 +161,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(double value) {
         return new InternalValue(value);
@@ -167,7 +169,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(Calendar value) {
         return new InternalValue(value);
@@ -175,7 +177,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(boolean value) {
         return new InternalValue(value);
@@ -183,7 +185,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(byte[] value) {
         return new InternalValue(new BLOBFileValue(value));
@@ -229,7 +231,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(QName value) {
         return new InternalValue(value);
@@ -237,7 +239,7 @@
 
     /**
      * @param values
-     * @return
+     * @return the created value
      */
     public static InternalValue[] create(QName[] values) {
         InternalValue[] ret = new InternalValue[values.length];
@@ -249,7 +251,7 @@
 
     /**
      * @param values
-     * @return
+     * @return the created value
      */
     public static InternalValue[] create(String[] values) {
         InternalValue[] ret = new InternalValue[values.length];
@@ -261,7 +263,7 @@
 
     /**
      * @param values
-     * @return
+     * @return the created value
      */
     public static InternalValue[] create(Calendar[] values) {
         InternalValue[] ret = new InternalValue[values.length];
@@ -273,7 +275,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(Path value) {
         return new InternalValue(value);
@@ -281,7 +283,7 @@
 
     /**
      * @param value
-     * @return
+     * @return the created value
      */
     public static InternalValue create(UUID value) {
         return new InternalValue(value);
@@ -307,17 +309,17 @@
             case PropertyType.LONG:
                 return new LongValue((Long) val);
             case PropertyType.REFERENCE:
-                return ReferenceValue.valueOf(((UUID) val).toString());
+                return ReferenceValue.valueOf(val.toString());
             case PropertyType.PATH:
                 try {
-                    return PathValue.valueOf(((Path) val).toJCRPath(nsResolver));
+                    return PathValue.valueOf(PathFormat.format((Path) val, nsResolver));
                 } catch (NoPrefixDeclaredException npde) {
                     // should never get here...
                     throw new RepositoryException("internal error: encountered unregistered namespace", npde);
                 }
             case PropertyType.NAME:
                 try {
-                    return NameValue.valueOf(((QName) val).toJCRName(nsResolver));
+                    return NameValue.valueOf(NameFormat.format((QName) val, nsResolver));
                 } catch (NoPrefixDeclaredException npde) {
                     // should never get here...
                     throw new RepositoryException("internal error: encountered unregistered namespace", npde);
@@ -330,14 +332,14 @@
     }
 
     /**
-     * @return
+     * @return the internal object
      */
     public Object internalValue() {
         return val;
     }
 
     /**
-     * @return
+     * @return the type
      */
     public int getType() {
         return type;
@@ -474,7 +476,7 @@
     }
 
     private InternalValue(boolean value) {
-        val = new Boolean(value);
+        val = Boolean.valueOf(value);
         type = PropertyType.BOOLEAN;
     }
 

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionHistory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionHistory.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionHistory.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionHistory.java Wed Jul 12 03:15:17 2006
@@ -26,6 +26,7 @@
 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;
 
@@ -104,7 +105,7 @@
     public Version getVersion(String versionName)
             throws VersionException, RepositoryException {
         try {
-            QName name = QName.fromJCRName(versionName, session.getNamespaceResolver());
+            QName name = NameFormat.parse(versionName, session.getNamespaceResolver());
             InternalVersion v = getInternalVersionHistory().getVersion(name);
             if (v == null) {
                 throw new VersionException("No version with name '" + versionName + "' exists in this version history.");
@@ -122,7 +123,7 @@
      */
     public Version getVersionByLabel(String label) throws RepositoryException {
         try {
-            QName qLabel = QName.fromJCRName(label, session.getNamespaceResolver());
+            QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
             InternalVersion v = getInternalVersionHistory().getVersionByLabel(qLabel);
             if (v == null) {
                 throw new VersionException("No version with label '" + label + "' exists in this version history.");
@@ -142,8 +143,8 @@
             throws VersionException, RepositoryException {
         try {
             session.getVersionManager().setVersionLabel(this,
-                    QName.fromJCRName(versionName, session.getNamespaceResolver()),
-                    QName.fromJCRName(label, session.getNamespaceResolver()),
+                    NameFormat.parse(versionName, session.getNamespaceResolver()),
+                    NameFormat.parse(label, session.getNamespaceResolver()),
                     move);
         } catch (IllegalNameException e) {
             throw new VersionException(e);
@@ -159,7 +160,7 @@
         try {
             Version existing = session.getVersionManager().setVersionLabel(this,
                     null,
-                    QName.fromJCRName(label, session.getNamespaceResolver()),
+                    NameFormat.parse(label, session.getNamespaceResolver()),
                     true);
             if (existing == null) {
                 throw new VersionException("No version with label '" + label + "' exists in this version history.");
@@ -180,7 +181,7 @@
             QName[] labels = getInternalVersionHistory().getVersionLabels();
             String[] ret = new String[labels.length];
             for (int i = 0; i < labels.length; i++) {
-                ret[i] = labels[i].toJCRName(session.getNamespaceResolver());
+                ret[i] = NameFormat.format(labels[i], session.getNamespaceResolver());
             }
             return ret;
         } catch (NoPrefixDeclaredException e) {
@@ -198,7 +199,7 @@
             QName[] labels = ((AbstractVersion) version).getInternalVersion().getLabels();
             String[] ret = new String[labels.length];
             for (int i = 0; i < labels.length; i++) {
-                ret[i] = labels[i].toJCRName(session.getNamespaceResolver());
+                ret[i] = NameFormat.format(labels[i], session.getNamespaceResolver());
             }
             return ret;
         } catch (NoPrefixDeclaredException e) {
@@ -211,7 +212,7 @@
      */
     public boolean hasVersionLabel(String label) throws RepositoryException {
         try {
-            QName qLabel = QName.fromJCRName(label, session.getNamespaceResolver());
+            QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
             return getInternalVersionHistory().getVersionByLabel(qLabel) != null;
         } catch (IllegalNameException e) {
             throw new IllegalArgumentException("Unable to resolve label: " + e);
@@ -227,7 +228,7 @@
             throws VersionException, RepositoryException {
         checkOwnVersion(version);
         try {
-            QName qLabel = QName.fromJCRName(label, session.getNamespaceResolver());
+            QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
             return ((AbstractVersion) version).getInternalVersion().hasLabel(qLabel);
         } catch (IllegalNameException e) {
             throw new VersionException(e);
@@ -244,7 +245,7 @@
             RepositoryException {
         try {
             session.getVersionManager().removeVersion(this,
-                    QName.fromJCRName(versionName, session.getNamespaceResolver()));
+                    NameFormat.parse(versionName, session.getNamespaceResolver()));
         } catch (IllegalNameException e) {
             throw new RepositoryException(e);
         } catch (UnknownPrefixException e) {

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java Wed Jul 12 03:15:17 2006
@@ -20,6 +20,7 @@
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.name.SessionNamespaceResolver;
 import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.name.NameFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.ContentHandler;
@@ -122,12 +123,12 @@
         // resolve the names of some wellknown properties
         // allowing for session-local prefix mappings
         try {
-            jcrPrimaryType = QName.JCR_PRIMARYTYPE.toJCRName(nsResolver);
-            jcrMixinTypes = QName.JCR_MIXINTYPES.toJCRName(nsResolver);
-            jcrUUID = QName.JCR_UUID.toJCRName(nsResolver);
-            jcrRoot = QName.JCR_ROOT.toJCRName(nsResolver);
-            jcrXMLText = QName.JCR_XMLTEXT.toJCRName(nsResolver);
-            jcrXMLCharacters = QName.JCR_XMLCHARACTERS.toJCRName(nsResolver);
+            jcrPrimaryType = NameFormat.format(QName.JCR_PRIMARYTYPE, nsResolver);
+            jcrMixinTypes = NameFormat.format(QName.JCR_MIXINTYPES, nsResolver);
+            jcrUUID = NameFormat.format(QName.JCR_UUID, nsResolver);
+            jcrRoot = NameFormat.format(QName.JCR_ROOT, nsResolver);
+            jcrXMLText = NameFormat.format(QName.JCR_XMLTEXT, nsResolver);
+            jcrXMLCharacters = NameFormat.format(QName.JCR_XMLCHARACTERS, nsResolver);
         } catch (NameException e) {
             // should never get here...
             String msg = "internal error: failed to resolve namespace mappings";

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java Wed Jul 12 03:15:17 2006
@@ -246,19 +246,19 @@
             } else if (targetType == PropertyType.BINARY) {
                 if (length() < 0x10000) {
                     // < 65kb: deserialize BINARY type using String
-                    return ValueHelper.deserialize(retrieve(), targetType, false);
+                    return ValueHelper.deserialize(retrieve(), targetType, false, ValueFactoryImpl.getInstance());
                 } else {
                     // >= 65kb: deserialize BINARY type using Reader
                     Reader reader = reader();
                     try {
-                        return ValueHelper.deserialize(reader, targetType, false);
+                        return ValueHelper.deserialize(reader, targetType, false, ValueFactoryImpl.getInstance());
                     } finally {
                         reader.close();
                     }
                 }
             } else {
                 // all other types
-                return ValueHelper.deserialize(retrieve(), targetType, true);
+                return ValueHelper.deserialize(retrieve(), targetType, true, ValueFactoryImpl.getInstance());
             }
         } catch (IOException e) {
             String msg = "failed to retrieve serialized value";

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java Wed Jul 12 03:15:17 2006
@@ -16,16 +16,9 @@
  */
 package org.apache.jackrabbit.core.xml;
 
-import java.io.IOException;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Stack;
-
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.name.NameException;
+import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.util.ISO9075;
 import org.slf4j.Logger;
@@ -33,6 +26,13 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Stack;
+
 /**
  * <code>DocViewImportHandler</code> processes Document View XML SAX events
  * and 'translates' them into <code>{@link Importer}</code> method calls.
@@ -54,7 +54,6 @@
      * Constructs a new <code>DocViewImportHandler</code>.
      *
      * @param importer
-     * @param nsContext
      */
     DocViewImportHandler(Importer importer) {
         super(importer);
@@ -194,7 +193,7 @@
                     // jcr:primaryType
                     if (attrValue.length() > 0) {
                         try {
-                            nodeTypeName = QName.fromJCRName(attrValue, nsContext);
+                            nodeTypeName = NameFormat.parse(attrValue, nsContext);
                         } catch (NameException ne) {
                             throw new SAXException("illegal jcr:primaryType value: "
                                     + attrValue, ne);

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java Wed Jul 12 03:15:17 2006
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.slf4j.Logger;
@@ -70,7 +71,7 @@
 
     private QName getQName(String rawName) throws RepositoryException {
         try {
-            return QName.fromJCRName(rawName, nsResolver);
+            return NameFormat.parse(rawName, nsResolver);
         } catch (NameException e) {
             // should never get here...
             String msg = "internal error: failed to resolve namespace mappings";

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java Wed Jul 12 03:15:17 2006
@@ -16,20 +16,20 @@
  */
 package org.apache.jackrabbit.core.xml;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.jcr.NamespaceException;
-
 import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.name.NameFormat;
 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.Path;
-import org.apache.jackrabbit.name.MalformedPathException;
 import org.apache.jackrabbit.name.PathFormat;
+import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.UnknownPrefixException;
+
+import javax.jcr.NamespaceException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * Hierarchically scoped namespace resolver. Each NamespaceContext instance
@@ -128,7 +128,7 @@
 
     /** {@inheritDoc} */
     public String getJCRName(QName name) throws NoPrefixDeclaredException {
-        return name.toJCRName(this);
+        return NameFormat.format(name, this);
     }
 
     public Path getQPath(String jcrPath) throws MalformedPathException {
@@ -142,7 +142,7 @@
     /** {@inheritDoc} */
     public QName getQName(String name)
             throws IllegalNameException, UnknownPrefixException {
-        return QName.fromJCRName(name, this);
+        return NameFormat.parse(name, this);
     }
 
 }

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java Wed Jul 12 03:15:17 2006
@@ -19,6 +19,7 @@
 import org.apache.jackrabbit.name.IllegalNameException;
 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;
 import org.xml.sax.SAXException;
@@ -135,7 +136,7 @@
             // push new ImportState instance onto the stack
             ImportState state = new ImportState();
             try {
-                state.nodeName = QName.fromJCRName(name, nsContext);
+                state.nodeName = NameFormat.parse(name, nsContext);
             } catch (IllegalNameException ine) {
                 throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, ine));
             } catch (UnknownPrefixException upe) {
@@ -155,7 +156,7 @@
                         "missing mandatory sv:name attribute of element sv:property"));
             }
             try {
-                currentPropName = QName.fromJCRName(name, nsContext);
+                currentPropName = NameFormat.parse(name, nsContext);
             } catch (IllegalNameException ine) {
                 throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, ine));
             } catch (UnknownPrefixException upe) {
@@ -243,7 +244,7 @@
                 String s = null;
                 try {
                     s = val.retrieve();
-                    state.nodeTypeName = QName.fromJCRName(s, nsContext);
+                    state.nodeTypeName = NameFormat.parse(s, nsContext);
                 } catch (IOException ioe) {
                     throw new SAXException("error while retrieving value", ioe);
                 } catch (IllegalNameException ine) {
@@ -261,7 +262,7 @@
                     String s = null;
                     try {
                         s = val.retrieve();
-                        QName mixin = QName.fromJCRName(s, nsContext);
+                        QName mixin = NameFormat.parse(s, nsContext);
                         state.mixinNames.add(mixin);
                     } catch (IOException ioe) {
                         throw new SAXException("error while retrieving value", ioe);

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/Path.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/Path.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/Path.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/Path.java Wed Jul 12 03:15:17 2006
@@ -18,10 +18,10 @@
 
 import org.apache.jackrabbit.util.Text;
 
+import javax.jcr.PathNotFoundException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.LinkedList;
-import javax.jcr.PathNotFoundException;
 
 /**
  * The <code>Path</code> utility class provides misc. methods to resolve and
@@ -315,25 +315,6 @@
         return new Path(new PathElement[]{elem}, !elem.equals(CURRENT_ELEMENT));
     }
 
-    //-------------------------------------------------------< implementation >
-    /**
-     * Parses the give string an d returns an array of path elements. if
-     * <code>master</code> is not <code>null</code>, it is prepended to the
-     * returned list. If <code>resolver</code> is <code>null</code>, this
-     * method only checks the format of the string and returns <code>null</code>.
-     *
-     * @param jcrPath
-     * @param master
-     * @param resolver
-     * @return
-     * @throws MalformedPathException
-     * @deprecated Use {@link PathFormat#parse(Path, String, NamespaceResolver)} instead.
-     */
-    private static Path parse(String jcrPath, Path master, NamespaceResolver resolver)
-            throws MalformedPathException {
-        return PathFormat.parse(master, jcrPath, resolver);
-    }
-
     //------------------------------------------------------< utility methods >
     /**
      * Checks if <code>jcrPath</code> is a valid JCR-style absolute or relative
@@ -555,9 +536,7 @@
             throw new PathNotFoundException("no such ancestor path of degree " + degree);
         }
         PathElement[] elements = new PathElement[length];
-        for (int i = 0; i < length; i++) {
-            elements[i] = this.elements[i];
-        }
+        System.arraycopy(this.elements, 0, elements, 0, length);
         return new Path(elements, normalized);
     }
 
@@ -1084,8 +1063,7 @@
          * @param resolver
          * @return {@link #LITERAL}
          */
-        public String toJCRName(NamespaceResolver resolver)
-                throws NoPrefixDeclaredException {
+        public String toJCRName(NamespaceResolver resolver) {
             return LITERAL;
         }
 
@@ -1148,8 +1126,7 @@
          * @param resolver
          * @return {@link #LITERAL}
          */
-        public String toJCRName(NamespaceResolver resolver)
-                throws NoPrefixDeclaredException {
+        public String toJCRName(NamespaceResolver resolver) {
             return LITERAL;
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/QName.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/QName.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/QName.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/name/QName.java Wed Jul 12 03:15:17 2006
@@ -605,7 +605,7 @@
      * @deprecated Use {@link NameFormat#checkFormat(String)} instead.
      */
     public static void checkFormat(String jcrName) throws IllegalNameException {
-        parse(jcrName);
+        NameFormat.checkFormat(jcrName);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt (original)
+++ jackrabbit/trunk/jackrabbit/src/main/javacc/sql/JCRSQL.jjt Wed Jul 12 03:15:17 2006
@@ -44,6 +44,7 @@
 import org.apache.jackrabbit.name.IllegalNameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameFormat;
 import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.core.query.QueryConstants;
 
@@ -503,7 +504,7 @@
     t = <REGULAR_IDENTIFIER>
       {
         try {
-          jjtThis.setName(QName.fromJCRName(t.image, resolver));
+          jjtThis.setName(NameFormat.parse(t.image, resolver));
         } catch (IllegalNameException e) {
           throw new ParseException(e.getMessage());
         } catch (UnknownPrefixException e) {
@@ -514,7 +515,7 @@
     t = <DELIMITED_IDENTIFIER>
       {
         try {
-          jjtThis.setName(QName.fromJCRName(t.image.substring(1, t.image.length()-1), resolver));
+          jjtThis.setName(NameFormat.parse(t.image.substring(1, t.image.length()-1), resolver));
         } catch (IllegalNameException e) {
           throw new ParseException(e.getMessage());
         } catch (UnknownPrefixException e) {
@@ -541,7 +542,7 @@
       )
       {
         try {
-          jjtThis.setName(QName.fromJCRName(t.image, resolver));
+          jjtThis.setName(NameFormat.parse(t.image, resolver));
         } catch (IllegalNameException e) {
           throw new ParseException(e.getMessage());
         } catch (UnknownPrefixException e) {

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/PathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/PathTest.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/PathTest.java (original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/PathTest.java Wed Jul 12 03:15:17 2006
@@ -17,12 +17,11 @@
 package org.apache.jackrabbit.name;
 
 import junit.framework.TestCase;
+import org.apache.jackrabbit.util.Text;
 
 import java.util.ArrayList;
-import java.util.List;
 import java.util.Iterator;
-
-import org.apache.jackrabbit.util.Text;
+import java.util.List;
 
 /**
  * This Class implements a test case for the 'Path' class.
@@ -113,20 +112,20 @@
                 try {
                     if (t.normalizedPath==null) {
                         // check just creation
-                        Path p = Path.create(t.path, resolver, false);
+                        Path p = PathFormat.parse(t.path, resolver);
                         if (!t.isValid()) {
                             fail("Should throw MalformedPathException: " + t.path);
                         }
-                        assertEquals("\"" + t.path + "\".create(false)", t.path,  p.toJCRPath(resolver));
+                        assertEquals("\"" + t.path + "\".create(false)", t.path,  PathFormat.format(p, resolver));
                         assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                         assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                     } else {
                         // check with normalization
-                        Path p = Path.create(t.path, resolver, true);
+                        Path p = PathFormat.parse(t.path, resolver).getNormalizedPath();
                         if (!t.isValid()) {
                             fail("Should throw MalformedPathException: " + t.path);
                         }
-                        assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, p.toJCRPath(resolver));
+                        assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, PathFormat.format(p, resolver));
                         assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                     }
                 } catch (MalformedPathException e) {
@@ -151,7 +150,7 @@
                     // check just creation
                     boolean isValid = true;
                     try {
-                        Path.checkFormat(t.path);
+                        PathFormat.checkFormat(t.path);
                     } catch (MalformedPathException e) {
                         isValid = false;
                     }
@@ -172,13 +171,13 @@
                 if (t.normalizedPath==null) {
                     // check just creation
                     Path p = build(t.path, resolver, false);
-                    assertEquals("\"" + t.path + "\".create(false)", t.path,  p.toJCRPath(resolver));
+                    assertEquals("\"" + t.path + "\".create(false)", t.path,  PathFormat.format(p, resolver));
                     assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                     assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                 } else {
                     // check with normalization
                     Path p = build(t.path, resolver, true);
-                    assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, p.toJCRPath(resolver));
+                    assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, PathFormat.format(p, resolver));
                     assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                 }
             }
@@ -192,13 +191,13 @@
                 if (t.normalizedPath==null) {
                     // check just creation
                     Path p = buildReverse(t.path, resolver, false);
-                    assertEquals("\"" + t.path + "\".create(false)", t.path,  p.toJCRPath(resolver));
+                    assertEquals("\"" + t.path + "\".create(false)", t.path,  PathFormat.format(p, resolver));
                     assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                     assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                 } else {
                     // check with normalization
                     Path p = buildReverse(t.path, resolver, true);
-                    assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, p.toJCRPath(resolver));
+                    assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, PathFormat.format(p, resolver));
                     assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                 }
             }
@@ -229,7 +228,7 @@
             } else if ("..".equals(elems[i])) {
                 name = new QName("", "..");
             } else {
-                name = QName.fromJCRName(elem, resolver);
+                name = NameFormat.parse(elem, resolver);
             }
             if (index < 0) {
                 builder.addLast(name);
@@ -261,7 +260,7 @@
             } else if ("..".equals(elems[i])) {
                 name = new QName("", "..");
             } else {
-                name = QName.fromJCRName(elem, resolver);
+                name = NameFormat.parse(elem, resolver);
             }
             if (index < 0) {
                 builder.addFirst(name);
@@ -424,7 +423,7 @@
         public String toString() {
             StringBuffer b = new StringBuffer(path);
             if (normalizedPath!=null) {
-                b.append(" -> " + normalizedPath);
+                b.append(" -> ").append(normalizedPath);
             }
             if (isAbsolute()) {
                 b.append(",ABS");

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/QNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/QNameTest.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/QNameTest.java (original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/name/QNameTest.java Wed Jul 12 03:15:17 2006
@@ -82,7 +82,7 @@
             long t1 = System.currentTimeMillis();
             for (int j=0; j<NUM_TESTS; j++) {
                 try {
-                    QName n = QName.fromJCRName(t.jcrName, resolver);
+                    QName n = NameFormat.parse(t.jcrName, resolver);
                     if (!t.isValid()) {
                         fail("Should throw IllegalNameException: " + t.jcrName);
                     }
@@ -109,7 +109,7 @@
                 // check just creation
                 boolean isValid = true;
                 try {
-                    QName.checkFormat(t.jcrName);
+                    NameFormat.checkFormat(t.jcrName);
                 } catch (IllegalNameException e) {
                     isValid = false;
                 }

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/util/TextTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/util/TextTest.java?rev=421219&r1=421218&r2=421219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/util/TextTest.java (original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/util/TextTest.java Wed Jul 12 03:15:17 2006
@@ -16,10 +16,9 @@
  */
 package org.apache.jackrabbit.util;
 
-import org.apache.jackrabbit.name.IllegalNameException;
-import org.apache.jackrabbit.name.QName;
-
 import junit.framework.TestCase;
+import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameFormat;
 
 /**
  * Test cases for the Text utility class.
@@ -29,7 +28,7 @@
     private void checkEscape(String name) {
         String escaped = Text.escapeIllegalJcrChars(name);
         try {
-            QName.checkFormat(escaped);
+            NameFormat.checkFormat(escaped);
         } catch (IllegalNameException e) {
             fail("Illegal name: " + escaped);
         }



Mime
View raw message