Hi all,

I was trying queries in Jackrabbit 2 for our app and it was failing on something like this:

//*[jcr:deref(@type, '*')/@name = 'Base Type' and @name = 'test']

I had to make the following patch to revert a check that someone added to my original patch (see https://issues.apache.org/jira/browse/JCR-977):

Index: src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java       (revision 1134000)
+++ src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java       (working copy)
@@ -1000,10 +1000,6 @@

     public Query createPredicateDeref(Query subQuery, DerefQueryNode node, Object data) throws RepositoryException {
         Query context = (Query) data;
-
-        if (context == null) {
-            exceptions.add(new IllegalArgumentException("Unsupported query"));
-        }

         try {
             String refProperty = resolver.getJCRName(node.getRefProperty());

I'm not sure why this was done, but taking this out makes things work again. Can someone fix this? Or am I missing something?

Dan

--
Dan Diephouse
http://mulesoft.com | http://netzooid.com/blog