harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-6216) problem with reading zero-length file
Date Thu, 05 Nov 2009 07:10:32 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-6216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Regis Xu reassigned HARMONY-6216:
---------------------------------

    Assignee:     (was: Regis Xu)

> 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
>         Attachments: HARMONY-6216.diff, HARMONY-6216.simple.diff
>
>
> 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