code: private synchronized static <T> JAXBContext getContext(Class<T> type) throws JAXBException {
      final SoftReference<Cache> existingCacheRef = CACHE;
      if (existingCacheRef != null) {
        Cache existingCache = existingCacheRef.get();
        if (existingCache != null && existingCache.type == type) {
          return existingCache.context;
        }
      }
  
      // overwrite the cache
      Cache newCache = new Cache(type);
      CACHE = new SoftReference<Cache>(newCache);
  
      return newCache.context;
    }
docs: Obtains the {@link JAXBContext} from the given type, by using the cache if possible.
  <p>
  The original code in {@link JAXB} class claimed that {@code volatile} on the {@code
  WeakReference} variable that they stored the cache in was enough to provide thread safety, but
  I don't think so as the reference itself, inside the {@code WeakReference} wrapper isn't
  volatile.
  <p>
  My improvement