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. From the Field.set Javadoc,
"Setting a final field in this way is meaningful only during
deserialization or reconstruction of instances of classes with blank
final fields, before they are made available for access by other parts
of a program. Use in any other context may have unpredictable effects,
including cases in which other parts of a program continue to use the
original value of this field."
Guice should refuse to inject final fields. I opened bug
245 for this: http://code.google.com/p/google-guice/issues/detail?id=245
Thanks,
Jesse
PS - if/when you get this to work, I'm sure other Guice
users would be interested in tips for Scala interop
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---