Description
FactoryFinder.getFactory() contains some synchronized blocks. The code is fast enough, but it could be good to prevent those calls if is not really necessary.
Checking this stuff I had an idea about how to prevent those calls. The idea is call FactoryFinder.getFactory() in the factory itself, and then pass the factory as a param for the object that uses it (FacesContext or PartialViewContext or whatever). Also, we can replace VisitContext.createVisitContext with calling the factory and then getVisitContext() directly (note createVisitContext is an static method thought for users). Additionally, add some volatile variables in some places to prevent multiple initializations is a good idea too.