RFR: 8372301: Improve error message for jimage command line tool regarding version mismatch [v2]
David Beaumont
duke at openjdk.org
Tue Feb 17 16:37:20 UTC 2026
On Tue, 17 Feb 2026 13:38:06 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java line 438:
>>
>>> 436: }
>>> 437: } catch (IOException ioe) {
>>> 438: boolean isVersionMismatch = ioe instanceof BasicImageReader.ImageVersionMismatchException;
>>
>> Or I can have a separate catch block. Either is fine by me.
>
> A catch of ImageVersionMismatchException would be a bit nicer, not important of course.
My feeling is that, in this case, it's cleaner to just catch the IOE once, because it keeps the message handling in one place.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29723#discussion_r2817955450
More information about the core-libs-dev
mailing list