Repository: ant-ivy Updated Branches: refs/heads/master 9967600bd -> c4bb60046
Throw an IllegalStateException when retrieving the resolutionCacheRoot on the DefaultResolutionCacheManager if the basedir (or IvySettings) is not set (IVY-1482) Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/c4bb6004 Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/c4bb6004 Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/c4bb6004 Branch: refs/heads/master Commit: c4bb60046de9ffdd1cf07cfcdba201df06b194dd Parents: 9967600 Author: Maarten Coene <maart...@apache.org> Authored: Tue Dec 13 00:48:36 2016 +0100 Committer: Maarten Coene <maart...@apache.org> Committed: Tue Dec 13 00:48:36 2016 +0100 ---------------------------------------------------------------------- doc/release-notes.html | 1 + .../apache/ivy/core/cache/DefaultResolutionCacheManager.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/c4bb6004/doc/release-notes.html ---------------------------------------------------------------------- diff --git a/doc/release-notes.html b/doc/release-notes.html index 085e494..688d722 100644 --- a/doc/release-notes.html +++ b/doc/release-notes.html @@ -68,6 +68,7 @@ List of changes since Ivy 2.4.0: - FIX: Dependencies failed using branch attribute (and extra attributes) (IVY-1141) (Thanks to Stephen Haberman) - FIX: useCacheOnly should allow lookup of changing dependencies in cache (IVY-1515) (Thanks to Ilya) +- IMPROVEMENT: Throw an IllegalStateException when retrieving the resolutionCacheRoot on the DefaultResolutionCacheManager if the basedir (or IvySettings) is not set (IVY-1482) - IMPROVEMENT: Optimization: limit the revision numbers scanned if revision prefix is specified (Thanks to Ernestas Vaiciukevičius) - IMPROVEMENT: Update bouncycastle to 1.52 (IVY-1521) (Thanks to Michal Srb) http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/c4bb6004/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java b/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java index d6bc2d7..9c42144 100644 --- a/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java +++ b/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java @@ -74,6 +74,12 @@ public class DefaultResolutionCacheManager implements ResolutionCacheManager, Iv } public File getResolutionCacheRoot() { + if (basedir == null) { + if (settings == null) { + throw new IllegalStateException("The 'basedir' or 'IvySettings' has not been set on the ResolutionCacheManager"); + } + basedir = settings.getDefaultResolutionCacheBasedir(); + } return basedir; } @@ -213,7 +219,7 @@ public class DefaultResolutionCacheManager implements ResolutionCacheManager, Iv } public void clean() { - FileUtil.forceDelete(getBasedir()); + FileUtil.forceDelete(getResolutionCacheRoot()); } private static class CacheParserSettings implements ParserSettings {