Skip to content

Commit

Permalink
Merge pull request #6392 from soul2zimate/WFLY-3508
Browse files Browse the repository at this point in the history
[WFLY-3508][BZ1104730], add parameter StateValues for new ErrorState.
  • Loading branch information
bstansberry committed Jun 24, 2014
2 parents 09d55a2 + f9e39b5 commit 9153df9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public ErrorState(ConsoleWrapper theConsole, String errorMessage) {
this(theConsole, errorMessage, null, null);
}

public ErrorState(ConsoleWrapper theConsole, String errorMessage, StateValues stateValues) {
this(theConsole, errorMessage, null, stateValues);
}

public ErrorState(ConsoleWrapper theConsole, String errorMessage, State nextState) {
this(theConsole, errorMessage, nextState, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public State execute() {
}
// The user could have pressed Ctrl-D, in which case we do not use the default value.
if (temp == null || existingUsername == null || existingUsername.length() == 0) {
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.noUsernameExiting());
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.noUsernameExiting(), stateValues);
}
stateValues.setUserName(existingUsername);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public State execute() {
theConsole.printf(DomainManagementLogger.ROOT_LOGGER.passwordPrompt());
char[] tempChar = theConsole.readPassword(" : ");
if (tempChar == null || tempChar.length == 0) {
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.noPasswordExiting());
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.noPasswordExiting(), stateValues);
}
stateValues.setPassword(new String(tempChar));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public State execute() {
}
return new PropertyFileFinder(theConsole, stateValues);
default:
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.invalidChoiceResponse(), this);
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.invalidChoiceResponse(), this, stateValues);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public State execute() {
return confirmWeakPassword(result);
}
if (rejectResult) {
return new ErrorState(theConsole, result.getMessage(), getRetryState());
return new ErrorState(theConsole, result.getMessage(), getRetryState(), stateValues);
}
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ValidateRealmState(ConsoleWrapper theConsole, final StateValues stateValu
public State execute() {
String enteredRealm = stateValues.getRealm();
if (enteredRealm.length() == 0) {
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.realmMustBeSpecified(), new PromptRealmState(theConsole, stateValues));
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.realmMustBeSpecified(), new PromptRealmState(theConsole, stateValues), stateValues);
}

if (stateValues.getFileMode() != FileMode.UNDEFINED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public State execute() {
stateValues.getOptions().setDisable(true);
return new PreModificationState(theConsole, stateValues);
default:
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.invalidChoiceUpdateUserResponse(), this);
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.invalidChoiceUpdateUserResponse(), this, stateValues);
}
return ValidateUserState.this;
}
Expand Down

0 comments on commit 9153df9

Please sign in to comment.