This is an automated email from the ASF dual-hosted git repository.

vavrtom pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/main by this push:
     new c2d67baa9e QPID-8571: Aligning with Broker-J code standards
c2d67baa9e is described below

commit c2d67baa9ec81c89b873ec009a6190fe4d9b5367
Author: Tomas Vavricka <vavr...@apache.org>
AuthorDate: Mon Feb 10 08:56:57 2025 +0100

    QPID-8571: Aligning with Broker-J code standards
---
 .../org/apache/qpid/server/protocol/v0_8/AMQChannel.java    | 13 ++++++-------
 .../java/org/apache/qpid/tests/protocol/v0_8/BasicTest.java |  8 ++++++--
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git 
a/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
 
b/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
index 3c4a14a219..4bb581413f 100644
--- 
a/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
+++ 
b/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
@@ -568,16 +568,15 @@ public class AMQChannel extends 
AbstractAMQPSession<AMQChannel, ConsumerTarget_0
     {
         if (tag == null)
         {
-            do {
+            do
+            {
                 tag = AMQShortString.createAMQShortString("sgen_" + 
getNextConsumerTag());
             }
-            while(_nonGeneratedTags.contains(tag));
+            while (_nonGeneratedTags.contains(tag));
         }
-        else {
-            if(!_nonGeneratedTags.add(tag)) {
-                throw new ConsumerTagInUseException("Consumer already exists 
with same tag: " + tag);
-            }
-
+        else if (!_nonGeneratedTags.add(tag))
+        {
+            throw new ConsumerTagInUseException("Consumer already exists with 
same tag: " + tag);
         }
 
         if (_tag2SubscriptionTargetMap.containsKey(tag))
diff --git 
a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/BasicTest.java
 
b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/BasicTest.java
index dd7e8ed779..a59d8a19f6 100644
--- 
a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/BasicTest.java
+++ 
b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/BasicTest.java
@@ -20,7 +20,11 @@
  */
 package org.apache.qpid.tests.protocol.v0_8;
 
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
@@ -294,7 +298,7 @@ public class BasicTest extends BrokerAdminUsingTestBase
             "a unique tag, not clashing with an existing tag")
     public void serverGeneratedTagUniqueness() throws Exception
     {
-        try(FrameTransport transport = new 
FrameTransport(getBrokerAdmin()).connect())
+        try (FrameTransport transport = new 
FrameTransport(getBrokerAdmin()).connect())
         {
             final Interaction interaction = transport.newInteraction();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to