CachedArtifact cached = artifactAtRepositoryCachedResolutionIndex.lookup(artifactCacheKey(artifact));
final BigInteger descriptorHash = moduleSource.getDescriptorHash();
if (cached != null) {
long age = timeProvider.getCurrentTime() - cached.getCachedAt();
final boolean isChangingModule = moduleSource.isChangingModule();
ArtifactIdentifier artifactIdentifier = ((ModuleComponentArtifactMetaData) artifact).toArtifactIdentifier();
if (cached.isMissing()) {
if (!cachePolicy.mustRefreshArtifact(artifactIdentifier, null, age, isChangingModule, descriptorHash.equals(cached.getDescriptorHash()))) {
LOGGER.debug("Detected non-existence of artifact '{}' in resolver cache", artifact);
for (String location : cached.attemptedLocations()) {
result.attempted(location);