[
https://issues.apache.org/jira/browse/WW-5578?focusedWorklogId=987866&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-987866
]
ASF GitHub Bot logged work on WW-5578:
--------------------------------------
Author: ASF GitHub Bot
Created on: 18/Oct/25 10:12
Start Date: 18/Oct/25 10:12
Worklog Time Spent: 10m
Work Description: Copilot commented on code in PR #1377:
URL: https://github.com/apache/struts/pull/1377#discussion_r2442006887
##########
core/src/main/java/org/apache/struts2/config/providers/InterceptorBuilder.java:
##########
@@ -70,22 +70,14 @@ public static List<InterceptorMapping>
constructInterceptorReference(Interceptor
throw new ConfigurationException("Unable to find interceptor class
referenced by ref-name " + refName, location);
} else {
if (referencedConfig instanceof InterceptorConfig config) {
- try {
- Interceptor inter = objectFactory.buildInterceptor(config,
refParams);
- result.add(new InterceptorMapping(refName, inter,
refParams));
- } catch (ConfigurationException ex) {
- LOG.warn(new ParameterizedMessage("Unable to load config
class {} at {} probably due to a missing jar, which might be fine if you never
plan to use the {} interceptor",
- config.getClassName(), ex.getLocation(),
config.getName()), ex);
- }
-
+ Interceptor inter = objectFactory.buildInterceptor(config,
refParams);
+ result.add(new InterceptorMapping(refName, inter, refParams));
Review Comment:
With the removal of exception handling, this method now throws
`ConfigurationException` without catching it. The method signature should be
updated to document this change by adding `throws ConfigurationException` to
the method declaration, or the Javadoc should be updated to indicate that this
exception can be thrown.
Issue Time Tracking
-------------------
Worklog Id: (was: 987866)
Time Spent: 20m (was: 10m)
> Bad interceptor configuration is masked
> ---------------------------------------
>
> Key: WW-5578
> URL: https://issues.apache.org/jira/browse/WW-5578
> Project: Struts 2
> Issue Type: Bug
> Reporter: Martin
> Priority: Major
> Fix For: 7.2.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Interceptors which have initialization errors; e.g. maybe they are supplied
> by Spring and they have missing dependencies, are simply skipped instead of
> throwing a configuration error. See this code in
> org.apache.struts2.config.providers.InterceptorBuilder#constructInterceptorReference
> {code:java}
> try {
> Interceptor inter =
> objectFactory.buildInterceptor(config, refParams);
> result.add(new InterceptorMapping(refName, inter,
> refParams));
> } catch (ConfigurationException ex) {
> LOG.warn(new ParameterizedMessage("Unable to load
> config class {} at {} probably due to a missing jar, which might be fine if
> you never plan to use the {} interceptor",
> config.getClassName(), ex.getLocation(),
> config.getName()), ex);
> }
> {code}
> This could result in an only-partially working application. Failing fast is
> generally preferred in order to be certain that everything is actually
> working as its been configured.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)