Menu

#51 ConsoleReader.readLine("prompt") resets prompt permanently

open
nobody
None
5
2009-05-14
2009-05-14
No

When calling ConsoleReader.readLine("prompt>") the default prompt will permanently be set to "prompt>", whereas I'd expect otherwise. It somehow defeats the purpose of having a default prompt if it is overridden by that method, doesn't it?

The culprit is ConsoleReader.readLine(String, Character) which sets this.prompt to the new prompt if one is given. A simple fix would be to change the if statement around line 477 not to set this.prompt to the prompt, but rather the given prompt to this.prompt if it's null.

Discussion


Log in to post a comment.