views:

203

answers:

3

The SVN version of Guice supports JSR-330 annotations ("JSR-330 Integration - This documents an experimental, unreleased feature available in Guice SVN only"). Google gives the advise: "For now, stick with Guice's annotations and Provider interface." Guice 2 is a year old now and I wonder if there will be JSR-330 support in the near future. Does anyone know?

+1  A: 

Apparently it is planned for 2.1 : http://code.google.com/p/google-guice/issues/detail?id=424

Timo Westkämper
Is there an up-to-date release plan for guice? (Guice 2.1 was announced for 2009 ...)
deamon
I don't know. Better ask someone from Guice concerning the release plan.
Timo Westkämper
+3  A: 

If you're comfortable using code from SVN, use that and the JSR-330 annotations. If you'd rather rely on a published release, use Guice's own annotations. Also, JSR-330 doesn't support optional injection.

Note that there's a tiny behaviour change with Guice post-2.0 to cope with the new @Inject annotation.

  • In Guice 2.0 and earlier: Methods not-annotated with @Inject are injected, if they override a method that does have that annotation.
  • After Guice 2.0: Guice not inject such methods. You need to reapply the annotation on every override.

We don't have a release date scheduled for Guice 2.1.

Jesse Wilson