void (@NotNull Disposable disposable) { if (myEditors.size() < 2) return; for (FileEditor editor : myEditors) { editor.addPropertyChangeListener(this); } Disposer.register(disposable, new Disposable() { @Override public void dispose() { for (FileEditor editor : myEditors) { editor.removePropertyChangeListener(MySynchronizer.this); } } }); }