harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r571511 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
Date Fri, 31 Aug 2007 16:32:30 GMT
Author: tellison
Date: Fri Aug 31 09:32:26 2007
New Revision: 571511

URL: http://svn.apache.org/viewvc?rev=571511&view=rev
Log:
Fix for HARMONY-4679 ([startup] java.net.URL implementation without regex classes loading)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java?rev=571511&r1=571510&r2=571511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java Fri Aug 31
09:32:26 2007
@@ -259,8 +259,18 @@
                 // According to RFC 2396 scheme part should match
                 // the following expression:
                 // alpha *( alpha | digit | "+" | "-" | "." )
-                if (!protocol.matches("\\A\\p{Alpha}[\\p{Alnum}+-.]*\\z") || //$NON-NLS-1$
-                        protocol.indexOf('/') >= 0) {
+                char c = protocol.charAt(0);
+                boolean valid = ('a' <= c && c <= 'z') || ('A' <= c &&
c <= 'Z');
+                for (int i = 1; valid && (i < protocol.length()); i++) {
+                    c = protocol.charAt(i);
+                    valid = ('a' <= c && c <= 'z') ||
+                            ('A' <= c && c <= 'Z') ||
+                            ('0' <= c && c <= '9') ||
+                            (c == '+') ||
+                            (c == '-') ||
+                            (c == '.');
+                }
+                if (!valid) {
                     protocol = null;
                     index = -1;
                 } else {



Mime
View raw message