ARTEMIS-1135: Fix potential message count overflow
Have `AddressControlImpl::getMessageCount` use and return a `long`. Prevents potential overflow from use of an `int` count variable. Fixes one of the "Implicit narrowing conversion in compound assignment" alerts at https://lgtm.com/projects/g/apache/activemq-artemis/alerts.
This commit is contained in:
parent
33c94635bf
commit
b998a8bdaf
|
@ -331,9 +331,9 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
|
|||
|
||||
// Private -------------------------------------------------------
|
||||
|
||||
private int getMessageCount(final DurabilityType durability) {
|
||||
private long getMessageCount(final DurabilityType durability) {
|
||||
List<QueueControl> queues = getQueues(durability);
|
||||
int count = 0;
|
||||
long count = 0;
|
||||
for (QueueControl queue : queues) {
|
||||
count += queue.getMessageCount();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue