DataDomain domain = projectController.getCurrentDataDomain();
DataDomain matchingDomain = configuration.getDomain(newName);
if (matchingDomain == null) {
Domain prefs = projectController.getPreferenceDomainForDataDomain();
DomainEvent e = new DomainEvent(this, domain, domain.getName());
ProjectUtil.setDataDomainName(configuration, domain, newName);
prefs.rename(newName);
projectController.fireDomainEvent(e);
}
else if (matchingDomain != domain) {
throw new ValidationException("There is another DataDomain named '"
+ newName