On Mon, 23 Jun 2025 21:16:30 GMT, Stuart Marks <sma...@openjdk.org> wrote:
>> `Scanner` seems to scan for even more characters: >> https://github.com/openjdk/jdk/blob/c4fb00a7be51c7a05a29d3d57d787feb5c698ddf/src/java.base/share/classes/java/util/Scanner.java#L490 >> >> Would it make sense to resemble this? Would it make sense to simply use >> `Scanner` directly? 🤔 > > The `readAllLines` method has a specification of line terminators that agrees > with that of `BufferedReader::readLine` and `String::lines` and so we don't > want to change it to be different. > > Unfortunately `Scanner` doesn't seem to have a specification of what it > considers to be a line. Also unfortunately, its notion of line separators > isn't the same as the regex pattern `\R`. > It might be worth adding a test of unconventional sequences or \r and \n, > including \r\r and \n\n, \r. I think that the test changes in [d5abfa4](https://github.com/openjdk/jdk/pull/25863/commits/d5abfa450cb3fcd604560833038735e41952bce9 ) cover this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25863#discussion_r2164681227