On Fri, 8 Apr 2022 08:49:36 GMT, Tejesh R <d...@openjdk.java.net> wrote:
>> src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java line >> 350: >> >>> 348: } >>> 349: } >>> 350: out.write(endOfLine); >> >> It seems in windows, we use EndOfLineStringProperty property as >> [CRLF](https://github.com/openjdk/jdk/blob/f1b6e3ea16f06bc57e8e905fb115650e6c4ad98f/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java#L286) >> and `endOfLine ` is using the above property `EndOfLineStringProperty` so >> when you write out.write(endOfLine) will it not write \r\n again? > > Yes, Write function copies string without endOfLine, and endOfLine is > appended to it after the whole string is copied. > Before also it was copying string without endOfLine which included '\r', now > this logic copies string characters before '\r' and then appends endOfLine. ok, so you are telling out.write(array, last, counter - last - 1) will write till \r\n and out.write(endOfLine) will write \r\n, is it? ANyway, you need to modify this change as per coding style which is else { } ------------- PR: https://git.openjdk.java.net/jdk/pull/8122