Status: New
Owner: ----
New issue 749 by [email protected]: Add support for injection into
non-static inner classes
http://code.google.com/p/google-guice/issues/detail?id=749
Description of the issue:
New feature. Support injection into inner classes that are not static.
Using guice-3.0.
When I last used Jboss 4.x w/ EJB 3.0 (like 6-7 year old technology) - it's
@EJB injection supported injection into (non-static) inner classes. I also
believe that more modern CDI via javax.inject.Inject - @Inject also
supports injection into (non-static) inner classes. It would be nice if
Guice supported this.
By not supporting this, it requires class refactoring / restructuring into
more complex forms for the sole purpose of making Guice injection work
which is kind of crazy.
Steps to reproduce:
1. Create a class which holds a non-static inner class which uses guice
@Inject (com.google.inject.Inject) to try to inject a resource.
2. Execute the code
3. Receive error message:
Caused by: com.google.inject.ConfigurationException: Guice configuration
errors:
1) Injecting into inner classes is not supported. Please use a 'static'
class (top-level or nested) instead of
<some.package.OutterClassName$InnerClassName>
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" 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-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.