Problem with JCR-977 patch/r791737

2 messages Options
Embed this post
Permalink
Dan Diephouse

Problem with JCR-977 patch/r791737

Reply Threaded More More options
Print post
Permalink
Just an FYI, I had a problem with my version of the patch and the PredicateDerefQuery.rewrite function. It caused Jackrabbit to get caught in an infinite loop on me. Changing the function to just return "this" all the time seems to fix things, but I'm not sure if it's the right fix or not. Looking at the commit here: http://svn.apache.org/viewvc?view=rev&revision=791737 it looks like that change might apply here as well.

Thoughts?

Marcel Reutegger

Re: Problem with JCR-977 patch/r791737

Reply Threaded More More options
Print post
Permalink
On Wed, Jul 8, 2009 at 01:05, Dan Diephouse<[hidden email]> wrote:
> Just an FYI, I had a problem with my version of the patch and
> the PredicateDerefQuery.rewrite function. It caused Jackrabbit to get caught
> in an infinite loop on me. Changing the function to just return "this" all
> the time seems to fix things, but I'm not sure if it's the right fix or not.

ah, right. good catch. but the change should rather be:

Index: src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java (revision
792113)
+++ src/main/java/org/apache/jackrabbit/core/query/lucene/PredicateDerefQuery.java (working
copy)
@@ -140,7 +140,7 @@
         if (cQuery == subQuery) {
             return this;
         } else {
-            return new PredicateDerefQuery(subQuery, refProperty,
nameTest, version, nsMappings);
+            return new PredicateDerefQuery(cQuery, refProperty,
nameTest, version, nsMappings);
         }
     }

I'll fix that.

regards
 marcel