On Sep 8, 2:00 pm, Robbie Vanbrabant <[email protected]>
wrote:
> Maybe the next Guice release could have two guice.jar's, one with the legacy
> annotations and one without :)
I'm seriously contemplating it. It may make things slightly more
complicated internally, especially for Providers.
> What's the problem with @Named?
Suppose you do this:
public class NumberModule extends AbstractModule {
public void configure() {
bind(Integer.class).annotatedWith
(com.google.inject.name.Names.named("five").toInstance(5);
}
}
and this:
public Foo {
@Inject @javax.inject.Named("five") Integer five;
}
... then you'll get a configuration error. This will be quite annoying
in regular code, as you won't be able to identify which @Named your're
looking at without analyzing the imports.
I'm planning on fixing this before our next release. My best idea is
to silently replace @javax.inject.Named with its Guice counterpart
whenever you create a Key. It's annoying to need a special case, but
it'll work for both configuration and in injection points.
http://code.google.com/p/google-guice/issues/detail?id=425
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---