Index: modules/luni-kernel/src/main/java/java/lang/Runtime.java =================================================================== --- modules/luni-kernel/src/main/java/java/lang/Runtime.java (revision 429279) +++ modules/luni-kernel/src/main/java/java/lang/Runtime.java (working copy) @@ -288,6 +288,10 @@ * 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; } @@ -299,6 +303,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; }