jwill / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Exception triggered when calling TextInputDialog constructor #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I tried using the static methods to build a TextInputDialog, an 
IllegalArgumentException was triggered with this message: TerminalSize.columns 
cannot be less than 0!

I got around the issue by commenting out line #49
okCancelPanel.addComponent(new EmptySpace(space, 1));

I guess the dialog does not look the way it's supposed to when this line is 
commented out, but I couldn't see what it was supposed to be :)

Original issue reported on code.google.com by gabriel....@lepape.com on 6 Dec 2012 at 11:31

GoogleCodeExporter commented 9 years ago
There's probably a regression in there somewhere, but I'm having problems 
reproducing it. I've just committed a test case to the default branch, could 
you try it out? 
https://code.google.com/p/lanterna/source/browse/src/test/java/com/googlecode/la
nterna/test/issue/Issue53.java

If you have any example code that fails, please do share. Also, which version 
are you using?

Original comment by mab...@gmail.com on 9 Dec 2012 at 1:04

GoogleCodeExporter commented 9 years ago
I can't reproduce the issue with your test case with the latest integration 
build published on Maven Central either.

I recently re-factored my code, and it doesn't throw the exception anymore, so 
I guess you can mark this issue as invalid.

If I face it again, I'll definitely try to find the reason. I've just started 
using your library and I'm planning on reading the entire source code, as it 
seems to be a great source of inspiration for a great project architecture.

Original comment by gabriel....@lepape.com on 10 Dec 2012 at 8:32

GoogleCodeExporter commented 9 years ago
Ha. Found how to trigger this bug. Seems that if the description is smaller 
than the title, I get "TerminalSize.columns cannot be less than 0!"

TextInputDialog.showTextInputBox(owner, "Testing issue 53", "Testing issue 5", 
""); will throw an exception but TextInputDialog.showTextInputBox(owner, 
"Testing issue 53", "Testing issue 53!", ""); won't

Original comment by gabriel....@lepape.com on 10 Dec 2012 at 8:37

GoogleCodeExporter commented 9 years ago
Lovely, thanks! I'll get this fixed right away.

Original comment by mab...@gmail.com on 16 Dec 2012 at 1:12

GoogleCodeExporter commented 9 years ago
Fixed on 2.0, 2.1 and default branch, I'll push new snapshots to Maven

Original comment by mab...@gmail.com on 16 Dec 2012 at 1:51