[ 
https://issues.apache.org/jira/browse/WICKET-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605851#action_12605851
 ] 

Gili commented on WICKET-1705:
------------------------------

Here is a more detailed explanation of the problem:

http://google-guice.googlecode.com/files/Guice%201.0%20User%27s%20Guide.pdf 
page 19/22 states "Guice never performs static injection automatically. You 
must use Binder to explicitly request that the Injector inject your static 
members after startup:

binder.requestStaticInjection(User.class);"

and the example code right above this paragraph clearly shows that they're 
talking about static fields marked with @Inject. The problem is that the 
existing implementation of GuiceComponentInjector does not check whether a 
field is static or not before injecting its value. This patch adds the 
necessary check so only non-static fields are injected.

> GuiceComponentInjector mishandles static fields
> -----------------------------------------------
>
>                 Key: WICKET-1705
>                 URL: https://issues.apache.org/jira/browse/WICKET-1705
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-guice
>    Affects Versions: 1.3.3
>            Reporter: Gili
>         Attachments: guice2.patch
>
>
> GuiceComponentInjector mistakenly wraps static fields with serializable 
> proxies. These CGLIB proxies impose limitations (must have default 
> constructor, may not have final methods, etc) on fields which are not 
> strictly necessary. The new implementation allows the use of 
> Binder.requestStaticInjection() which is more flexible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to