- final Iterable<Class<? extends Object>> allTypes = this.getNotificationTypes(notification);
- Iterable<NotificationListener<? extends Object>> listenerToNotify = Collections.<NotificationListener<? extends Object>>emptySet();
- for (final Class<? extends Object> type : allTypes) {
- Collection<NotificationListener<? extends Object>> _get = this.listeners.get(((Class<? extends Notification>) type));
- Iterable<NotificationListener<? extends Object>> _plus = Iterables.<NotificationListener<? extends Object>>concat(listenerToNotify, _get);
- listenerToNotify = _plus;
- }
- final Function1<NotificationListener<? extends Object>,NotifyTask> _function = new Function1<NotificationListener<? extends Object>,NotifyTask>() {
- @Override
- public NotifyTask apply(final NotificationListener<? extends Object> it) {
- NotifyTask _notifyTask = new NotifyTask(it, notification);
- return _notifyTask;
+ final Set<NotificationListenerRegistration<?>> toNotify = new HashSet<>();
+
+ for (final Class<?> type : getNotificationTypes(notification)) {
+ final Collection<NotificationListenerRegistration<?>> l = listeners.get((Class<? extends Notification>) type);
+ if (l != null) {
+ toNotify.addAll(l);