The reason for injection is to be able to stub and unit test easily.
Right
now the getCurrentInstance() is static and you'd need to use ugly
constructions to replace it with a stub (I am not saying it's impossible but
I am talking here from the feedback I've gathered and personal experience
when unit testing pure JSF).
And the other, more subtle annoyance is the you have to eventually make that
decision in a method when to create a local variable for FacesContext
because your code is getting too verbose.
FacesContext ctx = FacesContext.getCurrentInstance();
I hate writing that line. Every time I do, I think to myself "I hate this
stupid line of code."
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen