Skip to content

Commit 3fb4651

Browse files
authored
Simplify logic in checkListenerContainerAware method
* More concise and intuitive. * Add author name
1 parent d800e0d commit 3fb4651

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
* @author Yansong Ren
8383
* @author Tim Bourquin
8484
* @author Jeonggi Kim
85+
* @author Java4ye
8586
*
8687
* @since 1.0
8788
*/
@@ -613,12 +614,9 @@ private void checkListenerContainerAware() {
613614
Assert.state(expectedQueueNames.size() == queueNames.length,
614615
"Listener expects us to be listening on '" + expectedQueueNames + "'; our queues: "
615616
+ Arrays.asList(queueNames));
616-
boolean found = false;
617+
boolean found = true;
617618
for (String queueName : queueNames) {
618-
if (expectedQueueNames.contains(queueName)) {
619-
found = true;
620-
}
621-
else {
619+
if (!expectedQueueNames.contains(queueName)) {
622620
found = false;
623621
break;
624622
}

0 commit comments

Comments
 (0)