Skip to content

Commit

Permalink
[WFCORE-6766] Do not ignore --stability argument when thre is only on…
Browse files Browse the repository at this point in the history
…e permissible stabiliy level

Jira issue: https://issues.redhat.com/browse/WFCORE-6766
  • Loading branch information
yersan committed Apr 3, 2024
1 parent b0c1ab8 commit 99b1c94
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,14 @@ public static HostControllerEnvironmentWrapper determineEnvironment(String[] arg
} else if (arg.equals(CommandLineConstants.SECMGR)) {
// Enable the security manager
securityManagerEnabled = true;
} else if ((productConfig.getStabilitySet().size() > 1) && arg.startsWith(CommandLineConstants.STABILITY)) {
String stabilityName = (arg.length() == CommandLineConstants.STABILITY.length()) ? args[++i] : parseValue(arg, CommandLineConstants.STABILITY);
if (stabilityName == null) {
return new HostControllerEnvironmentWrapper(HostControllerEnvironmentWrapper.HostControllerEnvironmentStatus.ERROR, productConfig);
} else if (arg.startsWith(CommandLineConstants.STABILITY)) {
if (productConfig.getStabilitySet().size() > 1) {
String stabilityName = (arg.length() == CommandLineConstants.STABILITY.length()) ? args[++i] : parseValue(arg, CommandLineConstants.STABILITY);
if (stabilityName == null) {
return new HostControllerEnvironmentWrapper(HostControllerEnvironmentWrapper.HostControllerEnvironmentStatus.ERROR, productConfig);
}
hostSystemProperties.put(ProcessEnvironment.STABILITY, stabilityName);
}
hostSystemProperties.put(ProcessEnvironment.STABILITY, stabilityName);
} else {
STDERR.println(HostControllerLogger.ROOT_LOGGER.invalidOption(arg, usageNote()));
return new HostControllerEnvironmentWrapper(HostControllerEnvironmentWrapper.HostControllerEnvironmentStatus.ERROR, productConfig);
Expand Down
12 changes: 7 additions & 5 deletions server/src/main/java/org/jboss/as/server/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,14 @@ public static ServerEnvironmentWrapper determineEnvironment(String[] args, Prope
} else {
gitBranch = arg.substring(idx + 1);
}
} else if ((productConfig.getStabilitySet().size() > 1) && arg.startsWith(CommandLineConstants.STABILITY)) {
String stability = (arg.length() == CommandLineConstants.STABILITY.length()) ? args[++i] : parseValue(productConfig, arg, CommandLineConstants.STABILITY);
if (stability == null) {
return new ServerEnvironmentWrapper(ServerEnvironmentWrapper.ServerEnvironmentStatus.ERROR);
} else if (arg.startsWith(CommandLineConstants.STABILITY)) {
if (productConfig.getStabilitySet().size() > 1) {
String stability = (arg.length() == CommandLineConstants.STABILITY.length()) ? args[++i] : parseValue(productConfig, arg, CommandLineConstants.STABILITY);
if (stability == null) {
return new ServerEnvironmentWrapper(ServerEnvironmentWrapper.ServerEnvironmentStatus.ERROR);
}
systemProperties.setProperty(ProcessEnvironment.STABILITY, stability);
}
systemProperties.setProperty(ProcessEnvironment.STABILITY, stability);
} else if(ConfigurationExtensionFactory.isConfigurationExtensionSupported()
&& ConfigurationExtensionFactory.commandLineContainsArgument(arg)) {
int idx = arg.indexOf("=");
Expand Down

0 comments on commit 99b1c94

Please sign in to comment.