}
if (!(dialect instanceof Dialect)) {
log(IStatus.ERROR,String.format("%s is not a dialect",dialect.getClass().getName()));
continue;
}
Dialect d = (Dialect) dialect;
{
Class<? extends Dialect> previous = dialectByName.put(name, d.getClass());
if (previous != null) {
log(IStatus.ERROR,String.format(EXTENSION_MARKUP_DIALECT+"/@name '%s' specified by plugin '%s' is ignored: name '%s' is already registered",name,element.getDeclaringExtension().getContributor().getName(),name));
dialectByName.put(name, previous);
continue;
}
}
String fileExtensions = element.getAttribute("fileExtensions");
if (fileExtensions != null) {
String[] parts = fileExtensions.split("\\s*,\\s*");
for (String part: parts) {
if (part.length() != 0) {
Class<? extends Dialect> previous = dialectByFileExtension.put(part, d.getClass());
if (previous != null) {
log(IStatus.ERROR,String.format(EXTENSION_MARKUP_DIALECT+"/@fileExtensions '%s' specified by plugin '%s' is ignored: extension '%s' is already registered",part,element.getDeclaringExtension().getContributor().getName(),part));
dialectByFileExtension.put(part, previous);
continue;
}