Skip to content

Commit 48f235a

Browse files
Remove dead code. Exception with message.app-image-requires-identifier id will never be thrown from MacPkgBundler because bundle identifier will fallback to app name in the worst case scenario. app name is validated before MacPkgBundler.validate() is called.
1 parent ea7fe31 commit 48f235a

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ public String getID() {
685685
}
686686

687687
private static boolean isValidBundleIdentifier(String id) {
688+
Objects.requireNonNull(id);
688689
for (int i = 0; i < id.length(); i++) {
689690
char a = id.charAt(i);
690691
// We check for ASCII codes first which we accept. If check fails,
@@ -709,12 +710,6 @@ public boolean validate(Map<String, ? super Object> params)
709710
validateAppImageAndBundeler(params);
710711

711712
String identifier = MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params);
712-
if (identifier == null) {
713-
throw new ConfigException(
714-
I18N.getString("message.app-image-requires-identifier"),
715-
I18N.getString(
716-
"message.app-image-requires-identifier.advice"));
717-
}
718713
if (!isValidBundleIdentifier(identifier)) {
719714
throw new ConfigException(
720715
MessageFormat.format(I18N.getString(

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ message.app-image-dir-does-not-exist=Specified application image directory {0}:
7676
message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists.
7777
message.app-image-requires-app-name=When using an external app image you must specify the app name.
7878
message.app-image-requires-app-name.advice=Set the app name via the -name CLI flag, the fx:application/@name ANT attribute, or via the 'appName' bundler argument.
79-
message.app-image-requires-identifier=Unable to extract identifier from app image.
80-
message.app-image-requires-identifier.advice=Use "--verbose" for extended error message or specify it via "--mac-package-identifier".
8179
message.invalid-identifier=invalid mac bundle identifier [{0}].
8280
message.invalid-identifier.advice=specify identifier with "--mac-package-identifier".
8381
message.building-dmg=Building DMG package for {0}.

0 commit comments

Comments
 (0)