Buggy code:
public class CommandLineMain { private static final CommandRegistry cmdRegistry = new CommandRegistry ( ) ; public static void main ( String [ ] args ) throws Exception { } private static void processCommands ( String [ ] commands , String defaultControllerHost , int defaultControllerPort , final boolean connect , final String username , final char [ ] password ) { } private static void processFile ( File file , String defaultControllerHost , int defaultControllerPort , final boolean connect , final String username , final char [ ] password ) { } protected static void processLine ( final CommandLineMain . CommandContextImpl cmdCtx , String line ) { } protected static ConsoleReader initConsoleReader ( ) { } private static boolean isOperation ( String line ) { } static class CommandContextImpl implements CommandContext { private ConsoleReader console ; private final CommandHistory history ; private boolean terminate ; private String cmdLine ; private DefaultCallbackHandler parsedCmd = new DefaultCallbackHandler ( ) ; private boolean domainMode ; private ModelControllerClient client ; private String defaultControllerHost = "localhost" ; private int defaultControllerPort = 9999 ; private String controllerHost ; private int controllerPort = - 1 ; private String username ; private char [ ] password ; private Map < String , Object > map = new HashMap < String , Object > ( ) ; private final OperationRequestAddress prefix = new DefaultOperationRequestAddress ( ) ; private final PrefixFormatter prefixFormatter = new DefaultPrefixFormatter ( ) ; private final OperationCandidatesProvider operationCandidatesProvider ; private final OperationRequestHandler operationHandler ; private BatchManager batchManager = new DefaultBatchManager ( ) ; private final CommandCompleter cmdCompleter ; private BufferedWriter outputTarget ; private CommandContextImpl ( ) { } private CommandContextImpl ( ConsoleReader console ) { } @ Override public String getArgumentsString ( ) { } @ Override public void terminateSession ( ) { } @ Override public void printLine ( String message ) { } private String readLine ( String prompt , boolean password , boolean disableHistory ) throws IOException { if ( ( console ) == null ) { console = CommandLineMain . initConsoleReader ( ) ; } boolean useHistory = console . getUseHistory ( ) ; if ( useHistory && disableHistory ) { console . setUseHistory ( false ) ; } try { if ( password ) { <START_BUG> return console . readLine ( prompt , '*' ) ; <END_BUG> } else { return console . readLine ( prompt ) ; } } finally { if ( disableHistory && useHistory ) { console . setUseHistory ( true ) ; } } } @ Override public void printColumns ( Collection < String > col ) { } @ Override public void set ( String key , Object value ) { } @ Override public Object get ( String key ) { } @ Override public ModelControllerClient getModelControllerClient ( ) { } @ Override public CommandLineParser getCommandLineParser ( ) { } @ Override public OperationRequestAddress getPrefix ( ) { } @ Override public PrefixFormatter getPrefixFormatter ( ) { } @ Override public OperationCandidatesProvider getOperationCandidatesProvider ( ) { } private void connectController ( String host , int port , boolean loggingEnabled ) { } @ Override public void connectController ( String host , int port ) { } private void disconnectController ( boolean loggingEnabled ) { } @ 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 ( ) { } private final DefaultCallbackHandler tmpBatched = new DefaultCallbackHandler ( ) ; @ Override public BatchedCommand toBatchedCommand ( String line ) throws CommandFormatException { } @ Override public CommandLineCompleter getDefaultCommandCompleter ( ) { } @ Override public ParsedCommandLine getParsedCommandLine ( ) { } @ Override public boolean isDomainMode ( ) { } protected void setOutputTarget ( String filePath ) { } private class AuthenticationCallbackHandler implements CallbackHandler { private String realm = null ; private boolean realmShown = false ; private String username ; private char [ ] password ; private AuthenticationCallbackHandler ( ) { } public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { } private void showRealm ( ) { } } private class HistoryImpl implements CommandHistory { @ SuppressWarnings ( "unchecked" ) @ Override public List < String > asList ( ) { } @ Override public boolean isUseHistory ( ) { } @ Override public void setUseHistory ( boolean useHistory ) { } @ Override public void clear ( ) { } } } }

Fix:
return console . readLine ( prompt , ( ( char ) ( 0 ) ) ) ;