You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ap...@apache.org on 2006/12/07 15:42:13 UTC

svn commit: r483470 - /harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java

Author: apetrenko
Date: Thu Dec  7 06:42:10 2006
New Revision: 483470

URL: http://svn.apache.org/viewvc?view=rev&rev=483470
Log:
Patch for HARMONY-690 "[classlib][lang]Compatibility: Harmony Runtime.removeShutdownHook(null) does not throw unspecified NPE while RI does." class library version.
Null checks are added to Runtime class stub.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java

Modified: harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java?view=diff&rev=483470&r1=483469&r2=483470
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java Thu Dec  7 06:42:10 2006
@@ -270,6 +270,10 @@
      * @param hook the hook (a Thread) to register
      */
     public void addShutdownHook(Thread hook) {
+        // Check hook for null
+        if (hook == null)
+            throw new NullPointerException("null is not allowed here");
+                
         return;
     }
 
@@ -280,6 +284,10 @@
      * @return true if the hook could be de-registered
      */
     public boolean removeShutdownHook(Thread hook) {
+        // Check hook for null
+        if (hook == null)
+            throw new NullPointerException("null is not allowed here");
+                
         return false;
     }