* @param librarySource the source of the library's defining compilation unit
* @return the library object that was created
*/
private ResolvableLibrary createLibraryOrNull(Source librarySource) {
ResolvableLibrary library = new ResolvableLibrary(librarySource);
SourceEntry sourceEntry = cache.get(librarySource);
if (sourceEntry instanceof DartEntry) {
LibraryElementImpl libraryElement = (LibraryElementImpl) sourceEntry.getValue(DartEntry.ELEMENT);
if (libraryElement != null) {
library.setLibraryElement(libraryElement);
}
}
libraryMap.put(librarySource, library);