diff --git a/metafix/src/main/java/org/metafacture/metafix/Metafix.java b/metafix/src/main/java/org/metafacture/metafix/Metafix.java index d4e360e7..f335e94d 100644 --- a/metafix/src/main/java/org/metafacture/metafix/Metafix.java +++ b/metafix/src/main/java/org/metafacture/metafix/Metafix.java @@ -79,6 +79,7 @@ public class Metafix implements StreamPipe, Maps { // checkstyle private final Map> maps = new HashMap<>(); private final Map fixCache = new HashMap<>(); private final Map macros = new HashMap<>(); + private final Map pathCache = new HashMap<>(); private final Map vars = new HashMap<>(); private final RecordTransformer recordTransformer; private final StreamFlattener flattener = new StreamFlattener(); @@ -149,6 +150,10 @@ public void literal(final String name, final String value) { } public String resolvePath(final String path) { + return pathCache.computeIfAbsent(path, this::resolvePathInternal); + } + + private String resolvePathInternal(final String path) { final String resolvedPath; if (isValidUrl(path)) {