i dont get it, the method putIntoCache SHOULD check for the location string. Because that is the one that goes into the markupCache
the cacheKey doesn't go into that markupCache at all anymore that only goes into the markupKeyCache
So as far as i can see the putIntoCache method is fine.
And why it also can return it is this:
// We don't lock the cache while loading a markup. Thus it may
// happen that the very same markup gets loaded twice (the first
// markup being loaded, but not yet in the cache, and another
// request requesting the very same markup). Since markup
// loading in avg takes less than 100ms, it is not really an
// issue. For consistency reasons however, we should always use
// the markup loaded first which is why it gets returned.
markup = (Markup)markupCache.get(locationString);
So thats threadding.
putIntoCache puts the markup into the cache if not there or if it is there returns the one that is in there (the first one parsed)
If you have new stuff then that is not the place to overwrite markup. You first have to call
public final Markup removeMarkup(final String cacheKey)