Handler Caching #37

Merged
kske merged 5 commits from f/handler-caching into develop 2022-01-18 17:11:38 +01:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 2d276a1d74 - Show all commits

View File

@ -423,7 +423,7 @@ public final class EventBus {
var it = binding.iterator();
while (it.hasNext()) {
var handler = it.next();
if (handler.getListener() == listener) {
if (handler.getListener().equals(listener)) {
logger.log(Level.DEBUG, "Unbinding event handler {0}", handler);
it.remove();
}
@ -435,7 +435,7 @@ public final class EventBus {
var it = binding.iterator();
while (it.hasNext()) {
var handler = it.next();
if (handler.getListener() == listener) {
if (handler.getListener().equals(listener)) {
kske marked this conversation as resolved Outdated
Outdated
Review

Maybe add a comment on why == instead of equals.

Maybe add a comment on why `==` instead of `equals`.
Outdated
Review

As we implicitly test using equals in registerListener(...), I will change this as well.

As we implicitly test using `equals` in `registerListener(...)`, I will change this as well.
logger.log(Level.TRACE, "Removing event handler {0} from cache", handler);
it.remove();
}