sdk
sdk copied to clipboard
TestHalfFloat crashed with NoSuchElementException
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)
It works for me... how are you running it?
From the IDE. I realize it's a console app...
Probably the IDE environment simply doesn't have a valid System.in. I opened this issue to remind me to look into it later.
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.
@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) ?
Probably not much what we can do there when Netbeans Input Wrapper is odd, maybe Netbeans 11 fixes things