Github user redsanket commented on the pull request:
https://github.com/apache/storm/pull/1073#issuecomment-183687936
The original implementation would return -1 in any case if the port is not
bound yet. If we not changing the final outcome and unless we are concerned
about throwing an exception when the port is not bound, I guess it would be
fine. Moreover, removing if condition would keep trying to find the port
recursively until it finds it I presume. The original code only tries once as
per my understanding.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---