[
https://issues.apache.org/jira/browse/WW-5792?focusedWorklogId=1049886&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1049886
]
ASF GitHub Bot logged work on WW-5792:
--------------------------------------
Author: ASF GitHub Bot
Created on: 24/Oct/26 08:31
Start Date: 24/Oct/26 08:31
Worklog Time Spent: 10m
Work Description: sonarqubecloud[bot] commented on PR #2054:
URL: https://github.com/apache/struts/pull/2054#issuecomment-6382029104
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=2054)
**Quality Gate passed**
Issues
 [0 New
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2054&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2054&issueStatuses=ACCEPTED)
Measures
 [0 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=2054&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2054&metric=new_coverage&view=list)
 [0.0% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2054&metric=new_duplicated_lines_density&view=list)
<!
Issue Time Tracking
-------------------
Worklog Id: (was: 1049886)
Time Spent: 20m (was: 10m)
> XmlDocConfigurationProvider#verifyAction does not fail startup for a
> non-public action class
> --------------------------------------------------------------------------------------------
>
> Key: WW-5792
> URL: https://issues.apache.org/jira/browse/WW-5792
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 7.5.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> h2. Problem
> {{XmlDocConfigurationProvider#verifyAction}} is meant to fail fast when an
> action class declared in XML is not public. It throws a
> {{ConfigurationException}} with the message "Action class [...] is not
> public" — but the throw happens inside the same {{try}} block whose {{catch
> (RuntimeException ex)}} handler logs at INFO ("Unable to verify action class
> [...] exists at initialization") and carries on. {{ConfigurationException}}
> extends {{StrutsException}}, which extends {{RuntimeException}}, so the check
> never takes effect and startup continues.
> The sibling check works: a class without a public no-arg constructor raises
> {{NoSuchMethodException}}, which has its own handler that rethrows as
> {{ConfigurationException}}.
> h2. Reproduction
> Calling {{verifyAction}} (with the default {{ObjectFactory}}, so
> {{isNoArgConstructorRequired()}} is true) on:
> * a package-private action class → returns normally, nothing but an INFO log
> line;
> * a public class without a public no-arg constructor → throws
> {{ConfigurationException: Action class [...] does not have a public no-arg
> constructor}}.
> Confirmed on {{main}} with a throwaway test in
> {{org.apache.struts2.config.providers}} that injects a
> {{StrutsXmlConfigurationProvider}} from the test container and calls
> {{verifyAction}} directly for both classes.
> h2. Expected
> A non-public action class logs a WARN naming the class and its location,
> saying it will fail startup in Struts 8.0.0. Configuration loading continues
> as before. Failing startup is tracked in WW-5809 (8.0.0).
> h2. Notes
> Found while adding the same check to the Struts Boot registry provider
> (WW-5791), which fails startup for non-public action classes. There is
> currently no core test for the non-public branch.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)