RomanHargrave / lanterna

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

Get an infinite loop on java.lang.NullPointerException #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I started creating an example program and wanted to show  the layout, really 
simple. It just adds some empty panels to a window and then does a 
showWindow(). 

The system response is an infinite loop printing 
"java.lang.NullPointerException". 

Somewhere at the start of the exception it prints something looking like useful 
information, but then scrolls by too fast and in such an amount that the 
information leaves the terminals buffer.

I suspect the error in my example program may be a lack of size information. 
Even if that is so, I should get just an exception. Not an infinite loop of 
exceptions. 

Original issue reported on code.google.com by abonnem...@gmail.com on 20 May 2014 at 5:37

Attachments:

GoogleCodeExporter commented 9 years ago
I may have found the problem, but need confirmation. 

In GUIScreen.java on lines 223 - 263 (approx.) is a while(true) loop. At the 
end of the while loop is a catch(Throwable e) that does a e.printStackTrace and 
then continues with the loop resulting in another e.printStackTrace, and so on. 
It never stops. 

Probably after line 256 should be a break? 

Guus.

Original comment by abonnem...@gmail.com on 20 May 2014 at 6:38

GoogleCodeExporter commented 9 years ago
By the way, The error in the program was including panels that I did not create 
(_figurePanel and _gameMessagePanel). Still, the message I would expect should 
include a reference to the offending panels.

If I find how to improve this, I will let you know.

In the meantime updating GUIScreen.java with a break after the print stack 
would be nice.

Thanks, Guus.

Original comment by abonnem...@gmail.com on 20 May 2014 at 9:08

GoogleCodeExporter commented 9 years ago
Version of the software is 2.1.7 (forgot to mention).

Original comment by abonnem...@gmail.com on 20 May 2014 at 12:30

GoogleCodeExporter commented 9 years ago
This is a tricky one, trying to figure out what to do if exceptions occur in 
the GUI loop. I've changed it now to only wrap custom actions in a try-block, 
which should hopefully make Lanterna bugs propagate out from the loop.  

Original comment by mab...@gmail.com on 8 Jun 2014 at 9:16