harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r433993 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
Date Wed, 23 Aug 2006 09:36:57 GMT
Author: pyang
Date: Wed Aug 23 02:36:56 2006
New Revision: 433993

URL: http://svn.apache.org/viewvc?rev=433993&view=rev
Log:
Patch applied for HARMONY-1135 ([classlib][net] unexpected MalformedURLException for URL(URL
context, String spec))

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java?rev=433993&r1=433992&r2=433993&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
Wed Aug 23 02:36:56 2006
@@ -256,7 +256,11 @@
 		if (index >= 0) {
 			if ((startIPv6Addr == -1) || (index < startIPv6Addr)) {
 				protocol = spec.substring(0, index);
-				if (protocol.indexOf('/') >= 0) {
+                // According to RFC 2396 scheme part should match
+                // the following expression:
+                // alpha *( alpha | digit | "+" | "-" | "." )
+                if (!protocol.matches("\\A\\p{Alpha}[\\p{Alnum}+-.]*\\z") || 
+                    protocol.indexOf('/') >= 0) {
 					protocol = null;
 					index = -1;
 				} else {



Mime
View raw message