This is an automated email from the ASF dual-hosted git repository. amashchenko pushed a commit to branch struts-2-5-x in repository https://gitbox.apache.org/repos/asf/struts.git
The following commit(s) were added to refs/heads/struts-2-5-x by this push: new 71267a9 Revert some changes to be more consistent with 2.6 version 71267a9 is described below commit 71267a9b4b99ad05f20a376478b165c0b3f2b74a Author: Aleksandr Mashchenko <amashche...@apache.org> AuthorDate: Thu Jan 31 17:32:36 2019 +0200 Revert some changes to be more consistent with 2.6 version --- .../xwork2/ognl/SecurityMemberAccess.java | 34 ++-------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java index f906f98..0e32efd 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java @@ -104,7 +104,7 @@ public class SecurityMemberAccess extends DefaultMemberAccess { } boolean allow = true; - if (!checkStaticMemberAccess(member)) { + if (!checkStaticMethodAccess(member)) { LOG.warn("Access to static [{}] is blocked!", member); allow = false; } @@ -118,38 +118,10 @@ public class SecurityMemberAccess extends DefaultMemberAccess { return super.isAccessible(context, target, member, propertyName) && isAcceptableProperty(propertyName); } - /** - * Retain backwards-compatibility for any implementations extending this class prior to 2.5.21. - * - * Deprecated as of 2.5.21. - * - * @param member - * - * @return - */ - @Deprecated protected boolean checkStaticMethodAccess(Member member) { - return checkStaticMemberAccess(member); - } - - /** - * Check access for static members - * - * Static non-field access result is a logical and of allowStaticMethodAccess and public. - * Static field access result is true if-and-only-if the field is public. - * - * @param member - * - * @return - */ - protected boolean checkStaticMemberAccess(Member member) { - final int modifiers = member.getModifiers(); + int modifiers = member.getModifiers(); if (Modifier.isStatic(modifiers)) { - if (member instanceof Field) { - return Modifier.isPublic(modifiers); - } else { - return allowStaticMethodAccess && Modifier.isPublic(modifiers); - } + return allowStaticMethodAccess; } else { return true; }