You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Uwe Schäfer <sc...@thomas-daily.de> on 2010/03/05 10:38:45 UTC
Re: Guice & LazyInitProxyFactory : NPE when calling, first, public
fields
Joseph Pachod schrieb:
> We're using Wicket with Guice.
> An issue has just popped up : on some special injected objects, we
> access public fields. These public fields are themselves injected
> through guice.
>
> However, due to the LazyInitProxyFactory, they're not. Indeed, as far as
> I got it, the LazyInitProxyFactory waits for the first method call to do
> the actual injection.
To me this does not feel like necessarily the right behaviour. I do not
see a tremendous advantage in this resolving being done lazily.
My suggestion would be to add a switch in some Settings object, that
controls this behaviour and inject as requested without deferrence.
As i don´t like the idea to live with a longterm patch of wickets, would
it be acceptable to include this kind of tweak into the wicket-guice
codebase if i provided an appropriate patch?
And if so, what would be the right place for such a switch?
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Guice & LazyInitProxyFactory : NPE when calling, first, public
fields
Posted by Uwe Schäfer <sc...@thomas-daily.de>.
Uwe Schäfer schrieb:
> To me this does not feel like necessarily the right behaviour. I do not
> see a tremendous advantage in this resolving being done lazily.
for the record: we could change to doing it non-lazy, but it does not
solve this particular issue, as the value of public field is constant,
depending on the point in time where the CGLib-subclassing happened.
and as we cannot intercept field access...
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org