Revert "Revert "[ATS-988] Fixed Intermittent failure (ConcurrentModificationException) caused by a new call to getData() from configScheduler. (#1103)" (#1148)" (#1158)

This reverts commit bf3e7390f5.
This commit is contained in:
kcichonczyk
2022-06-14 10:22:59 +02:00
committed by GitHub
parent 767f513aa5
commit b88fab188e

View File

@@ -369,7 +369,7 @@ public class RenditionDefinitionRegistry2Impl implements RenditionDefinitionRegi
renditionNamesWithMaxSize = data.renditionsFor.get(sourceMimetype); renditionNamesWithMaxSize = data.renditionsFor.get(sourceMimetype);
if (renditionNamesWithMaxSize == null) if (renditionNamesWithMaxSize == null)
{ {
renditionNamesWithMaxSize = getRenditionNamesWithMaxSize(sourceMimetype); renditionNamesWithMaxSize = getRenditionNamesWithMaxSize(data, sourceMimetype);
data.renditionsFor.put(sourceMimetype, renditionNamesWithMaxSize); data.renditionsFor.put(sourceMimetype, renditionNamesWithMaxSize);
} }
} }
@@ -394,10 +394,9 @@ public class RenditionDefinitionRegistry2Impl implements RenditionDefinitionRegi
// Gets a list of rendition names that can be created from the given sourceMimetype. // Gets a list of rendition names that can be created from the given sourceMimetype.
// Includes the maxSize for each. // Includes the maxSize for each.
private Set<Pair<String,Long>> getRenditionNamesWithMaxSize(String sourceMimetype) private Set<Pair<String,Long>> getRenditionNamesWithMaxSize(Data data, String sourceMimetype)
{ {
Set<Pair<String,Long>> renditions = new HashSet(); Set<Pair<String,Long>> renditions = new HashSet();
Data data = getData();
for (Map.Entry<String, RenditionDefinition2> entry : data.renditionDefinitions.entrySet()) for (Map.Entry<String, RenditionDefinition2> entry : data.renditionDefinitions.entrySet())
{ {
RenditionDefinition2 renditionDefinition2 = entry.getValue(); RenditionDefinition2 renditionDefinition2 = entry.getValue();