From graffito-commits-return-805-apmail-incubator-graffito-commits-archive=www.apache.org@incubator.apache.org Thu Oct 26 20:20:38 2006 Return-Path: Delivered-To: apmail-incubator-graffito-commits-archive@www.apache.org Received: (qmail 35631 invoked from network); 26 Oct 2006 20:20:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 20:20:36 -0000 Received: (qmail 80541 invoked by uid 500); 26 Oct 2006 20:20:47 -0000 Mailing-List: contact graffito-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: graffito-dev@incubator.apache.org Delivered-To: mailing list graffito-commits@incubator.apache.org Received: (qmail 80530 invoked by uid 99); 26 Oct 2006 20:20:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 13:20:47 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 13:20:33 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id ABCA11A9846; Thu, 26 Oct 2006 13:20:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r468113 - /incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java Date: Thu, 26 Oct 2006 20:20:11 -0000 To: graffito-commits@incubator.apache.org From: clombart@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061026202011.ABCA11A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: clombart Date: Thu Oct 26 13:20:10 2006 New Revision: 468113 URL: http://svn.apache.org/viewvc?view=rev&rev=468113 Log: Apply patch provided by Felix Meschberger for GRFT-114 Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java?view=diff&rev=468113&r1=468112&r2=468113 ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java Thu Oct 26 13:20:10 2006 @@ -210,6 +210,9 @@ * @see org.apache.portals.graffito.jcr.query.Filter#addOrFilter(org.apache.portals.graffito.jcr.query.Filter) */ public Filter addOrFilter(Filter filter) { + FilterImpl theFilter = (FilterImpl) filter; + if (theFilter.getJcrExpression() != null && theFilter.getJcrExpression().length() > 0) + { if ( null == jcrExpression || "".equals(jcrExpression) ) { jcrExpression = ((FilterImpl) filter).getJcrExpression() ; @@ -218,6 +221,7 @@ { jcrExpression = "(" + jcrExpression + ") or ( " + ((FilterImpl) filter).getJcrExpression() + ")"; } + } return this; } @@ -225,16 +229,19 @@ * @see org.apache.portals.graffito.jcr.query.Filter#addAndFilter(Filter) */ public Filter addAndFilter(Filter filter) { - if ( null == jcrExpression || "".equals(jcrExpression) ) - { - jcrExpression = ((FilterImpl) filter).getJcrExpression() ; - } - else - { - jcrExpression = "(" + jcrExpression + ") and ( " + ((FilterImpl) filter).getJcrExpression() + ")"; - } - return this; - + FilterImpl theFilter = (FilterImpl) filter; + if (theFilter.getJcrExpression() != null && theFilter.getJcrExpression().length() > 0) + { + if ( null == jcrExpression || "".equals(jcrExpression) ) + { + jcrExpression = ((FilterImpl) filter).getJcrExpression() ; + } + else + { + jcrExpression = "(" + jcrExpression + ") and ( " + ((FilterImpl) filter).getJcrExpression() + ")"; + } + } + return this; }