Patch: File(URI) constructor.

Bryce McKinlay mckinlay@redhat.com
Tue Jul 6 16:57:00 GMT 2004


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



More information about the Java-patches mailing list