GitHub user eribeiro opened a pull request:
https://github.com/apache/kafka/pull/183
MINOR: MockClient's disconnect() method has two bugs
(and a prospetive refactoring)
* First, it compares Strings using `==` instead of `equals()`
* Second, it tries to remove a String from a Set<Integer>. As disconnect()
method is only called by a single method on SenderTest then it's safe to
refactor it to make it both explicit that its argument is a node id and perform
a Integer.valueOf() before trying to remove from `ready`.
* Third, not a bug, but the Iterator logic can be simplified, shrinking the
scope of the Iterator without changing the logic.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/eribeiro/kafka mockclient-disconnect
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/183.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 #183
----
commit 91189feb46e16b17a86596a011e12df9fefbbb49
Author: Edward Ribeiro <[email protected]>
Date: 2015-09-01T03:24:04Z
MINOR: MockClient's disconnect() method has two bugs (and a prospetive
refactoring)
* First, it compares Strings using `==` instead of `equals()`
* Second, it tries to remove a String from a Set<Integer>. As disconnect()
method is only called by a single method on SenderTest then it's safe to
refactor it to make it both explicity that its argument is a node id and do a
Integer.valueOf() before trying to remove from `ready`.
* Third, not a bug, but the Iterator logic can be simplified, shrinking the
scope of the Iterator without changing the logic.
----
---
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.
---