@Test public void testSplitAttributeWithExtraneousCommas() throws Exception { Set<String> set = new HashSet<String>(); set.add(LEGACY_QUEUE_ATTRIBUTE); set.add(LEGACY_TEMPORARY_ATTRIBUTE); assertNull(AmqpDestinationHelper.splitAttributesString(null)); assertEquals(set, AmqpDestinationHelper.splitAttributesString(LEGACY_QUEUE_ATTRIBUTE + "," + LEGACY_TEMPORARY_ATTRIBUTE)); assertEquals(set, AmqpDestinationHelper.splitAttributesString(LEGACY_QUEUE_ATTRIBUTE + "," + LEGACY_TEMPORARY_ATTRIBUTE + ",")); assertEquals(set, AmqpDestinationHelper.splitAttributesString("," + LEGACY_QUEUE_ATTRIBUTE + "," + LEGACY_TEMPORARY_ATTRIBUTE)); assertEquals(set, AmqpDestinationHelper.splitAttributesString(LEGACY_QUEUE_ATTRIBUTE + ",," + LEGACY_TEMPORARY_ATTRIBUTE)); assertEquals(set, AmqpDestinationHelper.splitAttributesString(LEGACY_QUEUE_ATTRIBUTE + "," + LEGACY_TEMPORARY_ATTRIBUTE + ",,")); assertEquals(set, AmqpDestinationHelper.splitAttributesString("," + LEGACY_QUEUE_ATTRIBUTE + "," + LEGACY_TEMPORARY_ATTRIBUTE)); }
static Set<String> splitAttributesString(String typeString) { if (typeString == null) { return null; } HashSet<String> typeSet = new HashSet<String>(); for (String attr : typeString.split("\\s*,\\s*")) { if (!attr.equals("")) { typeSet.add(attr); } } return typeSet; }
AmqpDestinationHelper { static Set<String> splitAttributesString(String typeString) { if (typeString == null) { return null; } HashSet<String> typeSet = new HashSet<String>(); for (String attr : typeString.split("\\s*,\\s*")) { if (!attr.equals("")) { typeSet.add(attr); } } return typeSet; } }
AmqpDestinationHelper { static Set<String> splitAttributesString(String typeString) { if (typeString == null) { return null; } HashSet<String> typeSet = new HashSet<String>(); for (String attr : typeString.split("\\s*,\\s*")) { if (!attr.equals("")) { typeSet.add(attr); } } return typeSet; }  }
AmqpDestinationHelper { static Set<String> splitAttributesString(String typeString) { if (typeString == null) { return null; } HashSet<String> typeSet = new HashSet<String>(); for (String attr : typeString.split("\\s*,\\s*")) { if (!attr.equals("")) { typeSet.add(attr); } } return typeSet; }  static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static JmsDestination getJmsReplyTo(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static void setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setReplyToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static void setReplyToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static String getDestinationAddress(JmsDestination destination, AmqpConnection connection); static Symbol toTypeCapability(JmsDestination destination); }
AmqpDestinationHelper { static Set<String> splitAttributesString(String typeString) { if (typeString == null) { return null; } HashSet<String> typeSet = new HashSet<String>(); for (String attr : typeString.split("\\s*,\\s*")) { if (!attr.equals("")) { typeSet.add(attr); } } return typeSet; }  static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static JmsDestination getJmsReplyTo(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static void setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setReplyToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static void setReplyToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static String getDestinationAddress(JmsDestination destination, AmqpConnection connection); static Symbol toTypeCapability(JmsDestination destination); static final Symbol JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL; static final Symbol JMS_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL; static final byte QUEUE_TYPE; static final byte TOPIC_TYPE; static final byte TEMP_QUEUE_TYPE; static final byte TEMP_TOPIC_TYPE; static final Symbol QUEUE_CAPABILITY; static final Symbol TOPIC_CAPABILITY; static final Symbol TEMP_QUEUE_CAPABILITY; static final Symbol TEMP_TOPIC_CAPABILITY; static final byte UNKNOWN_TYPE; }