db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r543440 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/streams/LoopingAlphabetStream.java
Date Fri, 01 Jun 2007 09:16:56 GMT
Author: kristwaa
Date: Fri Jun  1 02:16:55 2007
New Revision: 543440

URL: http://svn.apache.org/viewvc?view=rev&rev=543440
Log:
Fixed overflow bug in LoopingAlphabetStream, where a negative number ended up being used in
System.arraycopy.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/streams/LoopingAlphabetStream.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/streams/LoopingAlphabetStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/streams/LoopingAlphabetStream.java?view=diff&rev=543440&r1=543439&r2=543440
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/streams/LoopingAlphabetStream.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/streams/LoopingAlphabetStream.java
Fri Jun  1 02:16:55 2007
@@ -103,7 +103,7 @@
             return -1;
         }
         // We can only read as many bytes as there are in the stream.
-        int nonBlankLength = Math.min((int)remainingNonBlanks, length);
+        int nonBlankLength = (int)Math.min(remainingNonBlanks, (long)length);
         fillBuffer(nonBlankLength);
         int read = 0;
         // Find position of next letter in the buffer.



Mime
View raw message