if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
if (thread.getThreadGroup() != null && thread.getThreadGroup().getParent() != null) checkPermission(new RuntimePermission("modifyThread")); }
  public void checkAccess(ThreadGroup g)  {        if (g.getParent() != null)                checkPermission(new RuntimePermission("modifyThreadGroup"));    }