Can we deprecate Path.endsWith(String)?
Olexandr Rotan
rotanolexandr842 at gmail.com
Thu Jan 8 00:13:16 UTC 2026
I am not sure if thoughts similar to mine were already present in the
thread, but I am not sure there is any particular value in adding any
replacement methods for deprecated ones.
To me it seems like path.toString.{starts,ends}With provides endlessly more
clarity on what is going on, besides maybe pathString{ends,starts}With,
but this name seems clumsy, in some way resembling some denormalized column
name in db in a way that it traverses multiple mental indirections to
explain clearly enough what it does
So, as I think, unless there is a substantial optimization to offer from
merging this two operations, i would prefer just suggesting to use
toString().{starts,ends}With directly
Best regards
On Wed, Jan 7, 2026 at 11:45 PM Brian Burkhalter <
brian.burkhalter at oracle.com> wrote:
> In the list below I omitted adding Path.{ends,starts}WithString(String)
> which is different from item 3 in the list.
>
> Brian
>
> On Jan 7, 2026, at 12:34 PM, Brian Burkhalter <brian.burkhalter at oracle.com>
> wrote:
>
> Among doubtlessly many others, one alternative is
>
> 1. Leave Path.{ends,starts}With(Path) unchanged
> 2. Deprecate Path.{ends,starts}With(String)
> 3. Add Path.pathString{ends,starts}With(String)
>
> where "pathstring" in effect implies the value of Path.toString().
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20260108/cde285fd/attachment-0001.htm>
More information about the core-libs-dev
mailing list