-1
private static ConcurrentHashMap initContextServletContext = new ConcurrentHashMap(2);

field is private, but never used in FacesContext class. Is there a reason to exist?

tcwhvi
  • 3
  • 2

1 Answers1

0

It's accessed by reflection in Mojarra-specific com.sun.faces.config.InitFacesContext implementation which is only used during container initialization (line numbers match Mojarra 2.2.11):

675    static Map getThreadInitContextMap() {
676        ConcurrentHashMap threadInitContext = null;
677        try {
678            Field threadMap = FacesContext.class.getDeclaredField("threadInitContext");
679            threadMap.setAccessible(true);
680            threadInitContext = (ConcurrentHashMap)threadMap.get(null);
681        } catch (Exception e) {
682            if (LOGGER.isLoggable(Level.FINEST)) {
683                LOGGER.log(Level.FINEST, "Unable to get (thread, init context) map", e);
684            }
685        }
686        return threadInitContext;
687    }

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555