code: private static void invalidateSMCache(String key) {
  
          final boolean pa = key.equals("package.access");
          final boolean pd = key.equals("package.definition");
  
          if (pa || pd) {
              AccessController.doPrivileged(new PrivilegedAction<Void>() {
                  public Void run() {
                      try {
                          /* Get the class via the bootstrap class loader. */
                          Class cl = Class.forName(
                              "java.lang.SecurityManager", false, null);
                          Field f = null;
                          boolean accessible = false;
  
                          if (pa) {
                              f = cl.getDeclaredField("packageAccessValid");
                              accessible = f.isAccessible();
                              f.setAccessible(true);
                          } else {
                              f = cl.getDeclaredField("packageDefinitionValid");
                              accessible = f.isAccessible();
                              f.setAccessible(true);
                          }
                          f.setBoolean(f, false);
                          f.setAccessible(accessible);
                      }
                      catch (Exception e1) {
                          /* If we couldn't get the class, it hasn't
                           * been loaded yet.  If there is no such
                           * field, we shouldn't try to set it.  There
                           * shouldn't be a security execption, as we
                           * are loaded by boot class loader, and we
                           * are inside a doPrivileged() here.
                           *
                           * NOOP: don't do anything...
                           */
                      }
                      return null;
                  }  /* run */
              });  /* PrivilegedAction */
          }  /* if */
      }
docs: /*
  Implementation detail:  If the property we just set in
  setProperty() was either "package.access" or
  "package.definition", we need to signal to the SecurityManager
  class that the value has just changed, and that it should
  invalidate it's local cache values.
  
  Rather than create a new API entry for this function,
  we use reflection to set a private variable.