Ejemplo n.º 1
0
 /** Utility for security checks */
 private void checkMemberAccess(int type) {
   SecurityManager security = System.getSecurityManager();
   if (security != null) {
     security.checkMemberAccess(this, type);
     String packageName = getPackageName();
     if (!packageName.isEmpty()) {
       security.checkPackageAccess(packageName);
     }
   }
 }
 public void checkMemberAccess(Class clazz, int which) {
   String testString = clazz.getPackage().toString();
   if (!testString.startsWith("package org.eclipse.persistence.exceptions")
       && !testString.startsWith("package org.eclipse.persistence.internal.helper")
       && !testString.startsWith("package java.lang")) {
     if (testString.startsWith("package org.eclipse.persistence.testing.tests.validation")) {
       throw new SecurityException("Dummy SecurityException test");
     }
   }
   super.checkMemberAccess(clazz, which);
 }
 @Override
 public void checkMemberAccess(final Class<?> clazz, final int which) {
   if (finalSecurityManager != null) finalSecurityManager.checkMemberAccess(clazz, which);
 }