[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Patch: FYI: URI fixlet
From: |
Tom Tromey |
Subject: |
[cp-patches] Patch: FYI: URI fixlet |
Date: |
08 Feb 2005 19:52:08 -0700 |
I'm checking this in to libgcj and classpath.
This fixes a bug in URI. The user and port parts of the authority
are optional. I think this used to "work" but a recent bug fix to
regex broke it.
I've checked in a test case to Mauve. We don't pass all the URI tests
(and I'm not sure if we ever did), but with this we do a little
better. As was pointed out recently, our URI implementation needs a
lot of love.
Tom
Index: ChangeLog
from Tom Tromey <address@hidden>
* java/net/URI.java (AUTHORITY_REGEXP): Handle case where user
name or port is missing.
(AUTHORITY_USERINFO_GROUP, AUTHORITY_HOST_GROUP,
AUTHORITY_PORT_GROUP): Updated.
Index: java/net/URI.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URI.java,v
retrieving revision 1.8
diff -u -r1.8 URI.java
--- java/net/URI.java 15 Jan 2005 22:27:02 -0000 1.8
+++ java/net/URI.java 9 Feb 2005 02:47:28 -0000
@@ -65,7 +65,7 @@
"^(([^:/?#]+):)?((//([^/?#]*))?([^?#]*)(\\?([^#]*))?)?(#(.*))?";
private static final String AUTHORITY_REGEXP =
- "^(([^?#]*)@([^?#]*):([^?#]*))?";
+ "^((([^?#]*)@)?([^?#:]*)(:([^?#]*)))?";
/**
* Valid characters (taken from rfc2396)
@@ -115,9 +115,9 @@
*/
private static final int FRAGMENT_GROUP = 10;
- private static final int AUTHORITY_USERINFO_GROUP = 2;
- private static final int AUTHORITY_HOST_GROUP = 3;
- private static final int AUTHORITY_PORT_GROUP = 4;
+ private static final int AUTHORITY_USERINFO_GROUP = 3;
+ private static final int AUTHORITY_HOST_GROUP = 4;
+ private static final int AUTHORITY_PORT_GROUP = 6;
private transient String scheme;
private transient String rawSchemeSpecificPart;
- [cp-patches] Patch: FYI: URI fixlet,
Tom Tromey <=