You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2007/04/24 17:45:16 UTC
[jira] Closed: (HARMONY-2407) [classlib][luni]
java.io.BufferedInputStream(null,9) returns another internal buffer that RI
[ https://issues.apache.org/jira/browse/HARMONY-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison closed HARMONY-2407.
--------------------------------
No response, assuming ok.
> [classlib][luni] java.io.BufferedInputStream(null,9) returns another internal buffer that RI
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-2407
> URL: https://issues.apache.org/jira/browse/HARMONY-2407
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Artem Aliev
> Assigned To: Tim Ellison
> Priority: Minor
> Attachments: harmony-2407.diff
>
>
> Compatibility issue.
> According to the specification "protected volatile byte[] buf - The internal
> buffer array where the data is stored. When necessary, it may be replaced by
> another array of a different size".
> Harmony returns for BufferedInputStream(InputStream in, int size) buf==null if
> in==null. RI returns non-null buf with length==size.
> Test for reproducing:
> import junit.framework.TestCase;
> import java.io.*;
> public class test extends TestCase {
> public void test1 () {
> try {
> testBufferedInputStream obj=new testBufferedInputStream(null,9);
> assertEquals(9,testBufferedInputStream.buf.length);
> } catch (IOException e) {
> fail("Unexpected IOException");
> }
> }
> }
> class testBufferedInputStream extends BufferedInputStream {
> static byte[] buf;
> testBufferedInputStream(InputStream is, int size) throws IOException {
> super(is, size);
> buf=super.buf;
> }
> }
> Output on Sun 1.5:
> ==================
> .
> Time: 0
> OK (1 test)
> Output on Harmony:
> ==================
> .E
> Time: 0.015
> There was 1 error:
> 1) test1(test)java.lang.NullPointerException
> at test.test1(test.java:8)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.