src/windows/classes/sun/nio/fs/WindowsPath.java
Print this page
*** 644,654 ****
return new WindowsPath(getFileSystem(), WindowsPathType.RELATIVE, "", sb.toString());
}
@Override
public boolean startsWith(Path obj) {
! WindowsPath other = toWindowsPath(obj);
// if this path has a root component the given path's root must match
if (!this.root.equalsIgnoreCase(other.root)) {
return false;
}
--- 644,656 ----
return new WindowsPath(getFileSystem(), WindowsPathType.RELATIVE, "", sb.toString());
}
@Override
public boolean startsWith(Path obj) {
! if (!(Objects.requireNonNull(obj) instanceof WindowsPath))
! return false;
! WindowsPath other = (WindowsPath)obj;
// if this path has a root component the given path's root must match
if (!this.root.equalsIgnoreCase(other.root)) {
return false;
}
*** 673,683 ****
return false;
}
@Override
public boolean endsWith(Path obj) {
! WindowsPath other = toWindowsPath(obj);
// other path is longer
if (other.path.length() > this.path.length()) {
return false;
}
--- 675,687 ----
return false;
}
@Override
public boolean endsWith(Path obj) {
! if (!(Objects.requireNonNull(obj) instanceof WindowsPath))
! return false;
! WindowsPath other = (WindowsPath)obj;
// other path is longer
if (other.path.length() > this.path.length()) {
return false;
}