incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
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 GMT
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;
     }
     
 



Mime
View raw message