This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 30397 - FileURL breaks public contract of java.net.URL
Summary: FileURL breaks public contract of java.net.URL
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-27 18:08 UTC by Jan Pokorsky
Modified: 2008-12-22 17:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2003-01-27 18:08:21 UTC
FileURL.encodeFileObject(FileSystem fs, FileObject
fo) breakes the public contract of java.net.URL by
setting the hostname as null value. Even if the
URL constructor implementation permits passing
null value the javadoc does not. It has fatal
impact on comparisons of URL objects then (see
URLStreamHandler.hostsEqual). Following code
always fails

FileObject fo = lfs.findResource(...);
URL u = fo.getURL;
assertEquals(u, new URL(u.toExternalForm()));
Comment 1 Jan Pokorsky 2003-01-27 18:14:44 UTC
fixed in
/cvs/openide/src/org/openide/filesystems/FileURL.java,v  <--  FileURL.java
new revision: 1.17; previous revision: 1.16
Comment 2 pzajac 2003-02-12 15:28:20 UTC
verified, created
 
testURLContract qa-unit test