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

[jira] Closed: (HARMONY-667) [classlib][io]java.io.BufferedInputStream.skip(int n) unexpected NPE

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

Paulex Yang closed HARMONY-667.
-------------------------------


Verified by Vladimir.

> [classlib][io]java.io.BufferedInputStream.skip(int n) unexpected NPE
> --------------------------------------------------------------------
>
>                 Key: HARMONY-667
>                 URL: http://issues.apache.org/jira/browse/HARMONY-667
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>         Assigned To: Paulex Yang
>         Attachments: BufferedInputStream.patch, BufferedInputStreamTest.patch
>
>
> The java.io.BufferedInputStream.skip(int n) throws unexpected NPE if object was constructed as BufferedInputStream(null, ...) while RI throws IOException. The same behavior observed for java.io.BufferedInputStream.close()  too.
> =================== test.java ============================
> import java.io.*;
> public class test {
>    public static void main (String[] args) { 
>             BufferedInputStream buf = new BufferedInputStream(null,5);
>             try {
>                 buf.skip(1);
>             } catch (Exception e) {
>                 e.printStackTrace();
>             }                         
>             try {
>                 buf.close();
>             } catch (Exception e) {
>                 e.printStackTrace();
>             }                         
>    }   
> }
> ======================================================
> Output:
> C:\tmp\tmp17>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM  (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> java.io.IOException: Stream closed
>         at java.io.BufferedInputStream.ensureOpen()V(BufferedInputStream.java:120)
>         at java.io.BufferedInputStream.skip(J)J(BufferedInputStream.java:296)
>         at test.main([Ljava.lang.String;)V(test.java:7)
> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java.lang.NullPointerException
>         at java.io.BufferedInputStream.skip(BufferedInputStream.java:339)
>         at test.main(test.java:7)
> java.lang.NullPointerException
>         at java.io.FilterInputStream.close(FilterInputStream.java:68)
>         at java.io.BufferedInputStream.close(BufferedInputStream.java:112)
>         at test.main(test.java:12)
> C:\tmp\tmp17>

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