From c38f251d7b7c74c05771d83dbe7ba365b285f509 Mon Sep 17 00:00:00 2001 From: David Walluck Date: Mon, 24 Aug 2026 15:34:20 -0400 Subject: [PATCH] Fix inverted `isShutdown()` The `isShutdown()` method was inverted, returning whether any tracker was still active as opposed to whether no trackers were active. --- .../jhttpc/INTERNAL/conn/ConnectionManagerCache.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/commonjava/util/jhttpc/INTERNAL/conn/ConnectionManagerCache.java b/src/main/java/org/commonjava/util/jhttpc/INTERNAL/conn/ConnectionManagerCache.java index 46c0a4b..d4f629d 100644 --- a/src/main/java/org/commonjava/util/jhttpc/INTERNAL/conn/ConnectionManagerCache.java +++ b/src/main/java/org/commonjava/util/jhttpc/INTERNAL/conn/ConnectionManagerCache.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (C) 2015-2024 Red Hat, Inc. (https://github.com/Commonjava/jhttpc) * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -91,14 +91,9 @@ public synchronized ConnectionManagerTracker getTrackerFor( SiteConnectionConfig } @Override - public boolean isShutdown() + public synchronized boolean isShutdown() { - if ( !cache.isEmpty() ) - { - return cache.values().stream().filter( tracker -> tracker.isActive() ).findAny().isPresent(); - } - - return true; + return cache.values().stream().noneMatch( ConnectionManagerTracker::isActive ); } @Override