List<MarketDataSpecification> specifications = defaultExecutionOptions.getMarketDataSpecifications();
if (!specifications.isEmpty()) {
specifications = new ArrayList<>(specifications);
boolean changed = false;
for (int i = 0; i < specifications.size(); i++) {
final MarketDataSpecification specification = specifications.get(i);
if (specification instanceof LiveMarketDataSpecification) {
final String dataSource = ((LiveMarketDataSpecification) specification).getDataSource();
if (dataSource != null && getNamedMarketDataSpecificationRepository() != null) {
final MarketDataSpecification namedSpec = getNamedMarketDataSpecificationRepository().getSpecification(dataSource);
if (namedSpec != null && !namedSpec.equals(specification)) {
s_logger.info("Replacing live data {} with named spec {}", dataSource, namedSpec);
specifications.set(i, namedSpec);
changed = true;
}
}