code: public static void add(int slot, boolean registerShutdownInProgress, Runnable hook) {
          synchronized (lock) {
              if (hooks[slot] != null)
                  throw new InternalError("Shutdown hook at slot " + slot + " already registered");
  
              if (!registerShutdownInProgress) {
                  if (state > RUNNING)
                      throw new IllegalStateException("Shutdown in progress");
              } else {
                  if (state > HOOKS || (state == HOOKS && slot <= currentRunningHook))
                      throw new IllegalStateException("Shutdown in progress");
              }
  
              hooks[slot] = hook;
          }
      }
docs: Android changed s/@params/@param