Repository: ant-ivy Updated Branches: refs/heads/master ecc271c49 -> 06af67c4e
FIX: ModuleDescriptorMemoryCache didn't detect outdated entries when Ivy file was updated in the cache by another process Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/06af67c4 Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/06af67c4 Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/06af67c4 Branch: refs/heads/master Commit: 06af67c4e8da0b633d6e14419da45b7f872a8cc4 Parents: ecc271c Author: Maarten Coene <[email protected]> Authored: Fri Aug 24 08:38:31 2018 +0200 Committer: Maarten Coene <[email protected]> Committed: Fri Aug 24 08:38:31 2018 +0200 ---------------------------------------------------------------------- asciidoc/release-notes.adoc | 1 + .../org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/06af67c4/asciidoc/release-notes.adoc ---------------------------------------------------------------------- diff --git a/asciidoc/release-notes.adoc b/asciidoc/release-notes.adoc index ecfc530..cc53bb3 100644 --- a/asciidoc/release-notes.adoc +++ b/asciidoc/release-notes.adoc @@ -84,6 +84,7 @@ For details about the following changes, check our JIRA install at link:https:// - FIX: Implement dependency configuration negation (jira:IVY-982[] jira:IVY-1547[]) (Thanks to Arseny Aprelev) - FIX: Don't throw a CircularDependencyException when parsing an import scoped dependency in dependencyManagement section of a pom (jira:IVY-1588[]) - FIX: Respect exclude regardless of resolution order (jira:IVY-1486[]) (thanks to David Turner) +- FIX: ModuleDescriptorMemoryCache didn't detect outdated entries when Ivy file was updated in the cache by another process - IMPROVEMENT: Throw an IllegalStateException when retrieving the resolutionCacheRoot on the DefaultResolutionCacheManager if the basedir (or IvySettings) is not set (jira:IVY-1482[]) - IMPROVEMENT: Optimization: limit the revision numbers scanned if revision prefix is specified (Thanks to Ernestas Vaiciukevičius) http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/06af67c4/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java b/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java index fb4338c..c349f2a 100644 --- a/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java +++ b/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java @@ -79,7 +79,7 @@ class ModuleDescriptorMemoryCache { synchronized (valueMap) { CacheEntry entry = valueMap.get(ivyFile); if (entry != null) { - if (entry.isStale(validated, ivySettings)) { + if (entry.isStale(ivyFile, validated, ivySettings)) { Message.debug("Entry is found in the ModuleDescriptorCache but entry should be " + "reevaluated : " + ivyFile); valueMap.remove(ivyFile); @@ -129,8 +129,9 @@ class ModuleDescriptorMemoryCache { this.parserSettingsMonitor = parserSettingsMonitor; } - boolean isStale(boolean validated, ParserSettings newParserSettings) { + boolean isStale(File ivyFile, boolean validated, ParserSettings newParserSettings) { return (validated && !this.validated) + || md.getLastModified() != ivyFile.lastModified() || parserSettingsMonitor.hasChanged(newParserSettings); } }
