jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r544316 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Date Mon, 04 Jun 2007 22:40:27 GMT
Author: jukka
Date: Mon Jun  4 15:40:25 2007
New Revision: 544316

URL: http://svn.apache.org/viewvc?view=rev&rev=544316
Log:
JCR-385: Avoid a ClassCastException for union and other unexpected queries.

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

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=544316&r1=544315&r2=544316
==============================================================================
--- 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
Mon Jun  4 15:40:25 2007
@@ -340,7 +340,12 @@
                 break;
             case JJTROOT:
             case JJTROOTDESCENDANTS:
-                ((PathQueryNode) queryNode).setAbsolute(true);
+                if (queryNode instanceof PathQueryNode) {
+                    ((PathQueryNode) queryNode).setAbsolute(true);
+                } else {
+                    exceptions.add(new InvalidQueryException(
+                            "Unsupported root level query node: " + queryNode));
+                }
                 break;
             case JJTSTEPEXPR:
                 if (isAttributeAxis(node)) {



Mime
View raw message