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:
Aditya Sharad 2017-04-29 15:34:06 +01:00 committed by Clebert Suconic
parent 33c94635bf
commit b998a8bdaf
1 changed files with 2 additions and 2 deletions

View File

@ -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();
}