You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/01/18 23:43:30 UTC

svn commit: r370291 - /directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/schema/RegexSyntaxChecker.java

Author: elecharny
Date: Wed Jan 18 14:43:26 2006
New Revision: 370291

URL: http://svn.apache.org/viewcvs?rev=370291&view=rev
Log:
- Get rid of a.o.regexp and oro, replaced them by jdk 1.4 regexp

Modified:
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/schema/RegexSyntaxChecker.java

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/schema/RegexSyntaxChecker.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/schema/RegexSyntaxChecker.java?rev=370291&r1=370290&r2=370291&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/schema/RegexSyntaxChecker.java (original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/schema/RegexSyntaxChecker.java Wed Jan 18 14:43:26 2006
@@ -20,8 +20,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.InvalidAttributeValueException;
 
-import org.apache.oro.text.perl.Perl5Util;
-
 
 /**
  * A SyntaxChecker implemented using Perl5 regular expressions to constrain 
@@ -37,8 +35,6 @@
     private final String oid;
     /** the set of regular expressions */
     private final String [] expressions;
-    /** the Perl5 regex utilities */
-    private final Perl5Util perl = new Perl5Util();
 
 
     /**
@@ -75,17 +71,18 @@
         if ( value instanceof String )
         {
             str = ( String ) value;
-        }
 
-        for ( int ii = 0; ii < expressions.length; ii++ )
-        {
-            match = match && perl.match( expressions[ii], str );
-            if ( ! match )
-            {
-                break;
-            }
+	        for ( int i = 0; i < expressions.length; i++ )
+	        {
+	            match = match && str.matches( expressions[i] );
+	            
+	            if ( ! match )
+	            {
+	                break;
+	            }
+	        }
         }
-
+        
         return match;
     }