Export to GitHub

atinject - issue #18

@Inject on static fields and methods?


Posted on Sep 11, 2009 by Helpful Hippo

The JavaDoc for @Inject says "Identifies injectable constructors, methods, and fields. May apply to static as well as instance members" but doesn't give clear guidance on what injection for static members means.

I would expect different language here, for example "Identifies injectable constructors, instance methods, and instance fields. <remove sentence starting with "May apply"; insert rest of first paragraph> Injection for static members annotated with @Inject is undefined".

Comment #1

Posted on Sep 11, 2009 by Helpful Dog

This change occurred as part of r4. I'm trying to remember who requested it...

Comment #2

Posted on Sep 11, 2009 by Helpful Dog

The request came from Oracle. They wanted to remove the sentence entirely. I added "may" as a compromise. It's not "undefined". It's either supported, or not, but the remaining rules still apply.

Status: WontFix

Labels:
Type-Defect Priority-Medium