It's Guice's @Named that's an issue, not javax.inject, which does not restrict. As sam said in a sister post, we should just un-encumber @Named with the element type restrictions, and we can provide alternative means to restrict if we want to clamp down (annotation processors or error-prone which can be selectively applied).

Dagger will also need to loosen its limitations, but it implements them with annotation processors, and uses the javax.inject version of @Named, so I think we can get all of this consistent at least with respect to Guice-derived injector systems.

c.

On 8 Apr 2014, at 9:50, John Wells wrote:

Yeah, I would be against anything in JSR-330 (or whatever extension
thereof) that would force a requirement of Java 8


On Tue, Apr 8, 2014 at 12:41 PM, Tavian Barnes <[email protected]> wrote:

That actually brings up a pain point for doing this in Guice: adding
ElementType.TYPE_USE to the targets for @Named would make Java 8 required
to build Guice.  Not sure how feasible that is for Google.

JSR 330's @Named doesn't have that problem because it doesn't limit
@Named's targets at all.

On Tuesday, 8 April 2014 12:18:49 UTC-4, Tim Peierls wrote:

On Mon, Apr 7, 2014 at 5:47 PM, Sam Berlin <[email protected]> wrote:

I'd be open to any of the following:
a) Hard-error on a qualifer/bindingannotation on types
b) Support qualifer/bindingannotation on types, but fail if it also
exists on the variable

Though, since this'd be a change to the way jsr330 things are
interpreted, seems like it'd be best to poll the jsr330 folks and make sure all various implementations (Dagger, Spring, etc..) are on-board with the
same solution.


The 330 spec says that "A qualifier annotation

- may have restricted usage if annotated with @Target. While this
specification covers applying qualifiers to fields and parameters only, some injector configurations might use qualifier annotations in other
places (on methods or classes for example).

I was on the 330 EG. My memory is that this wording was chosen
specifically to allow for the future use of type annotations, which were at that point in an "any day now" state (and had been for quite some time).

--tim

--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.


Christian Gruber :: Google, Inc. :: Java Core Libraries :: Dependency Injection
email: [email protected] :::: mobile: +1 (646) 807-9839

--
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.

Reply via email to