mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-19 04:13:07 +00:00
8272815: jpackage --type rpm produces an error: Invalid or unsupported type: [null]
Reviewed-by: herrick, almatvee
This commit is contained in:
parent
8132bfd23f
commit
a3ca770227
@ -35,6 +35,7 @@ import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.jar.Attributes;
|
||||
@ -635,15 +636,13 @@ public class Arguments {
|
||||
for (jdk.jpackage.internal.Bundler bundler :
|
||||
Bundlers.createBundlersInstance().getBundlers(bundleType)) {
|
||||
if (type == null) {
|
||||
if (bundler.isDefault()
|
||||
&& bundler.supported(runtimeInstaller)) {
|
||||
return bundler;
|
||||
}
|
||||
if (bundler.isDefault()) {
|
||||
return bundler;
|
||||
}
|
||||
} else {
|
||||
if ((appImage || type.equalsIgnoreCase(bundler.getID()))
|
||||
&& bundler.supported(runtimeInstaller)) {
|
||||
return bundler;
|
||||
}
|
||||
if (appImage || type.equalsIgnoreCase(bundler.getID())) {
|
||||
return bundler;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -652,8 +651,6 @@ public class Arguments {
|
||||
private void generateBundle(Map<String,? super Object> params)
|
||||
throws PackagerException {
|
||||
|
||||
boolean bundleCreated = false;
|
||||
|
||||
// the temp dir needs to be fetched from the params early,
|
||||
// to prevent each copy of the params (such as may be used for
|
||||
// additional launchers) from generating a separate temp dir when
|
||||
@ -665,9 +662,10 @@ public class Arguments {
|
||||
// determine what bundler to run
|
||||
jdk.jpackage.internal.Bundler bundler = getPlatformBundler();
|
||||
|
||||
if (bundler == null) {
|
||||
throw new PackagerException("ERR_InvalidInstallerType",
|
||||
deployParams.getTargetFormat());
|
||||
if (bundler == null || !bundler.supported(runtimeInstaller)) {
|
||||
String type = Optional.ofNullable(bundler).map(Bundler::getID).orElseGet(
|
||||
() -> deployParams.getTargetFormat());
|
||||
throw new PackagerException("ERR_InvalidInstallerType", type);
|
||||
}
|
||||
|
||||
Map<String, ? super Object> localParams = new HashMap<>(params);
|
||||
|
||||
@ -32,7 +32,7 @@ import jdk.jpackage.test.TKit;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary jpackage application version testing
|
||||
* @summary Test jpackage output for erroneous input
|
||||
* @library ../../../../helpers
|
||||
* @build jdk.jpackage.test.*
|
||||
* @modules jdk.jpackage/jdk.jpackage.internal
|
||||
@ -44,7 +44,7 @@ import jdk.jpackage.test.TKit;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary jpackage application version testing
|
||||
* @summary Test jpackage output for erroneous input
|
||||
* @library ../../../../helpers
|
||||
* @build jdk.jpackage.test.*
|
||||
* @modules jdk.jpackage/jdk.jpackage.internal
|
||||
@ -96,7 +96,7 @@ public final class ErrorTest {
|
||||
{"Hello",
|
||||
new String[]{"--type", "invalid-type"},
|
||||
null,
|
||||
"Invalid or unsupported type:"},
|
||||
"Invalid or unsupported type: [invalid-type]"},
|
||||
// no --input
|
||||
{"Hello",
|
||||
null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user