* @see CompileTimeErrorCode#IMPORT_DUPLICATED_LIBRARY_NAME
*/
private boolean checkForImportDuplicateLibraryName(ImportDirective node,
ImportElement importElement) {
// prepare imported library
LibraryElement nodeLibrary = importElement.getImportedLibrary();
if (nodeLibrary == null) {
return false;
}
String name = nodeLibrary.getName();
// check if there is other imported library with the same name
LibraryElement prevLibrary = nameToImportElement.get(name);
if (prevLibrary != null) {
if (!prevLibrary.equals(nodeLibrary)) {
errorReporter.reportErrorForNode(
StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME,
node,
prevLibrary.getDefiningCompilationUnit().getDisplayName(),
nodeLibrary.getDefiningCompilationUnit().getDisplayName(),
name);
return true;
}
} else {