Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 31229 invoked from network); 16 Apr 2009 10:45:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Apr 2009 10:45:38 -0000 Received: (qmail 27540 invoked by uid 500); 16 Apr 2009 10:45:38 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 27493 invoked by uid 500); 16 Apr 2009 10:45: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 27482 invoked by uid 99); 16 Apr 2009 10:45:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2009 10:45: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, 16 Apr 2009 10:45:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D4811234C004 for ; Thu, 16 Apr 2009 03:45:14 -0700 (PDT) Message-ID: <39759918.1239878714855.JavaMail.jira@brutus> Date: Thu, 16 Apr 2009 03:45:14 -0700 (PDT) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-6110) [classlib] [luni] BufferedReader.reset() does not throw IOException after reading the entire stream, differs from RI In-Reply-To: <1380949431.1236219476401.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-6110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim Ellison reassigned HARMONY-6110: ------------------------------------ Assignee: Tim Ellison > [classlib] [luni] BufferedReader.reset() does not throw IOException after reading the entire stream, differs from RI > -------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-6110 > URL: https://issues.apache.org/jira/browse/HARMONY-6110 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M8 > Reporter: Kevin Zhou > Assignee: Tim Ellison > Fix For: 5.0M9 > > Attachments: HARMONY-6110.diff > > Original Estimate: 48h > Remaining Estimate: 48h > > The given test case [1] is composed with 2 test scenarios. > Scenario 1: When a buffered reader doesn't read the entire stream, both RI and HARMONY can successfully reset the stream. > Scenario 2: When a buffered reader has read the entire stream, HARMONY can reset the stream while RI will throw IOException [2]. > [1] Test Case: > public class BufferedReaderTest extends TestCase { > BufferedReader bufferedReader; > int[] expected = new int[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', -1 }; > public void test_reset_sceniro1() throws IOException { > bufferedReader.mark(10); > for (int i = 0; i < 11; i++) { assertEquals(expected[i], bufferedReader.read()); } > try { bufferedReader.reset(); fail("should throw IOException"); } catch (IOException e) { // Expected } > for (int i = 0; i < 11; i++) { assertEquals(-1, bufferedReader.read()); } > } > public void test_reset_scenario2() throws IOException { > bufferedReader.mark(10); > for (int i = 0; i < 10; i++) { assertEquals(expected[i], bufferedReader.read()); } } > bufferedReader.reset(); > for (int i = 0; i < 11; i++) { assertEquals(expected[i], bufferedReader.read()); } > } > protected void setUp() { bufferedReader = new BufferedReader(new Support_StringReader( "1234567890")); } > protected void tearDown() { bufferedReader = null; } > } > [2] Stack Trace: > java.io.IOException: Mark invalid > at java.io.BufferedReader.reset(BufferedReader.java:485) > at BufferedReaderTest.test_reset_sceniro1(BufferedReader1Test.java:17) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.