From b7b16a880baed9fa9b3e61f220b5b5a705904ad6 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Tue, 18 May 2021 11:08:26 +0200 Subject: [PATCH] review comment: improve readability Signed-off-by: Ludovic Orban --- .../src/main/java/org/eclipse/jetty/util/Pool.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java index ba20f2235a8..183b169249a 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java @@ -462,13 +462,16 @@ public class Pool implements AutoCloseable, Dumpable for (Entry entry : copy) { boolean removed = entry.tryRemove(); - if (!removed) + if (removed) + { + if (entry.pooled instanceof Closeable) + IO.close((Closeable)entry.pooled); + } + else { if (LOGGER.isDebugEnabled()) LOGGER.debug("Pooled object still in use: {}", entry); } - if (removed && entry.pooled instanceof Closeable) - IO.close((Closeable)entry.pooled); } }