Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 214131 - JAR URLs using / vs. /// in file component are not equal
JAR URLs using / vs. /// in file component are not equal
Product: platform
Classification: Unclassified
Component: Filesystems
PC Linux
: P2 (vote)
: 7.2
Assigned To: Jesse Glick
: 214068 214145 214146 (view as bug list)
Depends on:
Blocks: 213562
  Show dependency treegraph
Reported: 2012-06-13 13:18 UTC by Tomas Zezula
Modified: 2012-06-14 21:55 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2012-06-13 13:18:00 UTC
The following jar URLs are not equal:

Comment 1 Tomas Zezula 2012-06-13 13:56:18 UTC
*** Bug 214068 has been marked as a duplicate of this bug. ***
Comment 2 Jesse Glick 2012-06-13 15:52:24 UTC
core-main #6b283f46deed
Comment 3 Jan Lahoda 2012-06-13 16:31:46 UTC
*** Bug 214145 has been marked as a duplicate of this bug. ***
Comment 4 Vladimir Riha 2012-06-13 16:47:57 UTC
*** Bug 214146 has been marked as a duplicate of this bug. ***
Comment 5 Quality Engineering 2012-06-14 06:07:49 UTC
Integrated into 'main-golden', will be available in build *201206140001* on (upload may still be in progress)
User: Jesse Glick <>
Log: #214131: JAR URLs using / vs. /// in file component are not equal
Comment 6 Jesse Glick 2012-06-14 21:55:24 UTC
Alan Bateman explains why /// is used currently to differentiate URIs from those created by File.toURI, relating to encoding of non-ASCII pathname characters on Unix (which only Path.toUri escapes as octets):

"[Take] two shells, one with your locale set to zh_CN, the other with en_US for example. The only way for file URIs to be shared is if you encode the byte representation of the file path into the URI's path component. That will also allow you to share file URIs with native applications too.

"As it stands, Paths.get(URI) can handle file URIs created by Path.toUri or File.toURI. The File(URI) constructor can only reliably deal with URIs created by File.toURI. While file:/ and file:/// should be equivalent, we are using it to distinguish URIs created by"

For NB rewrites file:/// into file:/ in Utilities.toURI, since producing a normalized URI is critical for common IDE functions such as classpath scanning and this affects everyone.

TBD whether there are implications of this decision for support of non-ASCII pathnames in the IDE, particularly in conjunction with external processes such as build tools and the web browser. It means that we use e.g. file:/tmp/hezky%20česky (on either JDK 6 or 7) rather than file:///tmp/hezky%20%C4%8Desky - though the former's toASCIIString() is indeed file:/tmp/hezky%20%C4%8Desky so if your system locale is UTF-8 then it is likely there would be no issue.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo