You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2006/12/07 16:46:22 UTC

[jira] Updated: (HARMONY-2407) [classlib][luni] java.io.BufferedInputStream(null,9) returns another internal buffer that RI

     [ http://issues.apache.org/jira/browse/HARMONY-2407?page=all ]

Alexei Zakharov updated HARMONY-2407:
-------------------------------------

    Summary: [classlib][luni] java.io.BufferedInputStream(null,9) returns another internal buffer that RI  (was: java.io.BufferedInputStream(null,9) returns another internal buffer that RI)

adding [classlib][luni] prefix to summary

> [classlib][luni] java.io.BufferedInputStream(null,9) returns another internal buffer that RI
> --------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2407
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2407
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Artem Aliev
>            Priority: Minor
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira