From 22ccc4c6cd3bceca7dde58bb99fde60555fed531 Mon Sep 17 00:00:00 2001 From: Wolfgang Illmeyer Date: Fri, 3 Mar 2017 13:32:07 +0100 Subject: [PATCH] fix ChangelogEntryTest.testChangelogEntryRendering which failed previously because of wrong cache contents left by some prior test method --- .../gentics/changelogmanager/entry/ChangelogEntryUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gentics/changelogmanager/entry/ChangelogEntryUtils.java b/src/main/java/com/gentics/changelogmanager/entry/ChangelogEntryUtils.java index f0fb370..8c6376e 100644 --- a/src/main/java/com/gentics/changelogmanager/entry/ChangelogEntryUtils.java +++ b/src/main/java/com/gentics/changelogmanager/entry/ChangelogEntryUtils.java @@ -20,14 +20,16 @@ */ public final class ChangelogEntryUtils { + private static File cachedBaseDir; private static Collection cachedChangelogEntryFiles; public static Collection getChangelogEntryFiles(File baseDirectory) { - if (cachedChangelogEntryFiles == null) { + if (cachedChangelogEntryFiles == null || cachedBaseDir == null || !cachedBaseDir.equals(baseDirectory)) { String[] changelogTypes = ChangelogConfiguration.getChangelogTypes().toArray(new String[0]); Collection changelogEntryFiles = FileUtils.listFiles(baseDirectory, changelogTypes, true); cachedChangelogEntryFiles = changelogEntryFiles; + cachedBaseDir = baseDirectory; } return cachedChangelogEntryFiles; }