commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bspeak...@apache.org
Subject svn commit: r590559 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Date Wed, 31 Oct 2007 05:20:19 GMT
Author: bspeakmon
Date: Tue Oct 30 22:20:16 2007
New Revision: 590559

URL: http://svn.apache.org/viewvc?rev=590559&view=rev
Log:
- VALIDATOR-191: incrementally replace oro with java.util.regex

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=590559&r1=590558&r2=590559&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Tue Oct 30 22:20:16 2007
@@ -129,7 +129,7 @@
     private static final String SCHEME_PATTERN = "/^[" + SCHEME_CHARS + "]/";
 
     private static final String AUTHORITY_PATTERN =
-            "/^([" + AUTHORITY_CHARS + "]*)(:\\d*)?(.*)?/";
+            "^([" + AUTHORITY_CHARS + "]*)(:\\d*)?(.*)?";
     //                                                                            1     
                    2  3       4
 
     private static final int PARSE_AUTHORITY_HOST_IP = 1;
@@ -313,8 +313,10 @@
             return false;
         }
 
-        Perl5Util authorityMatcher = new Perl5Util();
-        if (!authorityMatcher.match(AUTHORITY_PATTERN, authority)) {
+        //Perl5Util authorityMatcher = new Perl5Util();
+        Pattern authorityPattern = Pattern.compile(AUTHORITY_PATTERN);
+        Matcher authorityMatcher = authorityPattern.matcher(authority);
+        if (!authorityMatcher.matches()) {
             return false;
         }
 



Mime
View raw message