while (className == null) {
ClassFindCommand classFindCommand = newClassFindCommand();
classFindCommand.setClassDirectories(classDirectories);
CommandInput capturedInput = commandState.capture(classFindCommand);
if (capturedInput.isGoBack()) {
// skip the rest of this loop and start again
continue;
}
classFindCommand.execute(commandState);
List<String> foundClasses = classFindCommand.getFoundClasses();
if (foundClasses.size() >= 2) {
AlternativeInputCommand altInputCommand = new AlternativeInputCommand(foundClasses
.toArray(new String[foundClasses.size()]));
CommandInput input = commandState.capture(altInputCommand);
if (input.isGoBack()) {
// start again
continue;
}
altInputCommand.execute(commandState);