Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 822C1200BF2 for ; Mon, 2 Jan 2017 08:51:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 80C88160B42; Mon, 2 Jan 2017 07:51:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C9598160B21 for ; Mon, 2 Jan 2017 08:50:59 +0100 (CET) Received: (qmail 2444 invoked by uid 500); 2 Jan 2017 07:50:59 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 2412 invoked by uid 99); 2 Jan 2017 07:50:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2017 07:50:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A6F832C1F54 for ; Mon, 2 Jan 2017 07:50:58 +0000 (UTC) Date: Mon, 2 Jan 2017 07:50:58 +0000 (UTC) From: "Hudson (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4174) Make OgnlValueStack and OgnlValueStackFactory More Extensible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 02 Jan 2017 07:51:00 -0000 [ https://issues.apache.org/jira/browse/WW-4174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15792424#comment-15792424 ] Hudson commented on WW-4174: ---------------------------- SUCCESS: Integrated in Jenkins build Struts-JDK7-master #576 (See [https://builds.apache.org/job/Struts-JDK7-master/576/]) WW-4174 Makes fields protected to allow easily override (lukaszlenart: rev 55fed537646ba33d6789deb15f0d8ef99b870594) * (edit) core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java * (edit) core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStackFactory.java > Make OgnlValueStack and OgnlValueStackFactory More Extensible > ------------------------------------------------------------- > > Key: WW-4174 > URL: https://issues.apache.org/jira/browse/WW-4174 > Project: Struts 2 > Issue Type: Improvement > Components: Value Stack > Affects Versions: 2.3.15.1 > Reporter: Kevin Conroy > Assignee: Lukasz Lenart > Fix For: 2.5.next > > > I'm not trying to reopen XW-613 and have taken the advice from the mailing list seriously about not just requesting changes to the default behavior or log levels. > http://mail-archives.apache.org/mod_mbox/struts-user/200907.mbox/%3Ce34c19110907310623y36a23e81paabd04e23a6d725e@mail.gmail.com%3E > Instead, I'd like to propose changing some private methods in OgnlValueStack to be protected so that developers can more easily extend OgnlValueStack to implement their desired logging/warning/exception behavior for their application. > I'd like to propose that the following methods in OgnlValueStack (currently private in scope) should be changed to protected: > {code} > protected void handleRuntimeException(String expr, Object value, boolean throwExceptionOnFailure, RuntimeException re) > protected void handleOgnlException(String expr, Object value, boolean throwExceptionOnFailure, OgnlException e) > protected void setupExceptionOnFailure(boolean throwExceptionOnFailure) > protected Object handleOtherException(String expr, boolean throwExceptionOnFailure, Exception e) > protected Object handleOgnlException(String expr, boolean throwExceptionOnFailure, OgnlException e) > protected boolean shouldLogNoSuchPropertyWarning(OgnlException e) > protected Object findInContext(String name) > {code} > Additionally, to enable the OgnlValueStackFactory to be easily extended to return any overridden OgnlValueStack implementations, the currently private data members should be given protected getters: > {code} > protected XWorkConverter getXworkConverter() > { > return xworkConverter; > } > protected CompoundRootAccessor getCompoundRootAccessor() > { > return compoundRootAccessor; > } > protected TextProvider getTextProvider() > { > return textProvider; > } > protected Container getContainer() > { > return container; > } > protected boolean isAllowStaticMethodAccess() > { > return allowStaticMethodAccess; > } > {code} > This would allow developers like myself to more easily extend and override behavior to better fit our own desired notification levels. For example, these changes would allow me to set it up to provide info level warnings in the log file while suppressing the exception that gets thrown. > Protected level scope ensures that my custom extensions can more easily inherit bug fixes and behavior changes from future versions. > Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)