static void checkAccess(ManagementPermission p) throws SecurityException {
  SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(p);
  }
}

static void checkAccess ( ManagementPermission p ) throws SecurityException { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( p ) ; } }
check that the current context is trusted to perform monitoring or management . < p > if the check fails we throw a securityexception , otherwise we return normally .
