Re: RFR: 8305457: Implement java.io.IO [v14]

2024-05-24 Thread Jan Lahoda
On Fri, 24 May 2024 11:30:19 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v14]

2024-05-24 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v13]

2024-05-24 Thread Jan Lahoda
On Thu, 23 May 2024 17:14:19 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v13]

2024-05-23 Thread Stuart Marks
On Thu, 23 May 2024 17:14:19 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v13]

2024-05-23 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v12]

2024-05-22 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v11]

2024-05-22 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v10]

2024-05-21 Thread Andrey Turbanov
On Tue, 21 May 2024 21:16:52 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 78: >> >>> 76: String line = null; >>> 77: synchronized (writeLock) { >>> 78: synchronized(readLock) { >> >> Suggestion: >> >> sy

Re: RFR: 8305457: Implement java.io.IO [v10]

2024-05-21 Thread Pavel Rappo
On Tue, 21 May 2024 19:55:22 GMT, Andrey Turbanov wrote: >> Pavel Rappo has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 20 commits: >> >> - Add diagnostic output >> - Use "expect" that was found >> - Merge branch 'master' into

Re: RFR: 8305457: Implement java.io.IO [v10]

2024-05-21 Thread Andrey Turbanov
On Tue, 21 May 2024 15:44:18 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v10]

2024-05-21 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-14 Thread Stuart Marks
On Tue, 14 May 2024 14:31:52 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/io/IO.java line 98: >> >>> 96: * or if an I/O error occurs >>> 97: */ >>> 98: public static String readln(String prompt) { >> >> Did we consider Optional here? Maybe that is to

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-14 Thread Naoto Sato
On Mon, 13 May 2024 09:56:35 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-14 Thread Pavel Rappo
On Tue, 14 May 2024 14:27:35 GMT, Per Minborg wrote: >> Pavel Rappo has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 17 additional >> commits sin

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-14 Thread Per Minborg
On Mon, 13 May 2024 09:56:35 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-13 Thread Stuart Marks
On Mon, 13 May 2024 09:56:35 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-13 Thread Jaikiran Pai
On Fri, 10 May 2024 16:41:28 GMT, Naoto Sato wrote: >> When implementing, I asked myself if I must use any of those monitors and >> decided that I don't have to. My reasoning is below. >> >> `readLock`: >> >> - is used inside the object that `Reader reader` is initialised with, and >> >> - it

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-13 Thread Jaikiran Pai
On Mon, 13 May 2024 09:56:35 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merg

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-13 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Naoto Sato
On Fri, 10 May 2024 14:54:10 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 61: >> >>> 59: @Override >>> 60: public JdkConsole println(Object obj) { >>> 61: pw.println(obj); >> >> Are these `println(...)` and `print(...)` methods

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Pavel Rappo
On Fri, 10 May 2024 07:45:02 GMT, Jaikiran Pai wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix System.console().readln(null) in jshell >> >> Without it, jshell hangs on me. Will think of a test. > > src/jav

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Pavel Rappo
On Fri, 10 May 2024 07:23:38 GMT, Per Minborg wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix System.console().readln(null) in jshell >> >> Without it, jshell hangs on me. Will think of a test. > > src/java

Re: RFR: 8305457: Implement java.io.IO [v8]

2024-05-10 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Pavel Rappo
On Fri, 10 May 2024 07:29:42 GMT, Per Minborg wrote: >> If the sole constructor of a class is private, not only does it preclude the >> class from being instantiated, but it also precludes the class from being >> extended. Mind you, even with the sole private constructor, both >> instantiation

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Jaikiran Pai
On Thu, 9 May 2024 18:27:08 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Per Minborg
On Tue, 7 May 2024 20:23:11 GMT, Pavel Rappo wrote: >>> Should this be final? >> >> With only the private constructor, it doesn't matter too much in practice, >> but an explicit `final` would be good documentation if that is the intent. > > If the sole constructor of a class is private, not onl

Re: RFR: 8305457: Implement java.io.IO [v4]

2024-05-10 Thread Jaikiran Pai
On Wed, 8 May 2024 18:43:41 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Per Minborg
On Thu, 9 May 2024 18:27:08 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-09 Thread Stuart Marks
On Thu, 9 May 2024 18:27:08 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-09 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v6]

2024-05-09 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v5]

2024-05-09 Thread Pavel Rappo
On Thu, 9 May 2024 14:41:13 GMT, Jonathan Gibbons wrote: > (Minor). at least within the context of this PR, tags like `@param` and > `@throws` are stylistically inconsistent as to whether they begin with a > capital letter and end with a period. (I have not checked for local > consistency with

Re: RFR: 8305457: Implement java.io.IO [v5]

2024-05-09 Thread Jonathan Gibbons
On Thu, 9 May 2024 14:23:37 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v5]

2024-05-09 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
On Wed, 8 May 2024 19:40:44 GMT, Stuart Marks wrote: >>> Most of these are defined in terms of `String.valueOf(Object)` which if >>> passed a null reference will return the String object containing `null`. So >>> no, I don't think NPE should be thrown. It might be worth mentioning this >>> exp

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Stuart Marks
On Wed, 8 May 2024 18:25:50 GMT, Pavel Rappo wrote: >> Most of these are defined in terms of `String.valueOf(Object)` which if >> passed a null reference will return the String object containing `null`. So >> no, I don't think NPE should be thrown. It might be worth mentioning this >> explicit

Re: RFR: 8305457: Implement java.io.IO [v4]

2024-05-08 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
On Wed, 8 May 2024 16:06:29 GMT, Stuart Marks wrote: > Most of these are defined in terms of `String.valueOf(Object)` which if > passed a null reference will return the String object containing `null`. So > no, I don't think NPE should be thrown. It might be worth mentioning this > explicitly

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
I don't remember it being considered, but I think it falls outside the scope of JEP 477 (emphasis mine): > We achieve this effect by declaring a new top-level class in the java.io > package named, simply, IO. It declares the above three static methods for > **textual** I/O with the console, and

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Stuart Marks
On Wed, 8 May 2024 09:39:13 GMT, Pavel Rappo 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

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Stuart Marks
On Wed, 8 May 2024 13:13:33 GMT, Pavel Rappo wrote: >> I haven't given it a try, but a brief look at the code suggests that if the >> console implementation backed by JLine gets used, then a `null` prompt may >> not generate a `NullPointerException` (since JLine appears to allow `null`) >> whe

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Olexandr Rotan
Has it been considered to add a readKey() method to IO class? In my experience, it is pretty commonly used by beginners when they write things like console games (snake, catcher game etc.). I am aware there is System.in.read() method, but since we decided to promote some methods to separate methods

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
On Wed, 8 May 2024 10:31:59 GMT, Jaikiran Pai wrote: >> If we specify that, it would be very much unlike all other `Console` methods >> that are covered by this: >> >> * Unless otherwise specified, passing a {@code null} argument to any >> method >> * in this class will cause a {@link

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Jaikiran Pai
On Wed, 8 May 2024 08:59:18 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/io/Console.java line 192: >> >>> 190: * >>> 191: * @param prompt >>> 192: * A prompt string. >> >> Hello Pavel, should this specify whether `prompt` can be null? > > If we specify th

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
On Wed, 8 May 2024 05:53:25 GMT, Jaikiran Pai wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Strengthen tests after 8330998 >> >> https://github.com/openjdk/jdk/pull/18996 now allows us to test >> Console IO

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
On Wed, 8 May 2024 05:59:14 GMT, Jaikiran Pai wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Strengthen tests after 8330998 >> >> https://github.com/openjdk/jdk/pull/18996 now allows us to test >> Console IO

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-08 Thread Pavel Rappo
On Wed, 8 May 2024 05:41:52 GMT, Jaikiran Pai wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Strengthen tests after 8330998 >> >> https://github.com/openjdk/jdk/pull/18996 now allows us to test >> Console IO

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Jaikiran Pai
On Tue, 7 May 2024 19:46:18 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Jaikiran Pai
On Tue, 7 May 2024 19:46:18 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Jaikiran Pai
On Wed, 8 May 2024 05:45:55 GMT, Jaikiran Pai wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Strengthen tests after 8330998 >> >> https://github.com/openjdk/jdk/pull/18996 now allows us to test >> Console IO

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Jaikiran Pai
On Tue, 7 May 2024 19:46:18 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Jaikiran Pai
On Tue, 7 May 2024 19:46:18 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Stuart Marks
On Tue, 7 May 2024 22:12:55 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/io/IO.java line 37: >> >>> 35: * is {@code null}; otherwise, the effect is as if a similarly-named >>> method >>> 36: * had been called on that console. >>> 37: * >> >> Add a note here on encoding (chara

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 21:19:59 GMT, Stuart Marks wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Strengthen tests after 8330998 >> >> https://github.com/openjdk/jdk/pull/18996 now allows us to test >> Console IO

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Stuart Marks
On Tue, 7 May 2024 19:46:18 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 02:54:39 GMT, Joe Darcy wrote: >> src/java.base/share/classes/java/io/IO.java line 41: >> >>> 39: */ >>> 40: @PreviewFeature(feature = PreviewFeature.Feature.IMPLICIT_CLASSES) >>> 41: public class IO { >> >> Should this be final? > >> Should this be final? > > With only the

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Rémi Forax
On Tue, 7 May 2024 16:09:08 GMT, Pavel Rappo wrote: >> I do not think the step to "standardise" a preview feature exists ? When a >> preview feature becomes a released feature, the code is very lightly edited, >> at least it this is my experience. >> >> You can change both readln and readLine

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Joe Darcy
On Tue, 7 May 2024 17:37:57 GMT, Pavel Rappo wrote: > Yes, we do. There's a common misconception that `{@inheritDoc}` inherits the > complete doc comment. In reality, `{@inheritDoc}` inherits only the main > description, which does not include any `@throws` tags. > > A `@throws` tag is either

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO [v2]

2024-05-07 Thread Pavel Rappo
> Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --squash` of a now obsolete [draft > PR]. > > [Implicitl

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 17:30:46 GMT, Naoto Sato wrote: > Sorry, I read it wrong. Your comment is clear so no need for rewording Still, I think that your misreading is a symptom of a problem with my wording. Let me try to rephrase it; let's see if you like it more. - PR Review Comment:

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 16:24:52 GMT, Naoto Sato wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Naoto Sato
On Tue, 7 May 2024 17:15:43 GMT, Pavel Rappo wrote: >> test/jdk/java/io/IO/IO.java line 99: >> >>> 97: System.getProperty("test.jdk") + "/bin/java", >>> 98: "--enable-preview", >>> 99: "-Djdk.console=gibberish", >> >> The test comment suggests thi

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 16:32:46 GMT, Naoto Sato wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 01:20:39 GMT, Naoto Sato wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Naoto Sato
On Mon, 6 May 2024 21:45:12 GMT, Pavel Rappo wrote: > Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --sq

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 12:17:36 GMT, Rémi Forax wrote: > I do not think the step to "standardise" a preview feature exists ? When a > preview feature becomes a released feature, the code is very lightly edited, > at least it this is my experience. We may call it differently, but I think both you a

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Claes Redestad
On Tue, 7 May 2024 12:18:52 GMT, Rémi Forax wrote: >> I assume it's about performance. If so, I would defer any >> performance-related tweaks until they are necessary. Interactive reading >> from console does not sound like something requiring that level of >> performance tweaking. > > yes, le

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Rémi Forax
On Tue, 7 May 2024 11:00:52 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 74: >> >>> 72: >>> 73: @Override >>> 74: public String readln(String prompt) { >> >> this code can be simplified using an early return (and the body of the >> tr

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 05:52:12 GMT, Rémi Forax wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Pavel Rappo
On Tue, 7 May 2024 05:49:58 GMT, Rémi Forax wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git merge

Re: RFR: 8305457: Implement java.io.IO

2024-05-06 Thread Rémi Forax
On Mon, 6 May 2024 21:45:12 GMT, Pavel Rappo wrote: > Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --sq

Re: RFR: 8305457: Implement java.io.IO

2024-05-06 Thread Joe Darcy
On Tue, 7 May 2024 01:26:30 GMT, Chen Liang wrote: > Should this be final? With only the private constructor, it doesn't matter too much in practice, but an explicit `final` would be good documentation if that is the intent. - PR Review Comment: https://git.openjdk.org/jdk/pull/19

Re: RFR: 8305457: Implement java.io.IO

2024-05-06 Thread Chen Liang
On Mon, 6 May 2024 21:45:12 GMT, Pavel Rappo wrote: > Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --sq

RFR: 8305457: Implement java.io.IO

2024-05-06 Thread Pavel Rappo
Please review this PR which introduces the `java.io.IO` top-level class and three methods to `java.io.Console` for [Implicitly Declared Classes and Instance Main Methods (Third Preview)]. This PR has been obtained as `git merge --squash` of a now obsolete [draft PR]. [Implicitly Declared Classe