Created
November 27, 2014 18:52
-
-
Save panchenko/4a708c053520aec5d57e to your computer and use it in GitHub Desktop.
rabbitmq-java-client-parseAddresses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r a2a05fde0e99 src/com/rabbitmq/client/Address.java | |
--- a/src/com/rabbitmq/client/Address.java Wed Nov 26 13:09:31 2014 +0000 | |
+++ b/src/com/rabbitmq/client/Address.java Fri Nov 28 00:51:02 2014 +0600 | |
@@ -81,6 +81,9 @@ | |
* @return a list of {@link Address} values | |
*/ | |
public static Address[] parseAddresses(String addresses) { | |
+ if (addresses == null || addresses.length() == 0) { | |
+ return new Address[0]; | |
+ } | |
String[] addrs = addresses.split(" *, *"); | |
Address[] res = new Address[addrs.length]; | |
for (int i = 0; i < addrs.length; i++) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment