harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-2407) [classlib][luni] java.io.BufferedInputStream(null,9) returns another internal buffer that RI
Date Tue, 24 Apr 2007 15:45:16 GMT

     [ 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.


Mime
View raw message