JDK-6925169 : (fs) Path.relativize returns incorrect result if path contains "." or ".."
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic,windows_7
  • CPU: generic,x86
  • Submitted: 2010-02-10
  • Updated: 2018-02-28
  • Resolved: 2018-02-28
Related Reports
Duplicate :  
The relativize method (both Unix and Windows implementations) don't handle treat "." correctly. More details here:


EVALUATION The spec bug will be addressed by the updates in 7006126.

EVALUATION There is also a spec bug here as the assertion that p.relativize(p.resolve(q)).equals(q) is only true if p and q are normalized paths without root components. This should be fixed as part of this bug.