From 6e6184a4253ef068b8909cc0a59db54cf28a6d5d Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 6 Jan 2022 19:35:19 -0500 Subject: [PATCH] Lombok for noCacheing and CacheErrors --- .../org/hl7/fhir/r5/context/TerminologyCache.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java index 0740792e7..9f72487e4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java @@ -40,6 +40,7 @@ import java.util.*; import java.util.stream.Collectors; import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult; @@ -121,12 +122,15 @@ public class TerminologyCache { private Object lock; private String folder; private Map caches = new HashMap(); + @Getter @Setter private static boolean noCaching; + + @Getter @Setter private static boolean cacheErrors; static { String cacheErrorsProperty = System.getProperty("fhir.txcache.cacheErrors"); - cacheErrors = cacheErrorsProperty != null && "TRUE".equals(cacheErrorsProperty.toUpperCase(Locale.ROOT)); + setCacheErrors(cacheErrorsProperty != null && "TRUE".equals(cacheErrorsProperty.toUpperCase(Locale.ROOT))); } // use lock from the context @@ -553,14 +557,6 @@ public class TerminologyCache { return b.toString(); } - public static boolean isNoCaching() { - return noCaching; - } - - public static void setNoCaching(boolean noCaching) { - TerminologyCache.noCaching = noCaching; - } - public void removeCS(String url) { synchronized (lock) { String name = getNameForSystem(url);