void () { final List<ExistingLibraryEditor> libraryEditors = new ArrayList<>(myLibrary2EditorMap.values()); myLibrary2EditorMap.clear(); for (ExistingLibraryEditor libraryEditor : libraryEditors) { libraryEditor.commit(); // TODO: is seems like commit will recreate the editor, but it should not Disposer.dispose(libraryEditor); } if (!libraryEditors.isEmpty() || !myRemovedLibraries.isEmpty() || myLibrariesModifiableModel != null && myLibrariesModifiableModel.isChanged()) { getLibrariesModifiableModel().commit(); myLibrariesModifiableModel = null; } myRemovedLibraries.clear(); }