harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman S. Bushmanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4294) [classlib][io] LineNumberReader treats \r\n as two lines
Date Thu, 28 Jun 2007 07:54:26 GMT
[classlib][io] LineNumberReader treats \r\n as two lines
--------------------------------------------------------

                 Key: HARMONY-4294
                 URL: https://issues.apache.org/jira/browse/HARMONY-4294
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Roman S. Bushmanov


The API spec says '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. '

At the same time Harmony implementation of LineNumberReader treats the combination \r\n as
two line terminators.

The test listed below prints on Harmony
false
true

The expected output is single line
false

------------------------- Test.java -------------------------------
import java.io.*;

public class Test {

    public static void main(String[] args) throws Exception{
        byte[] buffer = new byte[]{'\r','\n'};
        LineNumberReader reader = new LineNumberReader(new InputStreamReader(new ByteArrayInputStream(buffer)));

        while (reader.ready()){
            System.out.println(null == reader.readLine());
        }
    }
}
----------------------------------------------------------------------

Affected functional test:
functional/org/apache/harmony/test/func/api/java/lang/F_StringTest_04/F_StringTest_04.xml

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message