directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1744093 - /directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java
Date Mon, 16 May 2016 17:17:41 GMT
Author: elecharny
Date: Mon May 16 17:17:41 2016
New Revision: 1744093

URL: http://svn.apache.org/viewvc?rev=1744093&view=rev
Log:
Fixed the normalization of Substring

Modified:
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java?rev=1744093&r1=1744092&r2=1744093&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java
Mon May 16 17:17:41 2016
@@ -28,6 +28,7 @@ import java.util.regex.PatternSyntaxExce
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.api.ldap.model.schema.Normalizer;
+import org.apache.directory.api.ldap.model.schema.PrepareString;
 
 
 /**
@@ -59,7 +60,7 @@ public class SubstringNode extends LeafN
     {
         super( attributeType, AssertionType.SUBSTRING );
 
-        anyPattern = new ArrayList<String>( 2 );
+        anyPattern = new ArrayList<>( 2 );
         this.finalPattern = finalPattern;
         this.initialPattern = initialPattern;
     }
@@ -308,7 +309,7 @@ public class SubstringNode extends LeafN
 
             for ( int i = 0; i < any.length; i++ )
             {
-                any[i] = ( String ) normalizer.normalize( anyPattern.get( i ) );
+                any[i] = ( String ) normalizer.normalize( anyPattern.get( i ), PrepareString.AssertionType.SUBSTRING_ANY
);
 
                 if ( any[i].length() == 0 )
                 {
@@ -320,14 +321,14 @@ public class SubstringNode extends LeafN
 
             if ( initialPattern != null )
             {
-                initialStr = ( String ) normalizer.normalize( initialPattern );
+                initialStr = ( String ) normalizer.normalize( initialPattern, PrepareString.AssertionType.SUBSTRING_INITIAL
);
             }
 
             String finalStr = null;
 
             if ( finalPattern != null )
             {
-                finalStr = ( String ) normalizer.normalize( finalPattern );
+                finalStr = normalizer.normalize( finalPattern, PrepareString.AssertionType.SUBSTRING_FINAL
);
             }
 
             return getRegex( initialStr, any, finalStr );
@@ -337,14 +338,14 @@ public class SubstringNode extends LeafN
 
         if ( initialPattern != null )
         {
-            initialStr = ( String ) normalizer.normalize( initialPattern );
+            initialStr = normalizer.normalize( initialPattern, PrepareString.AssertionType.SUBSTRING_INITIAL
);
         }
 
         String finalStr = null;
 
         if ( finalPattern != null )
         {
-            finalStr = ( String ) normalizer.normalize( finalPattern );
+            finalStr = normalizer.normalize( finalPattern, PrepareString.AssertionType.SUBSTRING_FINAL
);
         }
 
         return getRegex( initialStr, null, finalStr );



Mime
View raw message