}
key = Pair.of(uniqueId, versionCorrection);
final Element e = _portfolioNodeCache.get(key);
if (e != null) {
s_logger.debug("getPortfolioNode: EHCache hit on {}/{}", uniqueId, versionCorrection);
final PortfolioNode node = (PortfolioNode) e.getObjectValue();
return addToFrontCache(node, versionCorrection);
} else {
s_logger.debug("getPortfolioNode: EHCache miss on {}/{}", uniqueId, versionCorrection);
}
} else {
s_logger.debug("getPortfolioNode: Pass through on {}/{}", uniqueId, versionCorrection);
key = null;
}
final PortfolioNode node = getUnderlying().getPortfolioNode(uniqueId, versionCorrection);
f = addToFrontCache(node, versionCorrection);
if (f != node) {
s_logger.debug("getPortfolioNode: Late front cache hit on {}/{}", uniqueId, versionCorrection);
return (PortfolioNode) f;
}
if (key != null) {
_portfolioNodeCache.put(new Element(key, node));
} else {
_portfolioNodeCache.put(new Element(Pair.of(node.getUniqueId(), versionCorrection), node));
}
return node;
}