This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: File(URI) constructor.
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Jeroen Frijters <jeroen at sumatra dot nl>
- Cc: Anthony Green <green at redhat dot com>, commit-classpath at gnu dot org, java-patches at gcc dot gnu dot org
- Date: Tue, 06 Jul 2004 12:56:43 -0400
- Subject: Re: Patch: File(URI) constructor.
- References: <788B535AB1F9CB49BB9C229372B50ACC10CDBD@LEMBU.sumatrasoftware.com>
Jeroen Frijters wrote:
Bryce McKinlay wrote:
Should this use equalsIgnoreCase() ?
Isn't the scheme always in lowercase?
Basied on the result of my quick test case, it will be in whatever case
was used when constructing the URI instance. Presumably, URI schemes are
also case insensitive. Our URI implementation appears to be buggy,
however. Check the result of the following test case:
import java.net.*;
public class URITest
{
public static void main(String[] args) throws Exception
{
URI uri = new URI("FILE:///foo/bar");
System.out.println (uri.getScheme());
URI uri2 = new URI("fIlE:///foo/bar");
System.out.println (uri2.getScheme());
System.out.println(uri.equals(uri2));
}
}
Regards
Bryce