Summary
Add verbiage clarifying that the absolute path of a java.nio.file.Path
associated with the default provider has a non-null
root component.
Problem
It is unclear from the specification of Path.toAbsolutePath
whether the returned object has a root component.
Solution
Add a clarifying statement.
Specification
--- a/src/java.base/share/classes/java/nio/file/Path.java
+++ b/src/java.base/share/classes/java/nio/file/Path.java
@@ -749,7 +749,9 @@ default Path resolveSibling(String other) {
/**
* Returns a {@code Path} object representing the absolute path of this
- * path.
+ * path. Where this {@code Path} is associated with the default provider,
+ * then the returned absolute path will have a non-{@code null}
+ * {@linkplain #getRoot root component}.
*
* <p> If this path is already {@link Path#isAbsolute absolute} then this
* method simply returns this path. Otherwise, this method resolves the path
- csr of
-
JDK-8351415 (fs) Path::toAbsolutePath should specify if an absolute path has a root component
-
- Resolved
-