Scanner.hasNextLine() throws unexpected NPE
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcj-4.4 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
A simple code that use java.util.Scanner over a constant String throws a Null Pointer Exception from "hasNextLine()" after the last line has been produced. The same code works flawlessly (as expected) with Sun JVM.
> /usr/lib/
Content-Type: audio/mpeg
icy-br:128
icy-metaint:8192
Exception in thread "main" java.lang.
at java.util.
at java.util.
at java.util.
at java.util.
at java.util.
at bugreport.
If that's of any matter (given this machine is an LTS-to-LTS upgrade),
73a62bb13b3bd32
See minimal code reproducing the bug below.
Code compiled with javac 1.6.0_17, if that's of any matter.
generated (and buggy) .class file attached
e7467076ce3d188 c2a18e72818647f f2 bugreport.class
If "compile- with-1. 6.x, run with 1.5.x" is the reason of the failure, I'd have expected the JVM to raise a warning about a java version mismatch at load-time, rather than throwing arbitrary NPE from the bowels of the lib.
HTH, may the Source be with you.