commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bspeak...@apache.org
Subject svn commit: r590573 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Date Wed, 31 Oct 2007 07:00:32 GMT
Author: bspeakmon
Date: Wed Oct 31 00:00:32 2007
New Revision: 590573

URL: http://svn.apache.org/viewvc?rev=590573&view=rev
Log:
- VALIDATOR-191: incrementally replacing 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=590573&r1=590572&r2=590573&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
Wed Oct 31 00:00:32 2007
@@ -141,7 +141,7 @@
      */
     private static final int PARSE_AUTHORITY_EXTRA = 3;
 
-    private static final String PATH_PATTERN = "/^(/[-\\w:@&?=+,.!/~*'%$_;]*)?$/";
+    private static final String PATH_PATTERN = "^(/[-\\w:@&?=+,.!/~*'%$_;]*)?$";
 
     private static final String QUERY_PATTERN = "^(.*)$";
 
@@ -359,9 +359,8 @@
             return false;
         }
 
-        Perl5Util pathMatcher = new Perl5Util();
-
-        if (!pathMatcher.match(PATH_PATTERN, path)) {
+        Pattern pathPattern = Pattern.compile(PATH_PATTERN);
+        if (!pathPattern.matcher(path).matches()) {
             return false;
         }
 



Mime
View raw message