Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6668802
Votes 0
Synopsis javac handles diagnostics for last line badly, if line not terminated by newline
Category java:compiler
Reported Against
Release Fixed 7(b25)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 28-FEB-2008
Description
If an error occurs in the last line of a file that is not terminated with newline, javac adds garbage characters to the end of the line when displaying the line of code in a diagnostic.
Posted Date : 2008-02-28 02:28:13.0
Work Around
N/A
Evaluation
In Log.java, when getting the line from a CharBuffer, javac gets the backing array of characters, but omits to note the buffer may be bigger than the actual size of the file. If then uses the size of the array when checking for the end of line position, instead of the size of the file.   As a result, the line includes garbage characters which get displayed.
Posted Date : 2008-02-28 02:28:13.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang