Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-849

PropertyChangeHandlerSupport notifyHandlers() - new handlers cannot be added/removed from inside existing property change handler

    Details

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      I have to add property change handlers with Scheduler.get().scheduleDeferred(), but it's quite ugly solution.

      Show
      I have to add property change handlers with Scheduler.get().scheduleDeferred(), but it's quite ugly solution.

      Description

          for (PropertyChangeHandler handler : handlers) {
            handler.onPropertyChange(event);
          }
      

      must be replaced by something else (temporary local list), because if I wish to add new handlers or remove existing ones when processing property change notification, handlers iterator becomes invalid and fails within ArrayList:

              final void checkForComodification() {
                  if (modCount != expectedModCount)
                      throw new ConcurrentModificationException();
              }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                csa Christian Sadilek
                Reporter:
                slavap Slava Pankov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: