harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r442419 - in /incubator/harmony/enhanced/classlib/trunk/modules/rmi/src: main/java/java/rmi/server/LogStream.java test/api/java/org/apache/harmony/rmi/server/LogStreamTest.java
Date Tue, 12 Sep 2006 02:27:20 GMT
Author: ndbeyer
Date: Mon Sep 11 19:27:19 2006
New Revision: 442419

URL: http://svn.apache.org/viewvc?view=rev&rev=442419
Log:
Apply patch for HARMONY-1198: LogStream.setOutputStream(null) expected NPE

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/server/LogStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/LogStreamTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/server/LogStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/server/LogStream.java?view=diff&rev=442419&r1=442418&r2=442419
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/server/LogStream.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/server/LogStream.java
Mon Sep 11 19:27:19 2006
@@ -122,6 +122,9 @@
      */
     @Deprecated
     public synchronized void setOutputStream(OutputStream out) {
+        if (out == null) {
+            throw new NullPointerException();
+        }
         this.out = out;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/LogStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/LogStreamTest.java?view=diff&rev=442419&r1=442418&r2=442419
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/LogStreamTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/LogStreamTest.java
Mon Sep 11 19:27:19 2006
@@ -30,4 +30,16 @@
         //regression test for HARMONY-994
         LogStream.log("tst").write(0);
     }
+    
+    public void testSetOutputStreamBad() throws Exception {
+        // Regression test HARMONY-1198
+        try {
+            LogStream ls = LogStream.log("proba");
+            ls.setOutputStream(null);
+            fail("Expected NPE");
+        } catch (NullPointerException e) {
+            // expected
+        }
+    }
+    
 }



Mime
View raw message