public V get() throws Error { ClassLoader tccl = getContextClassLoader(); V instance = CACHE.get(tccl); if (instance == null) { instance = createNewInstance(); CACHE.put(tccl, instance); } return instance; }
private V createNewInstance() { try { return initialValue(); } catch (Exception e) { throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); } }