-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8372359: Clean jpackage error messages #28457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
8372359: Clean jpackage error messages #28457
Conversation
|
👋 Welcome back asemenyuk! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@alexeysemenyukoracle The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
@sashamatveev PTAL |
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.
ERR_AppImageNotExist
It duplicates a generic "error.parameter-not-directory" error message.
ERR_LicenseFileNotExit
It duplicates a generic "error.parameter-not-file" error message.
ERR_BothMainJarAndModule
It duplicates a generic "ERR_MutuallyExclusiveOptions" error message.
ERR_NoAddLauncherName
It duplicates a generic "error.parameter-add-launcher-malformed" error message.
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 replaced with the "error.parameter-not-launcher-shortcut-dir".
The wording of the new error message aligns with the wording of the error message jpackage will emit when it fails to parse "win-shortcut" or "linux-shortcut" property in an additional launcher property file (error.properties-parameter-not-launcher-shortcut-dir) which is:
The value "foo" provided for property "linux-shortcut" in "bar.properties" file is not a valid shortcut startup directory
Error messages that are not referenced in the code:
jdk/src/jdk.jpackage/share/classes/jdk/jpackage/internal/FileAssociationGroup.java
Line 93 in 8531fa1
jdk/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackageBuilder.java
Line 213 in 8531fa1
Unreferenced error messages were removed.
Additionally, reworked ErrorTest to differentiate between error and advice messages in the jpackage output.
Compared the contents of "*Resources.properties" files before and after the change to verify there are no unexpected changes:
[1]
jdk/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Main.java
Line 176 in 5f806e7
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28457/head:pull/28457$ git checkout pull/28457Update a local copy of the PR:
$ git checkout pull/28457$ git pull https://git.openjdk.org/jdk.git pull/28457/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28457View PR using the GUI difftool:
$ git pr show -t 28457Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28457.diff
Using Webrev
Link to Webrev Comment