harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r483470 - /harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Runtime.java
Date Thu, 07 Dec 2006 14:42:13 GMT
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;
     }
 



Mime
View raw message