ExistingLibraryEditor (Library library) { if (library instanceof LibraryEx) { final Library source = ((LibraryEx)library).getSource(); if (source != null) { return getLibraryEditor(source); } } ExistingLibraryEditor libraryEditor = myLibrary2EditorMap.get(library); if (libraryEditor == null){ libraryEditor = createLibraryEditor(library); } return libraryEditor; }