[ 
https://issues.apache.org/jira/browse/TAP5-2758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17944306#comment-17944306
 ] 

Hudson commented on TAP5-2758:
------------------------------

SUCCESS: Integrated in Jenkins build Tapestry ยป tapestry-javax-java-9-freestyle 
#58 (See 
[https://ci-builds.apache.org/job/Tapestry/job/tapestry-javax-java-9-freestyle/58/])
TAP5-2758: Treat @Symbol as explicit injection signal (ben: rev 
93c70c56d0c39e4337fab71e5f7b819917eebe77)
* (edit) 
tapestry-ioc/src/test/groovy/ioc/specs/ServiceBuilderMethodInvokerSpec.groovy
* (add) tapestry-ioc/src/test/groovy/ioc/specs/DecorateWithSymbolSpec.groovy
* (add) 
tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/test/internal/DecorateWithSymbolModule.java
* (edit) 
tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/test/internal/ServiceBuilderMethodFixture.java
* (edit) 
tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java


> Constructor/Builder injection should support @Symbol for List/Collection/Map 
> even without @Inject
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-2758
>                 URL: https://issues.apache.org/jira/browse/TAP5-2758
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>    Affects Versions: 5.8.3
>            Reporter: Ben Weidig
>            Assignee: Ben Weidig
>            Priority: Minor
>
> If a constructor/builder method for a Service that has any type of 
> configuration has also another {{{}List{}}}/{{{}Collection{}}}/{{{}Map{}}}, a 
> {{RuntimeException}} gets thrown 
> ({{{}org.apache.tapestry5.ioc.internal.AbstractServiceCreator{}}}:95)
> Adding @Symbol to the arguments doesn't help, it also requires {{@Inject}} to 
> work.
> This behavior stems from 
> {{org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateInjection(Class,
>  Type, Annotation[], ObjectLocator, InjectionResources)}} which analyzes 
> parameters and decides "how" to inject the value.
> Symbols work because no other injection variant is found first.
> However, if the parameter is a {{{}List{}}}/{{{}Collection{}}}/{{{}Map{}}}, 
> it's always treated as a configuration, unless an {{@Inject}} is present.
> In my opinion, this is not the best way to handle this.
> {{@Symbol}} should be as significant as other annotations, as a symbol can't 
> be target of a configuration.
> To not rely on the fallback, I propose adding a check for {{{}@Symbol{}}}.
> My local proof of concept works but also highlighted the lack of tests for 
> the edge case of duplicate possible configuration parameters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to