You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ruth Cao (JIRA)" <ji...@apache.org> on 2007/02/26 11:15:05 UTC

[jira] Created: (HARMONY-3238) [classlib][luni] InputStreamReader allocates fixed space internal buffer

[classlib][luni] InputStreamReader allocates fixed space internal buffer
------------------------------------------------------------------------

                 Key: HARMONY-3238
                 URL: https://issues.apache.org/jira/browse/HARMONY-3238
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ruth Cao


The following test case[1] fails on Harmony while passes on RI. It is due to java.io.InputStreamReader allocates fixed space. Error occurs when the dest buffer is larger than the internal one.

Besides, after the bug is fixed, tests.api.java.io.OutputStreamWriterTest can be taken out of the exclue list. I'll provide a patch soon.

[1] public void testHandleEarlyEOFChar_2() throws IOException {
    int capacity = 65536;
    byte[] bytes = new byte[capacity];
    byte[] bs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
    for (int i = 0; i < bytes.length; i++) {
        bytes[i] = bs[i / 8192];
    }
    String inputStr = new String(bytes);
    int len = inputStr.length();
    File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$
    FileWriter writer = new FileWriter(f);
    writer.write(inputStr);
    writer.close();
    long flen = f.length();

    FileReader reader = new FileReader(f);
    char[] outChars = new char[capacity];
    int outCount = reader.read(outChars);
    String outStr = new String(outChars, 0, outCount);

    f.deleteOnExit();
   assertEquals(len, flen);
   assertEquals(inputStr, outStr);
}

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


[jira] Closed: (HARMONY-3238) [classlib][luni] InputStreamReader allocates fixed space internal buffer

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Liang closed HARMONY-3238.
----------------------------------


Verified by Ruth.

> [classlib][luni] InputStreamReader allocates fixed space internal buffer
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-3238
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3238
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ruth Cao
>         Assigned To: Richard Liang
>         Attachments: Harmony-3238.diff
>
>
> The following test case[1] fails on Harmony while passes on RI. It is due to java.io.InputStreamReader allocates fixed space. Error occurs when the dest buffer is larger than the internal one.
> Besides, after the bug is fixed, tests.api.java.io.OutputStreamWriterTest can be taken out of the exclue list. I'll provide a patch soon.
> [1] public void testHandleEarlyEOFChar_2() throws IOException {
>     int capacity = 65536;
>     byte[] bytes = new byte[capacity];
>     byte[] bs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
>     for (int i = 0; i < bytes.length; i++) {
>         bytes[i] = bs[i / 8192];
>     }
>     String inputStr = new String(bytes);
>     int len = inputStr.length();
>     File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$
>     FileWriter writer = new FileWriter(f);
>     writer.write(inputStr);
>     writer.close();
>     long flen = f.length();
>     FileReader reader = new FileReader(f);
>     char[] outChars = new char[capacity];
>     int outCount = reader.read(outChars);
>     String outStr = new String(outChars, 0, outCount);
>     f.deleteOnExit();
>    assertEquals(len, flen);
>    assertEquals(inputStr, outStr);
> }

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


[jira] Commented: (HARMONY-3238) [classlib][luni] InputStreamReader allocates fixed space internal buffer

Posted by "Ruth Cao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478234 ] 

Ruth Cao commented on HARMONY-3238:
-----------------------------------

Hi Richard,

The fix looks fine. Thank you very much for the commit.

Ruth

> [classlib][luni] InputStreamReader allocates fixed space internal buffer
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-3238
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3238
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ruth Cao
>         Assigned To: Richard Liang
>         Attachments: Harmony-3238.diff
>
>
> The following test case[1] fails on Harmony while passes on RI. It is due to java.io.InputStreamReader allocates fixed space. Error occurs when the dest buffer is larger than the internal one.
> Besides, after the bug is fixed, tests.api.java.io.OutputStreamWriterTest can be taken out of the exclue list. I'll provide a patch soon.
> [1] public void testHandleEarlyEOFChar_2() throws IOException {
>     int capacity = 65536;
>     byte[] bytes = new byte[capacity];
>     byte[] bs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
>     for (int i = 0; i < bytes.length; i++) {
>         bytes[i] = bs[i / 8192];
>     }
>     String inputStr = new String(bytes);
>     int len = inputStr.length();
>     File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$
>     FileWriter writer = new FileWriter(f);
>     writer.write(inputStr);
>     writer.close();
>     long flen = f.length();
>     FileReader reader = new FileReader(f);
>     char[] outChars = new char[capacity];
>     int outCount = reader.read(outChars);
>     String outStr = new String(outChars, 0, outCount);
>     f.deleteOnExit();
>    assertEquals(len, flen);
>    assertEquals(inputStr, outStr);
> }

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


