RFR: 8180276: JTextPane getText return extra when mixed with methods of Document [v2]

Tejesh R duke at openjdk.java.net
Mon Apr 11 10:13:46 UTC 2022


On Mon, 11 Apr 2022 10:07:40 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> The user explicitly added a text with Windows line end into the text model. When such a text is written out on Windows, an extra `\r` gets added. Then when this text is read in, the `\r` which is not followed by `\n` gets converted to `\n` which results in a new line break.
> 
> The `else` block is needed, and it's the most common branch. The text model doesn't contain `\r` (should not contain). When the text is written out on Windows, line ends of `\n` are converted to `\r\n`.

Yes, exactly......

-------------

PR: https://git.openjdk.java.net/jdk/pull/8122



More information about the client-libs-dev mailing list