commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bspeak...@apache.org
Subject svn commit: r590468 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Date Tue, 30 Oct 2007 21:04:11 GMT
Author: bspeakmon
Date: Tue Oct 30 14:04:10 2007
New Revision: 590468

URL: http://svn.apache.org/viewvc?rev=590468&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=590468&r1=590467&r2=590468&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 14:04:10 2007
@@ -147,7 +147,7 @@
 
     private static final String LEGAL_ASCII_PATTERN = "^\\p{ASCII}+$";
 
-    private static final String PORT_PATTERN = "/^:(\\d{1,5})$/";
+    private static final String PORT_PATTERN = "^:(\\d{1,5})$";
 
     /**
      * Holds the set of current validation options.
@@ -334,8 +334,8 @@
 
         String port = authorityMatcher.group(PARSE_AUTHORITY_PORT);
         if (port != null) {
-            Perl5Util portMatcher = new Perl5Util();
-            if (!portMatcher.match(PORT_PATTERN, port)) {
+            Pattern portPattern = Pattern.compile(PORT_PATTERN);
+            if (!portPattern.matcher(port).matches()) {
                 return false;
             }
         }



Mime
View raw message