RFR: 8344706: Compiler Implementation of Compact Source Files and Instance Main Methods

Alan Bateman alanb at openjdk.org
Mon Apr 7 09:20:59 UTC 2025


On Sat, 5 Apr 2025 02:30:33 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/IO.java line 147:
>> 
>>> 145:         } catch (IOException ioe) {
>>> 146:             throw new IOError(ioe);
>>> 147:         }
>> 
>> Was `UncheckedIOException` considered? It might be better for beginners to learn throwing exceptions instead of errors.
>
> This implementation is not to be emulated by beginners. If an Exception.is thrown here, a user might be tempted to add handlers in their code, while this is an issue with the setup.

Someone is bound to ask why the readln method throw but the println methods don't.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24438#discussion_r2030830662


More information about the core-libs-dev mailing list