RFR: 8305457: Implement java.io.IO [v3]
Stuart Marks
smarks at openjdk.org
Wed May 8 16:08:53 UTC 2024
On Wed, 8 May 2024 09:39:13 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
>> src/java.base/share/classes/java/io/Console.java line 151:
>>
>>> 149: /**
>>> 150: * Writes a string representation of the specified object to this console's
>>> 151: * output stream, terminates the line and then flushes the console.
>>
>> Should this specify if the line termination will be platform dependent character(s) or independent of the platform?
>
> That's a good question. I think it should. That `println` method is not specified in terms of `printf` or `format`. Thus, we cannot reduce `println` to, say, `printf("%s%n", obj)`, leaning on `Formatter`'s definition of `%n`:
>
> 'n' line separator The result is the platform-specific line separator
>
> @stuart-marks, any thoughts on wording? Mind you, if we add any such wording, we'll have to update CSR too.
Well `Formatter` defers to `System.lineSeparator()` so I think we should refer to that. Not sure that needs to be repeated in `java.io.IO`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19112#discussion_r1594281188
More information about the core-libs-dev
mailing list