This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-5631-chaining-require-annotations in repository https://gitbox.apache.org/repos/asf/struts.git
commit b1b7aa1b3740958bb8f751054b526e5a42af8aae Author: Lukasz Lenart <[email protected]> AuthorDate: Wed May 27 08:24:09 2026 +0200 WW-5631 refactor(chaining): align requireAnnotations parsing with BooleanUtils Use BooleanUtils.toBoolean for the chaining requireAnnotations flag so it accepts the same values (yes/on/1) as the sibling struts.parameters.requireAnnotations switch, and unify the enforcement WARN message prefix. Co-Authored-By: Claude Opus 4.7 <[email protected]> --- .../java/org/apache/struts2/interceptor/ChainingInterceptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/interceptor/ChainingInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/ChainingInterceptor.java index c9b8a87c8..a10e8aaa3 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/ChainingInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/ChainingInterceptor.java @@ -18,6 +18,7 @@ */ package org.apache.struts2.interceptor; +import org.apache.commons.lang3.BooleanUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.ActionInvocation; @@ -167,7 +168,7 @@ public class ChainingInterceptor extends AbstractInterceptor { @Inject(value = StrutsConstants.STRUTS_CHAINING_REQUIRE_ANNOTATIONS, required = false) public void setRequireAnnotations(String requireAnnotations) { - this.requireAnnotations = "true".equalsIgnoreCase(requireAnnotations); + this.requireAnnotations = BooleanUtils.toBoolean(requireAnnotations); } @Inject(value = StrutsConstants.STRUTS_CHAINING_COPY_ERRORS, required = false) @@ -251,7 +252,7 @@ public class ChainingInterceptor extends AbstractInterceptor { try { return ognlUtil.getBeanInfo(targetClass); } catch (IntrospectionException e) { - LOG.warn("Error introspecting Action {} for chaining @StrutsParameter enforcement", targetClass, e); + LOG.warn("Chaining: error introspecting target [{}] for @StrutsParameter enforcement", targetClass, e); return null; } }
