directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1062542 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: filter/BranchNode.java filter/NotNode.java schema/syntaxCheckers/RegexSyntaxChecker.java
Date Sun, 23 Jan 2011 22:07:37 GMT
Author: elecharny
Date: Sun Jan 23 22:07:37 2011
New Revision: 1062542

URL: http://svn.apache.org/viewvc?rev=1062542&view=rev
Log:
o Fixed a potential NPE
o Removed a useless test

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.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/schema/syntaxCheckers/RegexSyntaxChecker.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java?rev=1062542&r1=1062541&r2=1062542&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java
Sun Jan 23 22:07:37 2011
@@ -169,9 +169,17 @@ public class BranchNode extends Abstract
      */
     public void setChildren( List<ExprNode> list )
     {
-        children = list;
+        if ( list == null )
+        {
+            children.clear();
+        }
+        else
+        {
+            children = list;
+        }
     }
     
+    
     /**
      * Convenience method that gets the first child in the children array. Its
      * very useful for NOT nodes since they only have one child by avoiding code

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=1062542&r1=1062541&r2=1062542&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
Sun Jan 23 22:07:37 2011
@@ -113,12 +113,20 @@ public class NotNode extends BranchNode
      */
     public void setChildren( List<ExprNode> childList )
     {
-        if ( ( childList != null ) && ( childList.size() > 1 ) )
+        if ( childList == null )
         {
-            throw new IllegalStateException( I18n.err( I18n.ERR_04159 ) );            
+            children.clear();
+        }
+        else
+        {
+            
+            if ( childList.size() > 1 )
+            {
+                throw new IllegalStateException( I18n.err( I18n.ERR_04159 ) );
+            }
+    
+            children = childList;
         }
-
-        children = childList;
     }
 
     

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/RegexSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/RegexSyntaxChecker.java?rev=1062542&r1=1062541&r2=1062542&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/RegexSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/RegexSyntaxChecker.java
Sun Jan 23 22:07:37 2011
@@ -101,7 +101,7 @@ public class RegexSyntaxChecker extends 
 
             for ( String regexp:expressions )
             {
-                match = match && str.matches( regexp );
+                match = str.matches( regexp );
 
                 if ( !match )
                 {



Mime
View raw message