Library (String name, @Nullable PersistentLibraryKind<?> kind, @Nullable ProjectModelExternalSource externalSource) { assertWritable(); final LibraryImpl library = new LibraryImpl(name, kind, LibraryTableBase.this, null, externalSource); myLibraries.add(library); if (myWritable) { //myAddedLibraries is used only when the model is committed, so let's not populate it in the main model to save memory myAddedLibraries.add(library); } myLibraryByNameCache = null; return library; }