Can we deprecate Path.endsWith(String)?

Brian Burkhalter brian.burkhalter at oracle.com
Thu Sep 18 18:38:07 UTC 2025


If Path.endsWith(String) and possibly Path.startsWith(String) were to be deprecated, then perhaps something like Path.{start,end}sWIthString(String) could be replacements?

Brian

On Sep 18, 2025, at 11:19 AM, Rob Spoor <openjdk at icemanx.nl> wrote:

If Path.endsWith(String) and possibly Path.startsWith(String) are deprecated, can we then get Path.endsWithPath(String) and Path.startsWithPath(String) as replacements? Because having to type path.endsWith(path.getFileSystem().getPath(other)) is not only a lot more verbose but my IDE also complains that I don't close the result of calling path.getFileSystem() (which of course I shouldn't), so I have to suppress the warning.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250918/2059c680/attachment.htm>


More information about the core-libs-dev mailing list