directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r961401 - in /directory/shared/trunk/ldap: ./ src/main/antlr/ src/main/java/org/apache/directory/shared/ldap/filter/ src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ src/main/java/org/apache/directory/shared/ldap/subtre...
Date Wed, 07 Jul 2010 15:07:48 GMT
Author: elecharny
Date: Wed Jul  7 15:07:48 2010
New Revision: 961401

URL: http://svn.apache.org/viewvc?rev=961401&view=rev
Log:
removing subtree handling

Removed:
    directory/shared/trunk/ldap/src/main/antlr/SubtreeSpecificationChecker.g
    directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SubtreeSpecificationSyntaxCheckerTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/
Modified:
    directory/shared/trunk/ldap/pom.xml
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AndNode.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/NotNode.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/OrNode.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java

Modified: directory/shared/trunk/ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/pom.xml?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/pom.xml (original)
+++ directory/shared/trunk/ldap/pom.xml Wed Jul  7 15:07:48 2010
@@ -87,7 +87,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antlr-plugin</artifactId>
         <configuration>
-          <grammars>schema-extension.g schema-qdstring.g schema-value.g schema.g subtree-specification.g
SubtreeSpecificationChecker.g TriggerSpecification.g distinguishedName.g</grammars>
+          <grammars>schema-extension.g schema-qdstring.g schema-value.g schema.g TriggerSpecification.g
distinguishedName.g</grammars>
         </configuration>
         <executions>
            <execution>

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AndNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AndNode.java?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AndNode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AndNode.java
Wed Jul  7 15:07:48 2010
@@ -121,6 +121,7 @@ public class AndNode extends BranchNode
             if ( isFirst )
             {
                 isFirst = false;
+                buf.append( ' ' );
             }
             else
             {
@@ -130,7 +131,7 @@ public class AndNode extends BranchNode
             node.printRefinementToBuffer( buf );
         }
         
-        buf.append( '}' );
+        buf.append( " }" );
         
         return buf;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
Wed Jul  7 15:07:48 2010
@@ -663,6 +663,25 @@ public class FilterParser
     }
 
 
+    /**
+     * @see FilterParser#parse(String)
+     */
+    public static ExprNode parse( String filter, Position pos ) throws ParseException
+    {
+        // The filter must not be null. This is a defensive test
+        if ( StringTools.isEmpty( filter ) )
+        {
+            throw new ParseException( I18n.err( I18n.ERR_04158 ), 0 );
+        }
+
+        pos.start = 0;
+        pos.end = 0;
+        pos.length = filter.length();
+
+        return parseFilterInternal( filter, pos );
+    }
+
+    
     public void setFilterParserMonitor( FilterParserMonitor monitor )
     {
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/NotNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/NotNode.java?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/NotNode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/NotNode.java
Wed Jul  7 15:07:48 2010
@@ -174,24 +174,10 @@ public class NotNode extends BranchNode
      */
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
-        buf.append( "not: {" );
-        boolean isFirst = true;
+        buf.append( "not: " );
         
-        for ( ExprNode node:children )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                buf.append( ", " );
-            }
-            
-            node.printRefinementToBuffer( buf );
-        }
-        
-        buf.append( '}' );
+        // There is only one item for a not refinement
+        children.get( 0 ).printRefinementToBuffer( buf );
         
         return buf;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/OrNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/OrNode.java?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/OrNode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/OrNode.java
Wed Jul  7 15:07:48 2010
@@ -121,6 +121,7 @@ public class OrNode extends BranchNode
             if ( isFirst )
             {
                 isFirst = false;
+                buf.append( ' ' );
             }
             else
             {
@@ -130,7 +131,7 @@ public class OrNode extends BranchNode
             node.printRefinementToBuffer( buf );
         }
         
-        buf.append( '}' );
+        buf.append( " }" );
         
         return buf;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
Wed Jul  7 15:07:48 2010
@@ -134,7 +134,10 @@ public abstract class SimpleNode<T> exte
      */
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
-        if ( getAttribute() == null || !SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase(
getAttribute() ) )
+        if ( ( getAttribute() == null ) || 
+            !( SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase( getAttribute() ) ||
+               SchemaConstants.OBJECT_CLASS_AT_OID.equalsIgnoreCase( getAttribute() ) )
+            )
         {
             throw new UnsupportedOperationException( I18n.err( I18n.ERR_04162, getAttribute()
) );
         }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java?rev=961401&r1=961400&r2=961401&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
Wed Jul  7 15:07:48 2010
@@ -1066,6 +1066,4 @@ public class FilterParserTest
         assertTrue( str.startsWith( str2 ) );
         assertEquals( "(&(ou~=people)(age>=30))", str2 );
     }
-
-    
 }



Mime
View raw message