Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 18642 invoked from network); 18 Jun 2009 20:46:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jun 2009 20:46:27 -0000 Received: (qmail 1108 invoked by uid 500); 18 Jun 2009 20:46:38 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 1089 invoked by uid 500); 18 Jun 2009 20:46:38 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 1080 invoked by uid 99); 18 Jun 2009 20:46:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 20:46:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 20:46:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5E47E234C044 for ; Thu, 18 Jun 2009 13:46:07 -0700 (PDT) Message-ID: <1573117178.1245357967372.JavaMail.jira@brutus> Date: Thu, 18 Jun 2009 13:46:07 -0700 (PDT) From: "Kyle Cho (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6216) problem with reading zero-length file In-Reply-To: <1424570361.1243617885682.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721474#action_12721474 ] Kyle Cho commented on HARMONY-6216: ----------------------------------- found that the patch breaks the following test case. public static void main(String args[]) { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String line = null; try { line = reader.readLine(); } catch (IOException e) { e.printStackTrace(); } System.out.println(line); } > 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 > > > 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.