Buggy code:
class CommandContextImpl implements CommandContext , ModelControllerClientFactory . ConnectionCloseHandler { private static final Logger log = Logger . getLogger ( CommandContext . class ) ; private final CliConfig config ; private final ControllerAddressResolver addressResolver ; private final CommandRegistry cmdRegistry = new CommandRegistry ( ) ; private Console console ; private boolean terminate ; private String cmdLine ; private DefaultCallbackHandler parsedCmd = new DefaultCallbackHandler ( true ) ; private boolean domainMode ; private ModelControllerClient client ; private ControllerAddress currentAddress ; private final String username ; private final char [ ] password ; private final boolean disableLocalAuth ; private final int connectionTimeout ; private SSLContext sslContext ; private CommandContextImpl . LazyDelagatingTrustManager trustManager ; private Map < String , Object > map = new HashMap < String , Object > ( ) ; private final OperationRequestAddress prefix = new DefaultOperationRequestAddress ( ) ; private final NodePathFormatter prefixFormatter = DefaultPrefixFormatter . INSTANCE ; private final OperationCandidatesProvider operationCandidatesProvider ; private final OperationRequestHandler operationHandler ; private BatchManager batchManager = new DefaultBatchManager ( ) ; private final CommandCompleter cmdCompleter ; private final GeneralTimeoutHandler timeoutHandler = new GeneralTimeoutHandler ( ) ; private BufferedWriter outputTarget ; private List < CliEventListener > listeners = new ArrayList < CliEventListener > ( ) ; private int exitCode ; private File currentDir = new File ( "" ) ; private boolean resolveParameterValues ; private boolean silent ; private Map < String , String > variables ; private Handler shutdownHook ; CommandContextImpl ( ) throws CliInitializationException { } CommandContextImpl ( String username , char [ ] password , boolean disableLocalAuth ) throws CliInitializationException { } CommandContextImpl ( String defaultController , String username , char [ ] password , boolean disableLocalAuth , boolean initConsole , final int connectionTimeout ) throws CliInitializationException { } CommandContextImpl ( String defaultController , String username , char [ ] password , boolean disableLocalAuth , InputStream consoleInput , OutputStream consoleOutput ) throws CliInitializationException { } protected void addShutdownHook ( ) { } protected void initBasicConsole ( InputStream consoleInput , OutputStream consoleOutput ) throws CliInitializationException { } private void copyConfigSettingsToConsole ( InputStream consoleInput , OutputStream consoleOutput ) { } private void initCommands ( ) { } private void registerExtraHandlers ( ) { } public int getExitCode ( ) { } private void initSSLContext ( ) throws CliInitializationException { } @ Override public boolean isTerminated ( ) { } private StringBuilder lineBuffer ; @ Override public void handle ( String line ) throws CommandLineException { } public void handleSafe ( String line ) { exitCode = 0 ; try { handle ( line ) ; } catch ( Throwable t ) { final StringBuilder buf = new StringBuilder ( ) ; buf . append ( t . getLocalizedMessage ( ) ) ; Throwable t1 = t . getCause ( ) ; while ( t1 != null ) { if ( ( t1 . getLocalizedMessage ( ) ) != null ) { buf . append ( ":<seq2seq4repair_space>" ) . append ( t1 . getLocalizedMessage ( ) ) ; } else { <START_BUG> buf . append ( ":<seq2seq4repair_space>" ) . append ( t1 . getClass ( ) . getName ( ) ) ; <END_BUG> } t1 = t1 . getCause ( ) ; } error ( buf . toString ( ) ) ; } } @ Override public String getArgumentsString ( ) { } @ Override public void terminateSession ( ) { } @ Override public void printLine ( String message ) { } protected void error ( String message ) { } private String readLine ( String prompt , boolean password , boolean disableHistory ) throws CommandLineException { } @ Override public void printColumns ( Collection < String > col ) { } @ Override public void set ( String key , Object value ) { } @ Override public Object get ( String key ) { } @ Override public Object remove ( String key ) { } @ Override public ModelControllerClient getModelControllerClient ( ) { } @ Override public CommandLineParser getCommandLineParser ( ) { } @ Override public OperationRequestAddress getCurrentNodePath ( ) { } @ Override public NodePathFormatter getNodePathFormatter ( ) { } @ Override public OperationCandidatesProvider getOperationCandidatesProvider ( ) { } @ Override public void connectController ( ) throws CommandLineException { } @ Override public void connectController ( String controller ) throws CommandLineException { } @ Override @ Deprecated public void connectController ( String host , int port ) throws CommandLineException { } @ Override public void bindClient ( ModelControllerClient newClient ) { } private void initNewClient ( ModelControllerClient newClient , ControllerAddress address ) { } @ Override public File getCurrentDir ( ) { } @ Override public void setCurrentDir ( File dir ) { } private boolean handleSSLFailure ( Certificate [ ] lastChain ) throws CommandLineException { } private static final String [ ] FINGERPRINT_ALGORITHMS = new String [ ] { "MD5" , "SHA1" } ; private Map < String , String > generateFingerprints ( final X509Certificate cert ) throws CommandLineException { } private String generateFingerPrint ( final String algorithm , final byte [ ] cert ) throws GeneralSecurityException { } private void tryConnection ( final ModelControllerClient client , ControllerAddress address ) throws CommandLineException , RedirectException { } @ Override public void disconnectController ( ) { } @ Override @ Deprecated public String getDefaultControllerHost ( ) { } @ Override @ Deprecated public int getDefaultControllerPort ( ) { } @ Override public ControllerAddress getDefaultControllerAddress ( ) { } @ Override public String getControllerHost ( ) { } @ Override public int getControllerPort ( ) { } @ Override public void clearScreen ( ) { } String promptConnectPart ; String getPrompt ( ) { } @ Override public CommandHistory getHistory ( ) { } private void resetArgs ( String cmdLine ) throws CommandFormatException { } @ Override public boolean isBatchMode ( ) { } @ Override public BatchManager getBatchManager ( ) { } @ Override public BatchedCommand toBatchedCommand ( String line ) throws CommandFormatException { } @ Override public ModelNode buildRequest ( String line ) throws CommandFormatException { }

Fix:
t1 . printStackTrace ( ) ;