RFR: 8204256: improve jlink error message to report unsupported class file format
Ian Graves
igraves at openjdk.java.net
Wed Sep 30 22:17:20 UTC 2020
On Wed, 30 Sep 2020 21:48:12 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> This impacts the java.lang.module API. I think I'd prefer to drop all changes to jdk.internal.module from this patch
>> and instead focus on a jlink specific change.
>
> Maybe `ModulePath` can provide a method to open an input stream of the `module-info.class` of the named module found on
> the module path. jlink can then parse the class file to check if the major and minor version is supported class file
> version. Or a simpler solution is to concatenate the `FindException` message with the exception message of the cause.
> This will also cover other error cases besides unsupported class file version.
@mlchung's second suggestion would be the easiest route to take. I wanted to avoid fishing into exception messages or
anything along those lines. The initial work to this fix was to explore how tricky attaining that kind of parity is.
Alternatively we could change the existing exception message path and modify it so it's in line with the simpler
solution as well? That makes sense to me, anyway.
-------------
PR: https://git.openjdk.java.net/jdk/pull/409
More information about the core-libs-dev
mailing list