Menu

#31 ConsoleReader.readLine can throw HeadlessException

closed-fixed
nobody
5
2010-05-13
2007-07-13
No

At the beginning of ConsoleReader.paste(), it calls
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();

which will throw a HeadlessException if GraphicsEnvironment.isHeadless() returns true.
This exception will occur if a user does a ctrl+v (paste) during a ConsoleReader.readLine() in a DOS prompt.
I'm catching the exception and returning false inside of the paste function so that I won't have to handle a RuntimeException in my code and the prompt will still work.

The problem exists in 0.9.91.

Discussion

  • Jason Dillon

    Jason Dillon - 2008-05-14

    Logged In: YES
    user_id=15045
    Originator: NO

    This appears to be fixed already....

     
  • Charles Oliver Nutter

    Reported as fixed.

     
  • Charles Oliver Nutter

    • status: open --> closed-fixed
     

Log in to post a comment.

Auth0 Logo