daemon-m39/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java [47:77]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public PluginVersionResult resolve(PluginVersionRequest request) throws PluginVersionResolutionException {
        Map<String, PluginVersionResult> cache =
                getCache(request.getRepositorySession().getData());
        String key = getKey(request);
        PluginVersionResult result = cache.get(key);
        if (result == null) {
            result = super.resolve(request);
            cache.putIfAbsent(key, result);
        }
        return result;
    }

    @SuppressWarnings("unchecked")
    private Map<String, PluginVersionResult> getCache(SessionData data) {
        Map<String, PluginVersionResult> cache = (Map<String, PluginVersionResult>) data.get(CACHE_KEY);
        while (cache == null) {
            cache = new ConcurrentHashMap<>(256);
            if (data.set(CACHE_KEY, null, cache)) {
                break;
            }
            cache = (Map<String, PluginVersionResult>) data.get(CACHE_KEY);
        }
        return cache;
    }

    private static String getKey(PluginVersionRequest request) {
        return Stream.concat(
                        Stream.of(request.getGroupId(), request.getArtifactId()),
                        request.getRepositories().stream().map(RemoteRepository::getId))
                .collect(Collectors.joining(":"));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



daemon-m40/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java [61:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public PluginVersionResult resolve(PluginVersionRequest request) throws PluginVersionResolutionException {
        Map<String, PluginVersionResult> cache =
                getCache(request.getRepositorySession().getData());
        String key = getKey(request);
        PluginVersionResult result = cache.get(key);
        if (result == null) {
            result = super.resolve(request);
            cache.putIfAbsent(key, result);
        }
        return result;
    }

    @SuppressWarnings("unchecked")
    private Map<String, PluginVersionResult> getCache(SessionData data) {
        Map<String, PluginVersionResult> cache = (Map<String, PluginVersionResult>) data.get(CACHE_KEY);
        while (cache == null) {
            cache = new ConcurrentHashMap<>(256);
            if (data.set(CACHE_KEY, null, cache)) {
                break;
            }
            cache = (Map<String, PluginVersionResult>) data.get(CACHE_KEY);
        }
        return cache;
    }

    private static String getKey(PluginVersionRequest request) {
        return Stream.concat(
                        Stream.of(request.getGroupId(), request.getArtifactId()),
                        request.getRepositories().stream().map(RemoteRepository::getId))
                .collect(Collectors.joining(":"));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



