harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessewil...@apache.org
Subject svn commit: r835954 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/io/BufferedReader.java test/api/common/org/apache/harmony/luni/tests/java/io/BufferedReaderTest.java
Date Fri, 13 Nov 2009 19:07:36 GMT
Author: jessewilson
Date: Fri Nov 13 19:07:36 2009
New Revision: 835954

URL: http://svn.apache.org/viewvc?rev=835954&view=rev
Log:
Fixing BufferedReader test regressions caused by r835212.

For the curious, some background on the tests that were broken:
- BufferedReaderTest.test_read_$CII_Exception: this is a straight up regression in exception
priorities. I've submitted the fix.
- BufferedReaderTest.test_reset_IOException: this test is bogus. It expects reset() to fail
after the end of stream has been reached, which is not specified behaviour. I've fixed the
test.


Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/BufferedReaderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java?rev=835954&r1=835953&r2=835954&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedReader.java
Fri Nov 13 19:07:36 2009
@@ -278,11 +278,8 @@
             if (isClosed()) {
                 throw new IOException(Msg.getString("K005b")); //$NON-NLS-1$
             }
-            if (buffer == null) {
-                throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
-            }
-            if ((offset | length) < 0 || offset > buffer.length - length) {
-                throw new IndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
+            if (offset < 0 || offset > buffer.length - length || length < 0) {
+                throw new IndexOutOfBoundsException();
             }
             int outstanding = length;
             while (outstanding > 0) {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/BufferedReaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/BufferedReaderTest.java?rev=835954&r1=835953&r2=835954&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/BufferedReaderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/BufferedReaderTest.java
Fri Nov 13 19:07:36 2009
@@ -528,8 +528,8 @@
     public void test_reset_IOException() throws Exception {
         int[] expected = new int[] { '1', '2', '3', '4', '5', '6', '7', '8',
                 '9', '0', -1 };
-        br = new BufferedReader(new Support_StringReader("1234567890"));
-        br.mark(10);
+        br = new BufferedReader(new Support_StringReader("1234567890"), 9);
+        br.mark(9);
         for (int i = 0; i < 11; i++) {
             assertEquals(expected[i], br.read());
         }



Mime
View raw message