RFR: 8372359: Clean jpackage error messages [v6]

Alexander Matveev almatvee at openjdk.org
Sat Nov 22 01:10:55 UTC 2025


On Fri, 21 Nov 2025 21:35:13 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> Some jpackage error messages have "Error: " prefix. Some don't. The prefix is redundant as jpackage assembles the error message from the localized "Error: " prefix and localized message body [1]. The prefix was removed. 
>> 
>> There are error messages specific to jpackage options that duplicate generic error messages. They are:
>> 
>> **ERR_BuildRootInvalid**
>> It duplicates a generic "error.parameter-not-empty-directory" error message.
>> 
>> | Specialized error message | Generic error message | 
>> | --- | --- |
>> | Error: temp (foo) must be non-existent or empty directory | The value "foo" provided for parameter --temp is not an empty directory or non existent path |
>> 
>> **ERR_AppImageNotExist**
>> It duplicates a generic "error.parameter-not-directory" error message.
>> 
>> | Specialized error message | Generic error message | 
>> | --- | --- |
>> | Error: App image directory "foo" does not exist | The value "foo" provided for parameter --app-image is not a directory |
>> 
>> **ERR_LicenseFileNotExit**
>> It duplicates a generic "error.parameter-not-file" error message.
>> 
>> | Specialized error message | Generic error message | 
>> | --- | --- |
>> | Error: Specified license file does not exist | The value "foo" provided for parameter --license-file is not a file |
>> 
>> **ERR_BothMainJarAndModule**
>> It duplicates a generic "ERR_MutuallyExclusiveOptions" error message.
>> 
>> | Specialized error message | Generic error message | 
>> | --- | --- |
>> | Error: Cannot have both --main-jar and --module Options | Mutually exclusive options [--main-jar] and [--module] |
>> 
>> **ERR_NoAddLauncherName**
>> It duplicates a generic "error.parameter-add-launcher-malformed" error message.
>> 
>> | Specialized error message | Generic error message | 
>> | --- | --- |
>> | Error: --add-launcher option requires a name and a file path (--add-launcher <name>=<file path>) | The value "foo" provided for parameter --add-launcher does not match the pattern <name>=<file path> |
>> 
>> Specialized error messages duplicating generic error messages were removed to simplify maintenance.
>> 
>>  **ERR_MissingArgument**
>> ERR_MissingArgument was not referenced in the implementation, but was mistakenly referenced in the tests. It was replaced with ERR_MissingArgument2, and ERR_MissingArgument was removed.
>> 
>> **error.invalid-option-value**
>> "error.invalid-option-value" was used for errors in shortcut launcher options (--win-shortcut, --linux-shortcut), but it is not descriptive. For this reason, it was re...
>
> Alexey Semenyuk has updated the pull request incrementally with one additional commit since the last revision:
> 
>   StandardOptionValueExceptionFactory: remove unused code

Looks good.

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

Marked as reviewed by almatvee (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28457#pullrequestreview-3495007676


More information about the core-libs-dev mailing list