private static void checkPackageAccess(Class type){
  SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    String name=type.getName();
    int i=name.lastIndexOf('.');
    if (i != -1) {
      sm.checkPackageAccess(name.substring(0,i));
    }
  }
}

private static void checkPackageAccess ( Class type ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { String name = type . getName ( ) ; int i = name . lastIndexOf ( '.' ) ; if ( i != - 1 ) { sm . checkPackageAccess ( name . substring ( 0 , i ) ) ; } } }
check for permission to access the package of the specified class , if any . call this method prior to using reflection to access class members to insure that the access check is not skipped because of caller - based checks using configurationfile instead of the caller of configurationfile .
