SecurityManager sm = System.getSecurityManager(); if (sm instanceof FrameworkSecurityManager) {  AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] {domain}); try { sm.checkPermission((Permission) permission, acc); return true; } catch (Exception e) { return false; } }
	public boolean hasPermission(Object permission) {		checkValid();		if (domain != null) {			if (permission instanceof Permission) {				return domain.implies((Permission) permission);			}			return false;		}		return true;	}