db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
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 GMT
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;



Mime
View raw message