diff --git a/CHANGELOG.md b/CHANGELOG.md index 20367a8b..77d01c7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 2.0.0 (not yet released) +- removed the workaround for WFCORE-526 + ## 2.0.0-Alpha.3 - added support for WildFly 21 - WildFly 24 diff --git a/core/src/main/java/org/jboss/as/cli/impl/WorkaroundForWFCORE526_CommandContextImpl.java b/core/src/main/java/org/jboss/as/cli/impl/WorkaroundForWFCORE526_CommandContextImpl.java deleted file mode 100644 index 75af2d90..00000000 --- a/core/src/main/java/org/jboss/as/cli/impl/WorkaroundForWFCORE526_CommandContextImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.jboss.as.cli.impl; - -import org.jboss.as.cli.CliInitializationException; - -/** - *
This is a workaround for WFCORE-526 (affects AS 7 and - * WildFly 8, fixed in WildFly 9). This class has a stupidly long name to signify that it's not meant to be used - * publicly, even if it is {@code public}.
- * - *All methods are inherited unmodified, except of {@code getControllerHost} and {@code getControllerPort} - * that return correct values. It needs to be in the {@code org.jboss.as.cli.impl} package so that it can inherit - * from a package-private class.
- */ -public final class WorkaroundForWFCORE526_CommandContextImpl extends CommandContextImpl { - private final String host; - private final int port; - - public WorkaroundForWFCORE526_CommandContextImpl(String host, int port) throws CliInitializationException { - super(); - this.host = host; - this.port = port; - } - - @Override - public String getControllerHost() { - return getModelControllerClient() != null ? host : null; - } - - @Override - public int getControllerPort() { - return getModelControllerClient() != null ? port : -1; - } -} diff --git a/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java b/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java index 67e669ee..7dd1c93c 100644 --- a/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java +++ b/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java @@ -9,7 +9,7 @@ import org.jboss.as.cli.CliInitializationException; import org.jboss.as.cli.CommandContext; import org.jboss.as.cli.CommandFormatException; -import org.jboss.as.cli.impl.WorkaroundForWFCORE526_CommandContextImpl; +import org.jboss.as.cli.impl.CommandContextFactoryImpl; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.as.controller.client.Operation; import org.jboss.dmr.ModelNode; @@ -44,7 +44,7 @@ private void connect() throws IOException { try { fakeJbossCliConfigToAvoidWarning(); - this.cliContext = new WorkaroundForWFCORE526_CommandContextImpl(options.host, options.port); + this.cliContext = new CommandContextFactoryImpl().newCommandContext(); cliContext.setSilent(true); // CLI shouldn't print messages to the console directly; proper logging is fine cliContext.bindClient(client); } catch (CliInitializationException e) {