GitHub user peterableda opened a pull request: https://github.com/apache/kafka/pull/1269
KAFKA-3622: Use descriptive error message if port number is missing from url A new exception is thrown in *parseAndValidateAddresses* method when the port number is missing from the url. The change was not trivial as the previous implementation of *getHost* and *getPort* both returned *null* if ex. the port number was missing from the url. To fix this behaviour I added some extra test cases and examples to the unit tests with the expected behaviour and modified the *HOST_PORT_PATTERN* regex and the above mentioned methods. You can merge this pull request into a Git repository by running: $ git pull https://github.com/peterableda/kafka KAFKA-3622 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1269.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1269 ---- commit 16f58fb973497fd8b947e6a2d0fcdd2d423693d9 Author: Peter Ableda <peter.abl...@cloudera.com> Date: 2016-04-26T10:25:08Z Fix getHost and getPort methods to parse URLs without port numbers commit 73181f4bd52f4dbf2e83aee3472a3666d74b969c Author: Peter Ableda <peter.abl...@cloudera.com> Date: 2016-04-26T10:34:34Z Add specific message in case of missing port from url ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---