On Thu, 1 May 2025 18:00:54 GMT, Stuart Marks <sma...@openjdk.org> wrote:
> I'd suggest not having this method's implementation depend on an overridable > method. I'm jumping the gun here by referring to an implementation detail, but the overridable method problem could be circumvented using an approach taken in other classes in `java.io`: if (getClass() == BufferedReader.class) { try { return lines().toList(); } catch (UncheckedIOException ue) { // the cause cannot be null throw ue.getCause(); } } else { return super.readAllLines(); } This would not need to be mentioned in the specification. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24728#discussion_r2074159396