This is no better. This is probably worse than in special circumstances. Only what you need is where the target will need to call newInstance () (etc.). In class methods, factory, etc.
If you want to save the electrons, BTW, this will also work
MyObj obj = someService.find((Class<MyObj>) null, "someId");
source
share