6868import com .rabbitmq .stream .impl .Client .StreamMetadata ;
6969import com .rabbitmq .stream .impl .Client .StreamStatsResponse ;
7070import com .rabbitmq .stream .impl .Client .SubscriptionOffset ;
71+ import com .rabbitmq .stream .impl .Utils .MutableBoolean ;
7172import com .rabbitmq .stream .metrics .MetricsCollector ;
7273import io .netty .buffer .ByteBuf ;
7374import io .netty .buffer .ByteBufInputStream ;
8586import java .util .Map ;
8687import java .util .Objects ;
8788import java .util .concurrent .ConcurrentMap ;
88- import java .util .concurrent .atomic .AtomicBoolean ;
8989import org .slf4j .Logger ;
9090import org .slf4j .LoggerFactory ;
9191
@@ -345,7 +345,7 @@ static int handleMessage(
345345 ByteBuf bb ,
346346 int read ,
347347 boolean filter ,
348- AtomicBoolean messageFiltered ,
348+ MutableBoolean messageFiltered ,
349349 long offset ,
350350 long offsetLimit ,
351351 long chunkTimestamp ,
@@ -465,7 +465,6 @@ static int handleDeliver(
465465 final boolean filter = offsetLimit != -1 ;
466466
467467 try {
468- // TODO handle exception in exception handler
469468 chunkChecksum .checksum (message , dataLength , crc );
470469 } catch (ChunkChecksumValidationException e ) {
471470 LOGGER .warn (
@@ -478,7 +477,7 @@ static int handleDeliver(
478477
479478 metricsCollector .chunk (numEntries );
480479 long messagesRead = 0 ;
481- AtomicBoolean messageFiltered = new AtomicBoolean (false );
480+ MutableBoolean messageFiltered = new MutableBoolean (false );
482481
483482 while (numRecords != 0 ) {
484483 byte entryType = message .readByte ();
@@ -539,7 +538,7 @@ static int handleDeliver(
539538 ByteBuf outBb = client .channel .alloc ().heapBuffer (uncompressedDataSize );
540539 ByteBuf slice = message .slice (message .readerIndex (), dataSize );
541540 InputStream inputStream = compressionCodec .decompress (new ByteBufInputStream (slice ));
542- byte [] inBuffer = new byte [uncompressedDataSize < 1024 ? uncompressedDataSize : 1024 ];
541+ byte [] inBuffer = new byte [Math . min ( uncompressedDataSize , 1024 ) ];
543542 int n ;
544543 try {
545544 while (-1 != (n = inputStream .read (inBuffer ))) {
0 commit comments