harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Cho (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6216) problem with reading zero-length file
Date Fri, 29 May 2009 17:24:45 GMT
problem with reading zero-length file
-------------------------------------

                 Key: HARMONY-6216
                 URL: https://issues.apache.org/jira/browse/HARMONY-6216
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M10
         Environment: RedHat EL 5 x86
            Reporter: Kyle Cho
            Priority: Minor


The following test fails:

----------------------- proc.java starts ------------------
import java.io.*;
class proc {
        public static void main(String args[])
        {
                String s0 = "cpu";
                String s = null;
                String file= "/proc/cpuinfo"; // zero-length special file
                try {
                        BufferedReader br = new BufferedReader(new FileReader(new File(file)));
                        do {
                                if ((s = br.readLine()) == null) {
                                        break;
                                }
                                System.out.println("s: "+s);
                        } while (s.indexOf(s0) == -1);
                } catch (IOException ioe) {
                        ioe.printStackTrace();
                }
                System.out.println("s: "+s);
        }
}
----------------------- proc.java ends -------------------


java.io.IOException
        at org.apache.harmony.luni.platform.OSFileSystem.seek(OSFileSystem.java:110)
        at java.io.FileInputStream.available(FileInputStream.java:149)
        at java.io.InputStreamReader.read(InputStreamReader.java:249)
        at java.io.BufferedReader.fillbuf(BufferedReader.java:107)
        at java.io.BufferedReader.readLine(BufferedReader.java:318)
        at proc.main(proc.java:11)
s: null

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