Name: rmT116609 Date: 04/07/2004
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
A DESCRIPTION OF THE PROBLEM :
BufferedReader readLine method does not use line separator that is set in system properties. You are allowed to change line separator but it has not effect to the line parsing. Javadoc says:
* Read a line of text. A line is considered to be terminated by any one
* of a line feed ('\n'), a carriage return ('\r'), or a carriage return
* followed immediately by a linefeed.
And parsing code of readLine is below:
for (i = nextChar; i < nChars; i++) {
c = cb[i];
if ((c == '\n') || (c == '\r')) {
eol = true;
break charLoop;
}
}
Why are line separators hard coded? This sounds like a bug. readLine should use
line separator that is set to the system property "line.separator".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Check the readLine code from the BufferedReader.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Check the code in readLine of BufferedReader
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
line parsing is changed to use line separator set in system properties (line.separator).
(Incident Review ID: 225767)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
A DESCRIPTION OF THE PROBLEM :
BufferedReader readLine method does not use line separator that is set in system properties. You are allowed to change line separator but it has not effect to the line parsing. Javadoc says:
* Read a line of text. A line is considered to be terminated by any one
* of a line feed ('\n'), a carriage return ('\r'), or a carriage return
* followed immediately by a linefeed.
And parsing code of readLine is below:
for (i = nextChar; i < nChars; i++) {
c = cb[i];
if ((c == '\n') || (c == '\r')) {
eol = true;
break charLoop;
}
}
Why are line separators hard coded? This sounds like a bug. readLine should use
line separator that is set to the system property "line.separator".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Check the readLine code from the BufferedReader.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Check the code in readLine of BufferedReader
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
line parsing is changed to use line separator set in system properties (line.separator).
(Incident Review ID: 225767)
======================================================================