<div dir="auto">Oh yes, agreed -- if we were going to do this, can't just be this method. So there is the startsWith method, for example.<div dir="auto"><br></div><div dir="auto">If we are going down the documentation route, then I'd like a simple example added to the javadocs for both startsWith and endsWith that show what this would and would not match. Not only will this clear up my ambiguity, but there might be a few corners of this api worth showing by example.</div><div dir="auto"><br></div><div dir="auto">For example, I had a root path specified by Path.of("."), and when I tried to use the string overload of starts with (the way it was intended to be used), it actually failed because I failed to add the ./ at the front.</div><div dir="auto"><br></div><div dir="auto">If we don't want to add this stuff, that's fine. The dev will figure it out eventually. I just keep falling into this hole, so I figured this would make a useful experience report. And if nothing else, then this will help for designing future api's.</div><div dir="auto"><br></div><div dir="auto">Thanks for the help.</div><div dir="auto">David Alayachew</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Sep 10, 2025, 4:39 PM Brian Burkhalter <<a href="mailto:brian.burkhalter@oracle.com">brian.burkhalter@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="line-break:after-white-space">
Hello David,<br id="m_8801870669136567601lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On Sep 10, 2025, at 1:28 PM, David Alayachew <<a href="mailto:davidalayachew@gmail.com" target="_blank" rel="noreferrer">davidalayachew@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
Yes exactly.</div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<br>
</div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
And I'm not trying to say that the method is underspecified -- the javadoc is fairly clear.</div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<br>
</div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
I'm merely saying that this overload adds little value, while being a tripping hazard for those thinking the name describes the obvious.</div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<br>
</div>
<div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
So, I'd like to deprecate the overload. Those who want the overload, just use the suggestion in the javadocs.</div>
</div>
</blockquote>
</div>
<br>
<div>There are a number of methods in Path which are the same except for String- vs. Path-valued parameters. I’m not sure we’d want to deprecate just this one although I do see your point. Perhaps some additional disambiguating verbiage in the endsWith(String)
specification would help?</div>
<div><br>
</div>
<div>Brian</div>
</div>
</blockquote></div>