static 変数へのインジェクション

Google guice は、通常のインジェクションの方法では、static 変数へのインジェクトはされない。

ただし、Module の configure で、インジェクトしたい static 変数をもつクラスを以下のように指定すれば、

requestStaticInjection(Class);

可能ではある。

Google guiceWiki のページで、
https://github.com/google/guice/wiki/Injections#static-injections

Static members will not be injected at instance-injection time.
This API is not recommended for general use because it suffers many of the same problems as static factories

と書いてある。
お奨めしない、、、static ファクトリの問題と同様にたくさん問題があるから。。
と言われているだけで、はっきり問題を言及してくれてはいない。
どんな問題なのだろう。

確かに、static 変数にインジェクトさせるなんて設計が誤っているのだが。