Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 60686 invoked from network); 27 Jun 2008 14:37:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jun 2008 14:37:25 -0000 Received: (qmail 46584 invoked by uid 500); 27 Jun 2008 14:37:26 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 46556 invoked by uid 500); 27 Jun 2008 14:37:26 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 46546 invoked by uid 99); 27 Jun 2008 14:37:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2008 07:37:26 -0700 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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2008 14:36:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5FDFF2388A16; Fri, 27 Jun 2008 07:37:04 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r672284 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java Date: Fri, 27 Jun 2008 14:37:04 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080627143704.5FDFF2388A16@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kristwaa Date: Fri Jun 27 07:37:03 2008 New Revision: 672284 URL: http://svn.apache.org/viewvc?rev=672284&view=rev Log: DERBY-3735: Incorrect position calculation in PositionedStoreStream with read(byte[],...). Fixed bug introduced by earlier commit. 0 is a valid return value for 'read()', and the position must be incremented. Also changed the condition for 'read(byte[],int,int)' for consistency. Patch file: derby-3735-2a.diff Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java?rev=672284&r1=672283&r2=672284&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java Fri Jun 27 07:37:03 2008 @@ -110,7 +110,7 @@ public int read(byte[] b, int off, int len) throws IOException { int ret = this.stream.read(b, off, len); - if (ret > 0) { + if (ret > -1) { this.pos += ret; } return ret; @@ -125,7 +125,7 @@ public int read() throws IOException { int ret = this.stream.read(); - if (ret > 0) { + if (ret > -1) { this.pos++; } return ret;