[jira] Updated: (HARMONY-3238) [classlib][luni] InputStreamReader allocates fixed space internal buffer

Posted by "Ruth Cao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruth Cao updated HARMONY-3238:
------------------------------

    Attachment: Harmony-3238.diff

May somebody pls try this?

> [classlib][luni] InputStreamReader allocates fixed space internal buffer
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-3238
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3238
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ruth Cao
>         Attachments: Harmony-3238.diff
>
>
> The following test case[1] fails on Harmony while passes on RI. It is due to java.io.InputStreamReader allocates fixed space. Error occurs when the dest buffer is larger than the internal one.
> Besides, after the bug is fixed, tests.api.java.io.OutputStreamWriterTest can be taken out of the exclue list. I'll provide a patch soon.
> [1] public void testHandleEarlyEOFChar_2() throws IOException {
>     int capacity = 65536;
>     byte[] bytes = new byte[capacity];
>     byte[] bs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
>     for (int i = 0; i < bytes.length; i++) {
>         bytes[i] = bs[i / 8192];
>     }
>     String inputStr = new String(bytes);
>     int len = inputStr.length();
>     File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$
>     FileWriter writer = new FileWriter(f);
>     writer.write(inputStr);
>     writer.close();
>     long flen = f.length();
>     FileReader reader = new FileReader(f);
>     char[] outChars = new char[capacity];
>     int outCount = reader.read(outChars);
>     String outStr = new String(outChars, 0, outCount);
>     f.deleteOnExit();
>    assertEquals(len, flen);
>    assertEquals(inputStr, outStr);
> }

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


[jira] Resolved: (HARMONY-3238) [classlib][luni] InputStreamReader allocates fixed space internal buffer

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Liang resolved HARMONY-3238.
------------------------------------

    Resolution: Fixed

Hello Ruth,

The patch has been applied at revision r514632, thanks a lot for this enhancement. Please verify this issue is fixed as you expected. 

Best regards,
Richard

> [classlib][luni] InputStreamReader allocates fixed space internal buffer
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-3238
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3238
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ruth Cao
>         Assigned To: Richard Liang
>         Attachments: Harmony-3238.diff
>
>
> The following test case[1] fails on Harmony while passes on RI. It is due to java.io.InputStreamReader allocates fixed space. Error occurs when the dest buffer is larger than the internal one.
> Besides, after the bug is fixed, tests.api.java.io.OutputStreamWriterTest can be taken out of the exclue list. I'll provide a patch soon.
> [1] public void testHandleEarlyEOFChar_2() throws IOException {
>     int capacity = 65536;
>     byte[] bytes = new byte[capacity];
>     byte[] bs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
>     for (int i = 0; i < bytes.length; i++) {
>         bytes[i] = bs[i / 8192];
>     }
>     String inputStr = new String(bytes);
>     int len = inputStr.length();
>     File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$
>     FileWriter writer = new FileWriter(f);
>     writer.write(inputStr);
>     writer.close();
>     long flen = f.length();
>     FileReader reader = new FileReader(f);
>     char[] outChars = new char[capacity];
>     int outCount = reader.read(outChars);
>     String outStr = new String(outChars, 0, outCount);
>     f.deleteOnExit();
>    assertEquals(len, flen);
>    assertEquals(inputStr, outStr);
> }

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


[jira] Assigned: (HARMONY-3238) [classlib][luni] InputStreamReader allocates fixed space internal buffer

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Liang reassigned HARMONY-3238:
--------------------------------------

    Assignee: Richard Liang

> [classlib][luni] InputStreamReader allocates fixed space internal buffer
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-3238
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3238
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ruth Cao
>         Assigned To: Richard Liang
>         Attachments: Harmony-3238.diff
>
>
> The following test case[1] fails on Harmony while passes on RI. It is due to java.io.InputStreamReader allocates fixed space. Error occurs when the dest buffer is larger than the internal one.
> Besides, after the bug is fixed, tests.api.java.io.OutputStreamWriterTest can be taken out of the exclue list. I'll provide a patch soon.
> [1] public void testHandleEarlyEOFChar_2() throws IOException {
>     int capacity = 65536;
>     byte[] bytes = new byte[capacity];
>     byte[] bs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
>     for (int i = 0; i < bytes.length; i++) {
>         bytes[i] = bs[i / 8192];
>     }
>     String inputStr = new String(bytes);
>     int len = inputStr.length();
>     File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$
>     FileWriter writer = new FileWriter(f);
>     writer.write(inputStr);
>     writer.close();
>     long flen = f.length();
>     FileReader reader = new FileReader(f);
>     char[] outChars = new char[capacity];
>     int outCount = reader.read(outChars);
>     String outStr = new String(outChars, 0, outCount);
>     f.deleteOnExit();
>    assertEquals(len, flen);
>    assertEquals(inputStr, outStr);
> }

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