You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2013/07/10 12:37:49 UTC

[jira] [Updated] (WICKET-5264) CDI Injection no longer working on anonymous classes

     [ https://issues.apache.org/jira/browse/WICKET-5264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-5264:
------------------------------------

    Fix Version/s: 6.9.1
    
> CDI Injection no longer working on anonymous classes
> ----------------------------------------------------
>
>                 Key: WICKET-5264
>                 URL: https://issues.apache.org/jira/browse/WICKET-5264
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-cdi
>    Affects Versions: 6.9.0
>            Reporter: Emond Papegaaij
>            Priority: Blocker
>             Fix For: 6.9.1
>
>
> The changes made for WICKET-5226 (no longer injecting anonymous inner classes) breaks our applications badly, and I suspect we are not the only one. The following pattern is quite common:
> add(new Link<Void>("rest") {
> 	@Inject
> 	private AccountRestResourceClient accountClient;
> 	@Override
> 	public void onClick() {....}
> }
> In Wicket 6.9.0, this no longer works: accountClient will not get injected because the Link is an anonymous inner class. To make things worse, even in concrete classes, you can't rely on injection to work, because someone could subclass your class as an anonymous inner class and injection will again not work.
> This change was made because Weld 2.0 throws an exception when trying to create an InjectionTarget for anonymous classes. This will be reduced to a log-warning in 2.0.2: https://issues.jboss.org/browse/WELD-1441

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira