camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [6/6] camel git commit: CAMEL-11772 - Fix potential ClassCastException when creating the message ID in camel-sjms and camel-jms
Date Wed, 13 Sep 2017 07:47:28 GMT
CAMEL-11772 - Fix potential ClassCastException when creating the message ID in camel-sjms and
camel-jms


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d0dbdff
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d0dbdff
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d0dbdff

Branch: refs/heads/camel-2.18.x
Commit: 7d0dbdffb0c2761dd32e37be1fa21f3dde4bbce6
Parents: bcfb5f8
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Sep 13 09:45:17 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Sep 13 09:47:15 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/jms/JmsMessage.java     | 9 ++++-----
 .../java/org/apache/camel/component/sjms/SjmsMessage.java   | 7 +++----
 2 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7d0dbdff/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
index 2a757a0..ca956b1 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
@@ -236,11 +236,10 @@ public class JmsMessage extends DefaultMessage {
         }
         try {
             String id = getDestinationAsString(jmsMessage.getJMSDestination());
-            if(id != null) {
+            if (id != null) {
                 id += jmsMessage.getJMSMessageID();
-            }
-            else {
-                id = super.createMessageId();
+            } else {
+                id = jmsMessage.getJMSMessageID();
             }
             return getSanitizedString(id);
         } catch (JMSException e) {
@@ -263,7 +262,7 @@ public class JmsMessage extends DefaultMessage {
             result = "null destination!" + File.separator;
         } else if (destination instanceof Topic) {
             result = "topic" + File.separator + ((Topic) destination).getTopicName() + File.separator;
-        } else if (destination instanceof Queue){
+        } else if (destination instanceof Queue) {
             result = "queue" + File.separator + ((Queue) destination).getQueueName() + File.separator;
         }
         return result;

http://git-wip-us.apache.org/repos/asf/camel/blob/7d0dbdff/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
----------------------------------------------------------------------
diff --git a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
index 4cc83ce..771fe94 100644
--- a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
+++ b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsMessage.java
@@ -249,11 +249,10 @@ public class SjmsMessage extends DefaultMessage {
         }
         try {
             String id = getDestinationAsString(jmsMessage.getJMSDestination());
-            if(id != null) {
+            if (id != null) {
                 id += jmsMessage.getJMSMessageID();
-            }
-            else {
-                id = super.createMessageId();
+            } else {
+                id = jmsMessage.getJMSMessageID();
             }
             return getSanitizedString(id);
         } catch (JMSException e) {


Mime
View raw message