-
Bug
-
Resolution: Duplicate
-
P2
-
7
If javac is asked to compile this (non-sensical) program
public class PreviousBits {
void testOutOfBounds(final Bar s) {
g(IndexOutOfBoundsException.class,
new F(){void f(){ s.ff();
new F(){void f(){ s.ff();}});
}
}
as of 7-b03, it prints duplicate error messages
"reached end of file while parsing"
and also prints garbage Ctrl-Z and NUL bytes to the screen.
$ jver 7-b03 javac PreviousBits.java
PreviousBits.java:5: ';' expected
new F(){void f(){ s.ff();}});
^
PreviousBits.java:7: reached end of file while parsing
}
^
PreviousBits.java:8: reached end of file while parsing
^Z^@^@^@^@^@
^
3 errors
The 7-b02 behavior is clearly preferable.
$ jver 7-b02 javac PreviousBits.java
PreviousBits.java:5: ';' expected
new F(){void f(){ s.ff();}});
^
PreviousBits.java:7: reached end of file while parsing
}
^
2 errors
The Ctrl-Z and NUL characters may be invisible in your terminal emulator.
If so, try running in an Emacs shell buffer, or use od -x, e.g.
$ for v in 7-b02 7-b03; do echo $v; jver $v javac PreviousBits.java 2>&1 | od -x | grep -w 0000; done
7-b02
7-b03
0000340 1a00 0000 0000 0000 0000 0a5e 0a33 2065
public class PreviousBits {
void testOutOfBounds(final Bar s) {
g(IndexOutOfBoundsException.class,
new F(){void f(){ s.ff();
new F(){void f(){ s.ff();}});
}
}
as of 7-b03, it prints duplicate error messages
"reached end of file while parsing"
and also prints garbage Ctrl-Z and NUL bytes to the screen.
$ jver 7-b03 javac PreviousBits.java
PreviousBits.java:5: ';' expected
new F(){void f(){ s.ff();}});
^
PreviousBits.java:7: reached end of file while parsing
}
^
PreviousBits.java:8: reached end of file while parsing
^Z^@^@^@^@^@
^
3 errors
The 7-b02 behavior is clearly preferable.
$ jver 7-b02 javac PreviousBits.java
PreviousBits.java:5: ';' expected
new F(){void f(){ s.ff();}});
^
PreviousBits.java:7: reached end of file while parsing
}
^
2 errors
The Ctrl-Z and NUL characters may be invisible in your terminal emulator.
If so, try running in an Emacs shell buffer, or use od -x, e.g.
$ for v in 7-b02 7-b03; do echo $v; jver $v javac PreviousBits.java 2>&1 | od -x | grep -w 0000; done
7-b02
7-b03
0000340 1a00 0000 0000 0000 0000 0a5e 0a33 2065
- duplicates
-
JDK-6668802 javac handles diagnostics for last line badly, if line not terminated by newline
-
- Closed
-