Source:
<code>public boolean isAccessible(Map context, Object target, Member member, String propertyName) { LOG.debug("Checking access for [target: {}, member: {}, property: {}]", target, member, propertyName); Class targetClass = target != null ? target.getClass() : member.getDeclaringClass(); <START> Class memberClass = member.getDeclaringClass(); <END> if (checkEnumAccess(target, member)) { LOG.trace("Allowing access to enum: target class of target [{}], member [{}]", targetClass, target, member); return true; } if (Modifier.isStatic(member.getModifiers()) && allowStaticMethodAccess) { LOG.debug("Support for accessing static methods [target: {}, targetClass: {}, member: {}, property: {}] is deprecated!", target, targetClass, member, propertyName); if (!isClassExcluded(member.getDeclaringClass())) { targetClass = member.getDeclaringClass(); } } if (isPackageExcluded(targetClass.getPackage(), memberClass.getPackage())) { LOG.warn("Package of target class of target or package of member are excluded!", targetClass.getPackage(), targetClass, target, memberClass.getPackage(), member); return false; } if (isClassExcluded(targetClass)) { LOG.warn("Target class of target is excluded!", targetClass, target); return false; } if (isClassExcluded(memberClass)) { LOG.warn("Declaring class of member type is excluded!", member); return false; } if (disallowProxyMemberAccess && ProxyUtil.isProxyMember(member, target)) { LOG.warn("Access to proxy is blocked! Target class of target [{}], member [{}]", targetClass, target, member); return false; } boolean allow = true; if (!checkStaticMethodAccess(member)) { LOG.warn("Access to static is blocked!", member); allow = false; } if (!allow) { return false; } return Modifier.isPublic(member.getModifiers()) && isAcceptableProperty(propertyName); }</code><technical_language>a small improvement switch L:86 L:87, declare Class memberClass final reuse memberClass ternary expression</technical_language>

Target:
public boolean isAccessible(Map context, Object target, Member member, String propertyName) { LOG.debug("Checking access for [target: {}, member: {}, property: {}]", target, member, propertyName); if (checkEnumAccess(target, member)) { LOG.trace("Allowing access to enum: target [{}], member [{}]", target, member); return true; } if (!checkStaticMethodAccess(member)) { LOG.warn("Access to static is blocked!", member); return false; } final Class memberClass = member.getDeclaringClass(); if (isClassExcluded(memberClass)) { LOG.warn("Declaring class of member type is excluded!", member); return false; } Class targetClass = Modifier.isStatic(member.getModifiers()) ? memberClass : target.getClass(); if (isPackageExcluded(targetClass.getPackage(), memberClass.getPackage())) { LOG.warn("Package of target class of target or package of member are excluded!", targetClass.getPackage(), targetClass, target, memberClass.getPackage(), member); return false; } if (isClassExcluded(targetClass)) { LOG.warn("Target class of target is excluded!", targetClass, target); return false; } if (disallowProxyMemberAccess && ProxyUtil.isProxyMember(member, target)) { LOG.warn("Access to proxy is blocked! Target class of target [{}], member [{}]", targetClass, target, member); return false; } return Modifier.isPublic(member.getModifiers()) && isAcceptableProperty(propertyName); }