harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r966093 - in /harmony/enhanced/java/trunk/classlib/modules/luni/src: main/java/java/io/PipedOutputStream.java test/api/common/org/apache/harmony/luni/tests/java/io/PipedOutputStreamTest.java
Date Wed, 21 Jul 2010 05:27:22 GMT
Author: regisxu
Date: Wed Jul 21 05:27:22 2010
New Revision: 966093

URL: http://svn.apache.org/viewvc?rev=966093&view=rev
Log:
Apply patch for HARMONY-6576: [classlib][luni] PipedOutputStream.write throws PipeNotConnected
Exception

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

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/PipedOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/PipedOutputStream.java?rev=966093&r1=966092&r2=966093&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/PipedOutputStream.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/PipedOutputStream.java
Wed Jul 21 05:27:22 2010
@@ -145,10 +145,6 @@ public class PipedOutputStream extends O
      */
     @Override
     public void write(byte buffer[], int offset, int count) throws IOException {
-        if (dest == null) {
-            // luni.D1=Pipe Not Connected
-            throw new IOException(Messages.getString("luni.D1")); //$NON-NLS-1$
-        }
         super.write(buffer, offset, count);
     }
 

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/PipedOutputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/PipedOutputStreamTest.java?rev=966093&r1=966092&r2=966093&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/PipedOutputStreamTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/PipedOutputStreamTest.java
Wed Jul 21 05:27:22 2010
@@ -183,6 +183,30 @@ public class PipedOutputStreamTest exten
         } catch (NullPointerException e) {
             // expected
         }
+
+        pis = new PipedInputStream();
+        pos = new PipedOutputStream(pis);
+        pos.close();
+        pos.write(new byte[0], 0, 0);
+
+        try {
+            pis = new PipedInputStream();
+            pos = new PipedOutputStream(pis);
+            pos.write(new byte[0], -1, 0);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException t) {
+            //expected
+        }
+
+        try {
+            pis = new PipedInputStream();
+            pos = new PipedOutputStream(pis);
+            pos.write(null, -10, 0);
+            fail("should throw NullPointerException.");
+        } catch (NullPointerException e) {
+            // expected
+        }
+
     }
 
     /**



Mime
View raw message