Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-core-dev] Latest on path character issues


Based on feedback from the previous proposal, and from the experience of implementing and testing various solutions, I have made some changes to the proposal to allow colon and backslash characters in paths.  Essentially, the proposed solution remains similar, but I am now proposing that we change the behaviour of the old Path constructors to be platform-specific. This is in addition to providing the clearer new fromOSString and fromPortableString factory methods. On platforms other than Windows, this is a breaking change from the old behaviour of these constructors.  

It turns out that maintaining the old behaviour of these constructors causes even more breaking changes for existing plugins when previously valid paths and path segments are introduced into the platform. I.e., if one plugin migrates to the new API and starts creating paths with colon characters, and then a string representation of that path is handed off to a plugin that has not migrated, it will create a different path from the string if we do not change the behaviour of the existing constructors.

I have tested this new solution, and I have been able to get it working with very few breaking changes to other plugins. The most breakage was in existing test suites that created hard-coded Windows paths such as "c:\temp\..." By contrast, when I left the old constructors unchanged, every plugin that I encountered required extensive migration. I believe that despite the API contract change, altering the existing path constructors offers the best backwards compatibility and imposes the least migration burden for downstream plugins.

I have also changed the proposal to alter the IPath.toString representation to escape literal colon characters in path segments. For backwards compatibility, the existing toString representation will be left unchanged (despite being non-portable), and instead a new toPortableString() method will be used for creating platform-independent string representations of paths (suitable for writing to .project, .classpath, etc).

I welcome further comments and feedback on this latest revision of the proposal:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/documents/path_changes.html

Back to the top