Hi Wouter,
thanks for the insight. I was unable to find some time to commit it yet.
I will take it along for next week, or is somebody can find some time
please commit it. It's a good adittion.
Regards,
Jeroen
Wouter Zelle wrote:
Hi,
We configured the log4j category 'sitemap' to log in DEBUG-mode, but the
result was a NullpointerException in ResourceExistsSelectorEventAware.
The crash occurs on the last line in the example below:
if (cacheKey != null && this.getLogger().isDebugEnabled()) {
this.getLogger().debug("looking for cached key: " + cacheKey);
this.getLogger().debug("Cache key hit: " + cache.containsKey(cacheKey));
this.getLogger().debug("cache: <map:when test='" +
(cache.get(cacheKey).getResponse()[0] == 1) + "'>");
}
The crash occurs when the cacheKey is not in the cache. I suggest this
fix, which works correctly for me:
if (cacheKey != null && this.getLogger().isDebugEnabled()) {
this.getLogger().debug("looking for cached key: " + cacheKey);
boolean cacheHit = cache.containsKey(cacheKey);
this.getLogger().debug("Cache key hit: " + cacheHit);
if (cacheHit) {
this.getLogger().debug("cache: <map:when test='" +
(cache.get(cacheKey).getResponse()[0] == 1) + "'>");
}
}
Regards,
Wouter
********************************************
Hippocms-dev: Hippo CMS development public mailinglist