Community
Participate
Working Groups
Build: 3.6 PathUtil.makeRelative("file:/a/b", new URL("file:/d:/a/x)) Returns: "file:../b", but since the device is different it should return "file:/c:/a/b".
Created attachment 171764 [details] Fix and regression test v01
I noticed while testing this that PathUtil has all kinds of crazy behaviour. It can return a mixture of / and \ path separators on Windows. It also creates bad relative URLs such as file:a/b/ (relative URL shouldn't have a device). In any case I've opted not to change anything else in this patch except the cross-volume bug. This class is generally only used in backwards compatibility situations like reading/writing plaform.xml, and most of p2 uses the much more consistent URIUtil methods.
Sorry, that first line should read: PathUtil.makeRelative("file:/c:/a/b", new URL("file:/d:/a/x)) Returns: "file:../b" but should return "file:/c:/a/b".
Fix released for 3.6.1 and 3.7
*** Bug 311387 has been marked as a duplicate of this bug. ***