Marker annotations to enhance performance of InjectionPoint#getInjectionPoints() method
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 1.7k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
_From [richard@winograd.ca](https://code.google.com/u/103356764632928340839/) on October 11, 2012 01:34:43_
I'd like a way to mark certain classes as not needing injection (or at least not needing Field injection or Member injection) to save some time in the InjectionPoint#get InjectionPoints () method.
I would like to be able to annotate a class as follows:
`@`NoFieldInjection(lookInParents=false);
`@`NoMethodInjection(lookInParents=false);
class DoesntNeedInjection {
`@`Inject
public DoesntNeedInjection(SomeDependency dependency) {
}
}
`@`NoFieldInjection(lookInParents = true);
`@`NoMethodInjection(lookInParents = true);
class DoesntNeedInjection2 extends SomeParentClass {
//uses default constructor, and JIT binding
//this class has no fields/methods but the parent class does
}
-------
My reasoning is that for systems (i.e. RoboGuice) injection start up time takes a non trivial amount of time and is done in the UI thread (separate issue, I know, but I'd like to get better performance anyways).
With these marker attributes, we could save crawling the entire inheritance tree, which could be large if you are using some type of 3rd party library.
_Original issue: http://code.google.com/p/google-guice/issues/detail?id=733_
Contributor guide
Assessment
This issue has not been assessed yet.