Skip to content

Commit

Permalink
Merge pull request #5928 from yersan/WFCORE-6766
Browse files Browse the repository at this point in the history
[WFCORE-6766] Do not ignore --stability argument when thre is only on…
  • Loading branch information
yersan authored Apr 4, 2024
2 parents aef4f68 + 99b1c94 commit 775d2ea
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 775d2ea

Please sign in to comment.