This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: File(URI) constructor.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]