diff --git a/host-controller/src/main/java/org/jboss/as/host/controller/Main.java b/host-controller/src/main/java/org/jboss/as/host/controller/Main.java index 32d37307357..a7f27164747 100644 --- a/host-controller/src/main/java/org/jboss/as/host/controller/Main.java +++ b/host-controller/src/main/java/org/jboss/as/host/controller/Main.java @@ -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); diff --git a/server/src/main/java/org/jboss/as/server/Main.java b/server/src/main/java/org/jboss/as/server/Main.java index 3f0149c33dc..95b4a51ce8e 100644 --- a/server/src/main/java/org/jboss/as/server/Main.java +++ b/server/src/main/java/org/jboss/as/server/Main.java @@ -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("=");