From commits-return-50477-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Fri Feb 9 03:12:35 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id A88B018064F for ; Fri, 9 Feb 2018 03:12:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 985A2160C5E; Fri, 9 Feb 2018 02:12:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B66ED160C4A for ; Fri, 9 Feb 2018 03:12:34 +0100 (CET) Received: (qmail 57715 invoked by uid 500); 9 Feb 2018 02:12:33 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 57703 invoked by uid 99); 9 Feb 2018 02:12:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2018 02:12:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 946FCDFABA; Fri, 9 Feb 2018 02:12:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: michaelpearce@apache.org To: commits@activemq.apache.org Date: Fri, 09 Feb 2018 02:12:33 -0000 Message-Id: <6255f016c01e4c399ed9fdaa409a612d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] activemq-artemis git commit: ARTEMIS-853 - Coverity fixes Repository: activemq-artemis Updated Branches: refs/heads/master 4ef6e3281 -> 01748b9c4 ARTEMIS-853 - Coverity fixes Fix coverity findings. Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1ddeb065 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1ddeb065 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1ddeb065 Branch: refs/heads/master Commit: 1ddeb065f1875cca920e5408a0f606de952d8b19 Parents: 4ef6e32 Author: Michael André Pearce Authored: Thu Feb 8 23:51:04 2018 +0000 Committer: Michael André Pearce Committed: Fri Feb 9 00:54:41 2018 +0000 ---------------------------------------------------------------------- .../impl/wireformat/CreateQueueMessage_V2.java | 10 ++++++++-- .../wireformat/CreateSharedQueueMessage_V2.java | 20 ++++++++++++++++---- .../SessionBindingQueryResponseMessage_V4.java | 10 ++++++++-- .../SessionQueueQueryResponseMessage_V3.java | 10 ++++++++-- .../artemis/jms/client/ActiveMQSession.java | 2 +- 5 files changed, 41 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1ddeb065/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java ---------------------------------------------------------------------- diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java index 4ffeb5c..baccc36 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java @@ -182,9 +182,15 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage { return false; if (purgeOnNoConsumers != other.purgeOnNoConsumers) return false; - if (exclusive != other.exclusive) + if (exclusive == null) { + if (other.exclusive != null) + return false; + } else if (!exclusive.equals(other.exclusive)) return false; - if (lastValue != other.lastValue) + if (lastValue == null) { + if (other.lastValue != null) + return false; + } else if (!lastValue.equals(other.lastValue)) return false; if (routingType == null) { if (other.routingType != null) http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1ddeb065/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java ---------------------------------------------------------------------- diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java index 8763043..d220915 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java @@ -192,13 +192,25 @@ public class CreateSharedQueueMessage_V2 extends CreateSharedQueueMessage { return false; if (requiresResponse != other.requiresResponse) return false; - if (maxConsumers != other.maxConsumers) + if (maxConsumers == null) { + if (other.maxConsumers != null) + return false; + } else if (!maxConsumers.equals(other.maxConsumers)) return false; - if (purgeOnNoConsumers != other.purgeOnNoConsumers) + if (purgeOnNoConsumers == null) { + if (other.purgeOnNoConsumers != null) + return false; + } else if (!purgeOnNoConsumers.equals(other.purgeOnNoConsumers)) return false; - if (exclusive != other.exclusive) + if (exclusive == null) { + if (other.exclusive != null) + return false; + } else if (!exclusive.equals(other.exclusive)) return false; - if (lastValue != other.lastValue) + if (lastValue == null) { + if (other.lastValue != null) + return false; + } else if (!lastValue.equals(other.lastValue)) return false; return true; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1ddeb065/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java ---------------------------------------------------------------------- diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java index 0d08d99..ca0e9f7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java @@ -140,9 +140,15 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe return false; if (defaultMaxConsumers != other.defaultMaxConsumers) return false; - if (defaultExclusive != other.defaultExclusive) + if (defaultExclusive == null) { + if (other.defaultExclusive != null) + return false; + } else if (!defaultExclusive.equals(other.defaultExclusive)) return false; - if (defaultLastValue != other.defaultLastValue) + if (defaultLastValue == null) { + if (other.defaultLastValue != null) + return false; + } else if (!defaultLastValue.equals(other.defaultLastValue)) return false; return true; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1ddeb065/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java ---------------------------------------------------------------------- diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java index 12f2a7b..b982744 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java @@ -216,9 +216,15 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon return false; if (purgeOnNoConsumers != other.purgeOnNoConsumers) return false; - if (exclusive != other.exclusive) + if (exclusive == null) { + if (other.exclusive != null) + return false; + } else if (!exclusive.equals(other.exclusive)) return false; - if (lastValue != other.lastValue) + if (lastValue == null) { + if (other.lastValue != null) + return false; + } else if (!lastValue.equals(other.lastValue)) return false; if (routingType == null) { if (other.routingType != null) http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1ddeb065/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java ---------------------------------------------------------------------- diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java index a0ccfcc..5f29211 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java @@ -1173,7 +1173,7 @@ public class ActiveMQSession implements QueueSession, TopicSession { } } - private void createSharedQueue(ActiveMQDestination destination, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException { + private void createSharedQueue(ActiveMQDestination destination, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException { QueueAttributes queueAttributes = destination.getQueueAttributes(); if (queueAttributes == null) { session.createSharedQueue(destination.getSimpleAddress(), routingType, queueName, filter, durable, maxConsumers, purgeOnNoConsumers, exclusive, lastValue);