Skip to content

Commit 50d6265

Browse files
committed
Sonar polishing of previous commit
1 parent 3ca85b9 commit 50d6265

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ private Connection connectionFromCache() {
695695
ChannelCachingConnectionProxy cachedConnection = findIdleConnection();
696696
long now = System.currentTimeMillis();
697697
if (cachedConnection == null) {
698-
cachedConnection = waitForConnection(cachedConnection, now);
698+
cachedConnection = waitForConnection(now);
699699
}
700700
if (cachedConnection == null) {
701701
if (countOpenConnections() >= this.connectionLimit
@@ -734,7 +734,8 @@ else if (!cachedConnection.isOpen()) {
734734
}
735735

736736
@Nullable
737-
private ChannelCachingConnectionProxy waitForConnection(ChannelCachingConnectionProxy cachedConnection, long now) {
737+
private ChannelCachingConnectionProxy waitForConnection(long now) {
738+
ChannelCachingConnectionProxy cachedConnection = null;
738739
while (cachedConnection == null && System.currentTimeMillis() - now < this.channelCheckoutTimeout) {
739740
if (countOpenConnections() >= this.connectionLimit) {
740741
try {

0 commit comments

Comments
 (0)