On Thu, Sep 11, 2008 at 4:43 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote:
>
>
>
> On Sep 3, 9:18 am, Jan Kriesten <[EMAIL PROTECTED]> wrote:
> > the following construct (original code is Scala)
> > ---8<---
> > @Inject @Named( "QUARTZ_FACTORY_KEY" ) private final String
> QUARTZ_FACTORY_KEY;
> >
> > public String QUARTZ_FACTORY_KEY() { return QUARTZ_FACTORY_KEY; }
> > ---8<---
>
> I wasn't able to reproduce your problem in a test case. I
> suspect this might be a bug in the annotation component
> of your compiler?
>
> If you can create a regular Java JUnit test case that
> demonstrates the problem, I'll investigate further.
>
> By the way, your construct doesn't really make sense --
> you're using field injection on a final field, which doesn't
> work.
If Guice can guarantee that no other threads get hold of the instance before
the field is set by reflection you should be fine using field injection on
final fields (via reflection):
http://jeremymanson.blogspot.com/2008/07/immutability-in-java-part-3.html
Dhanji.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---