jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r329776 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Date Mon, 31 Oct 2005 09:04:07 GMT
Author: mreutegg
Date: Mon Oct 31 01:04:02 2005
New Revision: 329776

URL: http://svn.apache.org/viewcvs?rev=329776&view=rev
Log:
JCR-266: Denying a primaryType does not work in XPath

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java?rev=329776&r1=329775&r2=329776&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Mon Oct 31 01:04:02 2005
@@ -591,26 +591,7 @@
         // traverse
         node.childrenAccept(this, rqn);
 
-        // if property name is jcr:primaryType treat special
-        if (QName.JCR_PRIMARYTYPE.equals(rqn.getProperty())) {
-            if (rqn.getValueType() == RelationQueryNode.TYPE_STRING) {
-                try {
-                    QName ntName = QName.fromJCRName(rqn.getStringValue(), resolver);
-                    NodeTypeQueryNode ntNode = new NodeTypeQueryNode(queryNode, ntName);
-                    queryNode.addOperand(ntNode);
-                } catch (IllegalNameException e) {
-                    exceptions.add(new InvalidQueryException("Not a valid name: " + rqn.getStringValue()));
-                } catch (UnknownPrefixException e) {
-                    exceptions.add(new InvalidQueryException("Unknown prefix in name: " +
rqn.getStringValue()));
-                }
-            } else {
-                // value is not of type string
-                exceptions.add(new InvalidQueryException("Invalid type: jcr:primaryType must
be a string"));
-            }
-        } else {
-            // property name is <> jcr:primaryType
-            queryNode.addOperand(rqn);
-        }
+        queryNode.addOperand(rqn);
     }
 
     /**



Mime
View raw message