[ https://issues.apache.org/jira/browse/WW-5512?focusedWorklogId=953060&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-953060 ]
ASF GitHub Bot logged work on WW-5512: -------------------------------------- Author: ASF GitHub Bot Created on: 18/Jan/25 09:16 Start Date: 18/Jan/25 09:16 Worklog Time Spent: 10m Work Description: kusalk commented on PR #1175: URL: https://github.com/apache/struts/pull/1175#issuecomment-2599642327 How about the following - both parameters are injected as `null` even though one exists. Is that expected? I guess my concern here is that unintuitive behaviour here could lead to bugs being introduced in the future ``` @Inject(required = false) public ConstructorCheck(@Inject(value = "constructorCheck.name") String name, @Inject(value = "nonExistingConstant") String name2) { ``` Issue Time Tracking ------------------- Worklog Id: (was: 953060) Time Spent: 50m (was: 40m) > Support injecting empty optional parameters into constructors > ------------------------------------------------------------- > > Key: WW-5512 > URL: https://issues.apache.org/jira/browse/WW-5512 > Project: Struts 2 > Issue Type: Improvement > Components: Core > Reporter: Lukasz Lenart > Assignee: Lukasz Lenart > Priority: Minor > Fix For: 6.7.1, 7.0.1 > > Time Spent: 50m > Remaining Estimate: 0h > > Currently such declaration won't work: > {code:java} > public class StrutsBean { > private final String devMode; > @Inject(value = StrutsConstants.STRUTS_DEV_MODE, required = false) > public StrutsCspNonceReader(String devMode) { > this.devMode = devMode > } > } > {code} > as it will fail no being able to find a proper constructor -- This message was sent by Atlassian Jira (v8.20.10#820010)