There is a remark on this here:

"When doing this it is important to remember not to initialize
dependencies, to null or any other value, e.g.private ContactDao
dao=null;. Don't do this because the injector will run before the
subclass initializes its fields, and so the dao=null will override the
created proxy with null."


Am 14.02.2012 13:58, schrieb martin.dilger:
> Hi,
> I just realized painfully, that SpringComponentInjector only injects Beans,
> when the Fields are non-null.
> Is there a reason for this Behavior?
> The Reason I ask is, we "use" the SpringComponentInjector in all our Tests
> to inject Mocks with Injector.get().inject(this).
> This only works, if we set all Mocks to null in tearDown.
> No problem so far, but this is surely not a typical use case, but
> nonetheless, I would like to know if this is desired, and if we could
> propably allow to configure this behavior (as a flag or whatever?). 
> Just for me to understand this  better.
> Thanks
> Martin
> --
> View this message in context: 
> Sent from the Users forum mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to