Buggy code:
class CommandContextImpl implements CommandContext , ModelControllerClientFactory . ConnectionCloseHandler { private static final Logger log = Logger . getLogger ( CommandContext . class ) ; private final CliConfig config ; 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 String defaultControllerProtocol ; private String defaultControllerHost ; private int defaultControllerPort ; private String controllerHost ; private int controllerPort = - 1 ; 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 = new DefaultPrefixFormatter ( ) ; private final OperationCandidatesProvider operationCandidatesProvider ; private final OperationRequestHandler operationHandler ; private BatchManager batchManager = new DefaultBatchManager ( ) ; private final CommandCompleter cmdCompleter ; private BufferedWriter outputTarget ; private List < CliEventListener > listeners = new ArrayList < CliEventListener > ( ) ; private int exitCode ; private File currentDir = new File ( "" ) ; private boolean resolveParameterValues ; private boolean silent ; CommandContextImpl ( ) throws CliInitializationException { } CommandContextImpl ( String username , char [ ] password , boolean disableLocalAuth ) throws CliInitializationException { } CommandContextImpl ( String defaultControllerProtocol , String defaultControllerHost , int defaultControllerPort , String username , char [ ] password , boolean disableLocalAuth , boolean initConsole , final int connectionTimeout ) throws CliInitializationException { } CommandContextImpl ( String defaultControllerHost , int defaultControllerPort , String username , char [ ] password , boolean disableLocalAuth , InputStream consoleInput , OutputStream consoleOutput ) throws CliInitializationException { } protected void initBasicConsole ( InputStream consoleInput , OutputStream consoleOutput ) throws CliInitializationException { } private void copyConfigSettingsToConsole ( InputStream consoleInput , OutputStream consoleOutput ) { } private void initCommands ( ) { } private void registerExtraHandlers ( ) { ServiceLoader < CommandHandlerProvider > loader = ServiceLoader . load ( CommandHandlerProvider . class ) ; for ( CommandHandlerProvider provider : loader ) { <START_BUG> cmdRegistry . registerHandler ( provider . createCommandHandler ( this ) , provider . getNames ( ) ) ; <END_BUG> } } 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 ) { } @ 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 protocol , String host , int port ) throws CommandLineException { } @ Override public void bindClient ( ModelControllerClient newClient ) { } private void initNewClient ( ModelControllerClient newClient , String host , int port ) { } @ Override public File getCurrentDir ( ) { } @ Override public void setCurrentDir ( File dir ) { } private boolean handleSSLFailure ( ) 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 boolean tryConnection ( final ModelControllerClient client , String host , int port ) throws CommandLineException { } @ Override public void disconnectController ( ) { } @ Override public String getControllerHost ( ) { } @ Override public int getControllerPort ( ) { } @ Override public void clearScreen ( ) { } String promptConnectPart ; String getPrompt ( ) { } @ Override public CommandHistory getHistory ( ) { } @ Override public String getDefaultControllerHost ( ) { } @ Override public int getDefaultControllerPort ( ) { } 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 { } protected ModelNode buildRequest ( String line , boolean batchMode ) throws CommandFormatException { } @ Override public CommandLineCompleter getDefaultCommandCompleter ( ) { } @ Override public ParsedCommandLine getParsedCommandLine ( ) { } @ Override public boolean isDomainMode ( ) { } @ Override public void addEventListener ( CliEventListener listener ) { } @ Override public CliConfig getConfig ( ) { } protected void setOutputTarget ( String filePath ) { } protected void notifyListeners ( CliEvent event ) { } @ Override public void interact ( ) { } @ Override public boolean isResolveParameterValues ( ) { } @ Override public void setResolveParameterValues ( boolean resolve ) { } @ Override public void handleClose ( ) { }

Fix:
cmdRegistry . registerHandler ( provider . createCommandHandler ( this ) , provider . isTabComplete ( ) , provider . getNames ( ) ) ;