On Wed, 26 Nov 2025 16:46:41 GMT, David Beaumont <[email protected]> wrote:

>> Adds a semantic reason for failure which can be optionally interrogated by 
>> calling code.
>> Use the 'Reason.BAD_VERSION' value to trigger a different translated error 
>> message from the JImageTask.
>> 
>> I would consider moving the error message string into the Reason enum to 
>> simplify the code triggering the error and avoid message string duplication, 
>> but it's not straightforward due to the need to supply the version numbers.
>> 
>> We can use this approach to provide translated messages for all the distinct 
>> failure reasons if needed.
>
> David Beaumont has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Redo bad indentation
>  - undo blank line

As discussed, the error message is now not internationalized.


Error: Unable to open 
../../../valhalla/thor/build/linux-x64-debug/images/jdk/lib/modules: The image 
file "../../../valhalla/thor/build/linux-x64-debug/images/jdk/lib/modules" is 
not the correct version.
Use '<JAVA_HOME>/bin/jimage' for the JDK associated with this jimage file.


The first line is as-it-was, but the duplication of the jimage path feels 
unnecessary, and is likely to make that line longer than any reasonable 
terminal window.
But of course other places where the IOException occurs don't have the first 
copy of it, so it's not 100% clear if it's worth thinking about changing it.

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

PR Comment: https://git.openjdk.org/jdk/pull/28456#issuecomment-3582228438

Reply via email to