RFR: 8372359: Clean jpackage error messages
Alexey Semenyuk
asemenyuk at openjdk.org
Fri Nov 21 17:00:32 UTC 2025
On Fri, 21 Nov 2025 16:45:31 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_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.
>
> Also, ERR_MissingArgument is not referenced in the implementation, but mistakenly referenced in the tests. It was replaced with ERR_MissingArgument2, and ERR_MissingArgument was removed.
>
> There are error messages that are not referenced in the code. They are:
>
> | ID | Note |
> | -------- | -------- |
> | message.creating-association-with-null-extension | FA with null extensions are not supported starting from jdk25: https://github.com/openjdk/jdk/blob/8531fa146be1da5e96c0f23091882a27c67d7893/src/jdk.jpackage/share/classes/jdk/jpackage/internal/FileAssociationGroup.java#L93. https://github.com/openjdk/jdk21u/blob/485ced0d5b240d45640906a4a101ec94c18820ba/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java#L519 |
> | error.must-sign-app-store | Latest referen...
@sashamatveev PTAL
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28457#issuecomment-3563875323
More information about the core-libs-dev
mailing list