System.console().readLine() requires newLine sign before it actually reads something
<p>I have a problem with reading user input using the Console class.</p>

<p>The <code>readLine</code> method reads every typed input until new line is typed, and after that it actually reads the input it returns later (after typing new line for the second time). </p>

<p>I wonder if this has something to do with input buffering.
I tried to write a new line sign into the Console object:</p>

<pre><code>cons.writer ().println (System.getProperty ("line.separator"));
</code></pre>

<p>before attempting to read, but it didn't help.</p>

<p>I use the Console class because of its <code>readPassword</code> method (which I have the same problem with).</p>

<pre><code>Console cons = System.console();
username = String(cons.readLine(format, message));
password = String(cons.readPassword(format, message));
</code></pre>

<p>I also must add that this code runs in a loop until username and password are ok. </p>

<p>In every iteration except the first one, this code works fine.</p>
