Repository: struts Updated Branches: refs/heads/master 98979423a -> 55fed5376
WW-4174 Makes fields protected to allow easily override Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/55fed537 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/55fed537 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/55fed537 Branch: refs/heads/master Commit: 55fed537646ba33d6789deb15f0d8ef99b870594 Parents: 9897942 Author: Lukasz Lenart <[email protected]> Authored: Mon Jan 2 08:20:14 2017 +0100 Committer: Lukasz Lenart <[email protected]> Committed: Mon Jan 2 08:20:14 2017 +0100 ---------------------------------------------------------------------- .../xwork2/ognl/OgnlValueStack.java | 31 ++++++++++---------- .../xwork2/ognl/OgnlValueStackFactory.java | 10 +++---- 2 files changed, 21 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/55fed537/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java index 7201ace..28bef54 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java @@ -52,19 +52,20 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS public static final String THROW_EXCEPTION_ON_FAILURE = OgnlValueStack.class.getName() + ".throwExceptionOnFailure"; + private static final Logger LOG = LogManager.getLogger(OgnlValueStack.class); + private static final long serialVersionUID = 370737852934925530L; private static final String MAP_IDENTIFIER_KEY = "com.opensymphony.xwork2.util.OgnlValueStack.MAP_IDENTIFIER_KEY"; - private static final Logger LOG = LogManager.getLogger(OgnlValueStack.class); - CompoundRoot root; - transient Map<String, Object> context; - Class defaultType; - Map<Object, Object> overrides; - transient OgnlUtil ognlUtil; - transient SecurityMemberAccess securityMemberAccess; - private transient XWorkConverter converter; + protected CompoundRoot root; + protected transient Map<String, Object> context; + protected Class defaultType; + protected Map<Object, Object> overrides; + protected transient OgnlUtil ognlUtil; + protected transient SecurityMemberAccess securityMemberAccess; + private transient XWorkConverter converter; private boolean devMode; private boolean logMissingProperties; @@ -189,7 +190,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS context.remove(REPORT_ERRORS_ON_NO_PROP); } - private void handleRuntimeException(String expr, Object value, boolean throwExceptionOnFailure, RuntimeException re) { + protected void handleRuntimeException(String expr, Object value, boolean throwExceptionOnFailure, RuntimeException re) { if (throwExceptionOnFailure) { String message = ErrorMessageBuilder.create() .errorSettingExpressionWithValue(expr, value) @@ -200,7 +201,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS } } - private void handleOgnlException(String expr, Object value, boolean throwExceptionOnFailure, OgnlException e) { + protected void handleOgnlException(String expr, Object value, boolean throwExceptionOnFailure, OgnlException e) { boolean shouldLog = shouldLogMissingPropertyWarning(e); String msg = null; if (throwExceptionOnFailure || shouldLog) { @@ -242,7 +243,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS } } - private void setupExceptionOnFailure(boolean throwExceptionOnFailure) { + protected void setupExceptionOnFailure(boolean throwExceptionOnFailure) { if (throwExceptionOnFailure) { context.put(THROW_EXCEPTION_ON_FAILURE, true); } @@ -255,7 +256,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS return tryFindValue(expr); } - private Object handleOtherException(String expr, boolean throwExceptionOnFailure, Exception e) { + protected Object handleOtherException(String expr, boolean throwExceptionOnFailure, Exception e) { logLookupFailure(expr, e); if (throwExceptionOnFailure) @@ -322,7 +323,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS return tryFindValue(expr, asType); } - private Object handleOgnlException(String expr, boolean throwExceptionOnFailure, OgnlException e) { + protected Object handleOgnlException(String expr, boolean throwExceptionOnFailure, OgnlException e) { Object ret = findInContext(expr); if (ret == null) { if (shouldLogMissingPropertyWarning(e)) { @@ -335,7 +336,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS return ret; } - private boolean shouldLogMissingPropertyWarning(OgnlException e) { + protected boolean shouldLogMissingPropertyWarning(OgnlException e) { return (e instanceof NoSuchPropertyException || e instanceof MethodFailedException) && devMode && logMissingProperties; } @@ -359,7 +360,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS return ognlUtil.getValue(expr, context, root, asType); } - private Object findInContext(String name) { + protected Object findInContext(String name) { return getContext().get(name); } http://git-wip-us.apache.org/repos/asf/struts/blob/55fed537/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStackFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStackFactory.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStackFactory.java index 7617494..674d7e2 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStackFactory.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStackFactory.java @@ -38,11 +38,11 @@ import java.util.Set; */ public class OgnlValueStackFactory implements ValueStackFactory { - private XWorkConverter xworkConverter; - private CompoundRootAccessor compoundRootAccessor; - private TextProvider textProvider; - private Container container; - private boolean allowStaticMethodAccess; + protected XWorkConverter xworkConverter; + protected CompoundRootAccessor compoundRootAccessor; + protected TextProvider textProvider; + protected Container container; + protected boolean allowStaticMethodAccess; @Inject public void setXWorkConverter(XWorkConverter converter) {
