|
@@ -67,13 +67,13 @@ public class DomainRegistry {
|
|
|
private static List<IDomain> domainDescriptors;
|
|
|
|
|
|
public static List<IDomain> getDomains() {
|
|
|
- if (domainDescriptors == null) {
|
|
|
- domainDescriptors = Lists.newArrayList();
|
|
|
- if (Platform.isRunning()) {
|
|
|
+ synchronized (domainDescriptors) {
|
|
|
+ if (domainDescriptors == null) {
|
|
|
+ domainDescriptors = Lists.newArrayList();
|
|
|
initFromExtensions();
|
|
|
}
|
|
|
+ return domainDescriptors;
|
|
|
}
|
|
|
- return domainDescriptors;
|
|
|
}
|
|
|
|
|
|
public static IDomain getDomain(final String id) {
|
|
@@ -105,8 +105,10 @@ public class DomainRegistry {
|
|
|
Iterables.find(getDomains(), new Predicate<IDomain>() {
|
|
|
@Override
|
|
|
public boolean apply(IDomain input) {
|
|
|
- return input.getDomainID().equals(domainID == null || domainID.isEmpty()
|
|
|
- ? BasePackage.Literals.DOMAIN_ELEMENT__DOMAIN_ID.getDefaultValueLiteral() : domainID);
|
|
|
+ return input.getDomainID()
|
|
|
+ .equals(domainID == null || domainID.isEmpty()
|
|
|
+ ? BasePackage.Literals.DOMAIN_ELEMENT__DOMAIN_ID.getDefaultValueLiteral()
|
|
|
+ : domainID);
|
|
|
}
|
|
|
});
|
|
|
} catch (NoSuchElementException e) {
|
|
@@ -175,6 +177,7 @@ public class DomainRegistry {
|
|
|
}
|
|
|
}), provider);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* Efficient parser to determine the DomainId without loading the whole resource
|
|
|
*
|