Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 18575 invoked from network); 6 Apr 2006 16:31:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 16:31:27 -0000 Received: (qmail 34708 invoked by uid 500); 6 Apr 2006 16:31:24 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 34671 invoked by uid 500); 6 Apr 2006 16:31:23 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 34660 invoked by uid 99); 6 Apr 2006 16:31:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 09:31:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 09:31:23 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 0A3FCD49FE for ; Thu, 6 Apr 2006 17:31:02 +0100 (BST) Message-ID: <1766464524.1144341062013.JavaMail.jira@ajax> Date: Thu, 6 Apr 2006 17:31:02 +0100 (BST) From: "George Harley (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-311) java.io.FileInputStream.skip(long n) returns incorrect value In-Reply-To: <407186192.1144234966386.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-311?page=comments#action_12373504 ] George Harley commented on HARMONY-311: --------------------------------------- Hi Nikolay, I agree with you that the behaviour shared by Harmony and the RI does seem to be at odds with the specification. In cases like this the community consensus was that we match the RI behaviour but log that we are doing so in the JIRA [1]. With this in mind, are you happy for this issue to be closed ? Best regards, George [1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200602.mbox/%3c44041D40.9070804@gmail.com%3e > java.io.FileInputStream.skip(long n) returns incorrect value > ------------------------------------------------------------ > > Key: HARMONY-311 > URL: http://issues.apache.org/jira/browse/HARMONY-311 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: nikolay > Assignee: George Harley > Attachments: patch.txt > > According to J2SE 1.4.2, 1.5.0 specifications for java.io.FileInputStream.skip(long n) > the method should return the actual number of bytes skipped. > The test listed below shows that the method returns incorrect value if parameter > number of bytes in file. > import java.io.FileInputStream; > import java.io.IOException; > import java.io.File; > public class Test{ > public static void main(String[] args) { > FileInputStream toRet = null; > try { > File file = new File("FileInStream.tmp"); > file.createNewFile(); > toRet = new FileInputStream(file); > System.out.println("skipped = " + toRet.skip(100)); > } catch (IOException e) { > e.printStackTrace(); > } > } > } > Output RI: > 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) > skipped = 0 > Output harmony: > java -showversion Test > java version 1.4.2 (subset) > (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. > skipped = 100 -- 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