From cfa9ec20e1b3f0d0c3f328e7ec59c674fdffe8a1 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 3 Nov 2011 14:33:52 +0000 Subject: TUSCANY-3971: JMSBindingProcessor.writeOperationProperties should trim() properties prior to writing them & update logic to write JMS attributes even if properties are null. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1197149 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/jms/JMSBindingProcessor.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'sca-java-2.x/trunk/modules') diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java index b9d7d7a6f6..a428af8812 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java @@ -1304,16 +1304,14 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St Integer jmsPriority = jmsBinding.getOperationJMSPriority(opName); Map operationProperties = jmsBinding.getOperationProperties(opName); - if (operationProperties != null){ - if ((jmsType != null && jmsType.length() > 0) || - (jmsCorrelationId != null && jmsCorrelationId.length() > 0) || - jmsDeliveryMode != null || jmsTimeToLive != null || - jmsPriority != null) { - + if ( (operationProperties != null && !operationProperties.isEmpty()) || (jmsType != null && jmsType.trim().length() > 0) || + jmsDeliveryMode != null || jmsTimeToLive != null || + jmsPriority != null) { + writer.writeStartElement(Constants.SCA11_NS, JMSBindingConstants.HEADERS); - if (jmsType != null && jmsType.length() > 0) { - writer.writeAttribute("type", jmsType); + if (jmsType != null && jmsType.trim().length() > 0) { + writer.writeAttribute("type", jmsType.trim()); } if (jmsDeliveryMode != null) { @@ -1336,7 +1334,6 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St writer.writeEndElement(); // Strange bug. Without white space, headers end tag improperly read. // writer.writeCharacters( " " ); - } } writer.writeEndElement(); -- cgit v1.2.3