sdk icon indicating copy to clipboard operation
sdk copied to clipboard

TestHalfFloat crashed with NoSuchElementException

Open stephengold opened this issue 6 years ago • 6 comments

With current master branch:

Enter float to convert or 'x' to exit: 
Exception in thread "main" java.util.NoSuchElementException: No line found
	at java.util.Scanner.nextLine(Scanner.java:1540)
	at jme3test.math.TestHalfFloat.main(TestHalfFloat.java:43)

stephengold avatar Mar 18 '19 19:03 stephengold

It works for me... how are you running it?

riccardobl avatar Mar 18 '19 19:03 riccardobl

From the IDE. I realize it's a console app...

stephengold avatar Mar 18 '19 19:03 stephengold

Probably the IDE environment simply doesn't have a valid System.in. I opened this issue to remind me to look into it later.

stephengold avatar Mar 19 '19 05:03 stephengold

I created a JmeTests project in the v3.2.2-stable-sdk1 IDE and was able to run the test from the TestChooser. It was a little tricky because in order to type to System.in one must bring the IDE window to the front. Since the IDE is typically maximized, this hides the chooser and makes it easy to misplace.

Using that same source code (JmeTests project created using the v3.2.2-stable-sdk1 IDE) I was also able to run TestHalfFloat directly in the IDE, without going through TestChooser.

But when I check out Engine source code from GitHub (either master branch or v3.2 branch), TestHalfFloat crashes. It crashes whether run via TestChooser or directly, though with slightly different stack trace. The source code (for TestHalfFloat at GitHub, either branch) is identical to that provided by the IDE.

Surprisingly, when TestHalfFloat is debugged in the IDE, no crash occurs, even using a source tree from GitHub.

The issue remains mysterious, but I'm convinced it's related to the runtime environment provided by the IDE, not TestHalfFloat.

stephengold avatar Apr 12 '19 20:04 stephengold

@MeFisto94 can you offer any insight into why System.in might work when the app is debugged (using Ctrl-Shift-F5) but not when it's run (using Shift-F6) ?

stephengold avatar Apr 13 '19 02:04 stephengold

Probably not much what we can do there when Netbeans Input Wrapper is odd, maybe Netbeans 11 fixes things

MeFisto94 avatar Feb 16 '20 20:02 MeFisto94