From a2ce6ef4980c12b690f28fc8be219b2a7083d6fa Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 20 Aug 2024 19:35:00 +0200 Subject: [PATCH] Avoid this escape. --- .../java/com/yahoo/vespa/config/JRTConnectionPool.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java index 2a62d0e1db10..605ccdf6b727 100644 --- a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java +++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java @@ -22,7 +22,7 @@ * @author Gunnar Gauslaa Bergem * @author hmusum */ -public final class JRTConnectionPool implements ConnectionPool { +public class JRTConnectionPool implements ConnectionPool { private static final Logger log = Logger.getLogger(JRTConnectionPool.class.getName()); @@ -91,15 +91,15 @@ synchronized JRTConnection switchConnection() { return currentConnection = newConnection; } - public synchronized JRTConnection initialize() { + private synchronized JRTConnection initialize() { return pickNewConnectionRandomly(getSources()); } - protected JRTConnection pickNewConnectionRandomly(List sources) { + final protected JRTConnection pickNewConnectionRandomly(List sources) { return sources.get(ThreadLocalRandom.current().nextInt(0, sources.size())); } - public List getSources() { + final public List getSources() { List ret; synchronized (connections) { ret = new ArrayList<>(connections.values());