Source:
public static ModelSet createModelSet() { ServicesRegistry service = new ServicesRegistry(); ServiceDescriptor descriptor = new ServiceDescriptor(ModelSet.class, ModelSetServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10); descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory); service.add(descriptor); descriptor = new ServiceDescriptor(TransactionalEditingDomain.class, EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10, Collections.singletonList(ModelSet.class.getName())); descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory); service.add(descriptor); try { service.startRegistry(); } catch (ServiceMultiException e) { Activator.log.error(e); } ModelSet modelSet = null; try { modelSet = ServiceUtils.getInstance().getModelSet(service); } catch (ServiceException e) { } if (modelSet == null) { modelSet = new ModelSet(); try { ModelSetServiceFactory.setServiceRegistry(modelSet, service); } catch (ServiceException e) { } } IMultiDiagramEditor serviceDiagram = new CoreMultiDiagramEditor(); service.add(IMultiDiagramEditor.class, 10, serviceDiagram); descriptor = new ServiceDescriptor(ISaveAndDirtyService.class, SaveAndDirtyService.class.getName(), ServiceStartKind.STARTUP, 10); service.add(descriptor); descriptor = new ServiceDescriptor(ILifeCycleEventsProvider.class, LifeCycleEventsProviderServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10); descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory); service.add(descriptor); try { service.startRegistry(); } catch (ServiceMultiException e) { Activator.log.error(e); } IServiceFactory servicefactory = new RefactorServiceFactory(); try { servicefactory.init(service); servicefactory.startService(); service.add(IRefactorService.class, 10, servicefactory.createServiceInstance()); service.startRegistry(); } catch (ServiceException e) { Activator.log.error(e); } return modelSet; }

Target:
public static ModelSet createModelSet() { ServicesRegistry registry = new ServicesRegistry(); ServiceDescriptor descriptor = new ServiceDescriptor(ModelSet.class, ModelSetServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10); descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory); registry.add(descriptor); descriptor = new ServiceDescriptor(TransactionalEditingDomain.class, EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10, Collections.singletonList(ModelSet.class.getName())); descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory); registry.add(descriptor); try { registry.startRegistry(); } catch (ServiceMultiException e) { Activator.log.error(e); } ModelSet modelSet = null; try { modelSet = ServiceUtils.getInstance().getModelSet(registry); } catch (ServiceException e) { } if (modelSet == null) { modelSet = new ModelSet(); try { ModelSetServiceFactory.setServiceRegistry(modelSet, registry); } catch (ServiceException e) { } } IServiceFactory servicefactory = new RefactorServiceFactory(); try { servicefactory.init(registry); servicefactory.startService(); registry.add(IRefactorService.class, 10, servicefactory.createServiceInstance()); registry.startRegistry(); } catch (ServiceException e) { Activator.log.error(e); } return modelSet; }