public static void conservativeCheckMemberAccess(Member m) throws SecurityException {
  final SecurityManager sm=System.getSecurityManager();
  if (sm == null)   return;
  final Class<?> declaringClass=m.getDeclaringClass();
  checkPackageAccess(declaringClass);
  if (Modifier.isPublic(m.getModifiers()) && Modifier.isPublic(declaringClass.getModifiers()))   return;
  sm.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION);
}

public static void conservativeCheckMemberAccess ( Member m ) throws SecurityException { final SecurityManager sm = System . getSecurityManager ( ) ; if ( sm == null ) return ; final Class < ? > declaringClass = m . getDeclaringClass ( ) ; checkPackageAccess ( declaringClass ) ; if ( Modifier . isPublic ( m . getModifiers ( ) ) && Modifier . isPublic ( declaringClass . getModifiers ( ) ) ) return ; sm . checkPermission ( SecurityConstants . CHECK_MEMBER_ACCESS_PERMISSION ) ; }
does a conservative approximation of member access check . use this if you don ' t have an actual ' userland ' caller class / classloader available . this might be more restrictive than a precise member access check where you have a caller , but should never allow a member access that is forbidden .
