*/
private String getLibraryName(Element element) {
if (element == null) {
return StringUtilities.EMPTY;
}
LibraryElement library = element.getLibrary();
if (library == null) {
return StringUtilities.EMPTY;
}
ImportElement[] imports = definingLibrary.getImports();
int count = imports.length;
for (int i = 0; i < count; i++) {
if (imports[i].getImportedLibrary() == library) {
return library.getDefiningCompilationUnit().getDisplayName();
}
}
ArrayList<String> indirectSources = new ArrayList<String>();
for (int i = 0; i < count; i++) {
LibraryElement importedLibrary = imports[i].getImportedLibrary();
for (LibraryElement exportedLibrary : importedLibrary.getExportedLibraries()) {
if (exportedLibrary == library) {
indirectSources.add(importedLibrary.getDefiningCompilationUnit().getDisplayName());
}
}
}
int indirectCount = indirectSources.size();
StringBuilder builder = new StringBuilder();