On Sep 17, 2025, at 8:24 AM, Pavel Rappo <[email protected]> wrote:
FWIW, I too have fallen into this trap, and I did that even more than once. When my brain sees Path.endsWith(String), it somehow silently assumes that its semantic is that of String.endsWith(String). Of course, it isn't. What's worse, I learn about my mistake at runtime. But not because of an exception, no; I learn about it by getting unexpected results. I have filed an issue to improve the specification of this method somehow: https://bugs.openjdk.org/browse/JDK-8368007 There used to be a method that implemented the file extension thingy, but the commit was backed out. If it makes its way back in one form or another, it might help to avoid the trap: One day I might evenutally attempt to push that boulder up the mountain again. Today is not that day. Brian
