Source:
public static AgeDiagram createAgeDiagram(final org.osate.ge.diagram.Diagram mmDiagram, final ExtensionRegistryService extRegistry) { Objects.requireNonNull(extRegistry, "extRegistry is null"); final AgeDiagram ageDiagram = new AgeDiagram(getMaxIdForChildren(mmDiagram) + 1); final DiagramType diagramType; final String diagramTypeId = mmDiagram.getConfig() == null || mmDiagram.getConfig().getType() == null ? CustomDiagramType.ID : mmDiagram.getConfig().getType(); diagramType = extRegistry.getDiagramTypeById(diagramTypeId) .orElseGet(() -> new UnrecognizedDiagramType(diagramTypeId)); final DiagramConfigurationBuilder configBuilder = new DiagramConfigurationBuilder(diagramType, false); if (mmDiagram.getConfig() != null) { final org.osate.ge.diagram.DiagramConfiguration mmDiagramConfig = mmDiagram.getConfig(); configBuilder.setContextBoReference(convert(mmDiagramConfig.getContext())); final org.osate.ge.diagram.AadlPropertiesSet enabledAadlProperties = mmDiagramConfig .getEnabledAadlProperties(); if (enabledAadlProperties != null) { for (final String enabledProperty : enabledAadlProperties.getProperty()) { configBuilder.addAadlProperty(enabledProperty); } } configBuilder.connectionPrimaryLabelsVisible(mmDiagramConfig.getConnectionPrimaryLabelsVisible()); } ageDiagram.modify("Configure Diagram", m -> { m.setDiagramConfiguration(configBuilder.build()); }); if (ageDiagram.getConfiguration().getContextBoReference() == null) { throw new RuntimeException("Contextless diagrams are not supported"); } ageDiagram.modify("Read from File", m -> readElements(m, extRegistry, ageDiagram, mmDiagram, new HashSet<>(), false)); return ageDiagram; }

Target:
public static AgeDiagram createAgeDiagram(final org.osate.ge.diagram.Diagram mmDiagram, final ExtensionRegistryService extRegistry) { Objects.requireNonNull(extRegistry, "extRegistry is null"); final AgeDiagram ageDiagram = new AgeDiagram(getMaxIdForChildren(mmDiagram) + 1); final String diagramTypeId = mmDiagram.getConfig() == null || mmDiagram.getConfig().getType() == null ? CustomDiagramType.ID : mmDiagram.getConfig().getType(); final DiagramType diagramType = extRegistry.getDiagramTypeById(diagramTypeId) .orElseGet(() -> new UnrecognizedDiagramType(diagramTypeId)); final DiagramConfigurationBuilder configBuilder = new DiagramConfigurationBuilder(diagramType, false); if (mmDiagram.getConfig() != null) { final org.osate.ge.diagram.DiagramConfiguration mmDiagramConfig = mmDiagram.getConfig(); configBuilder.setContextBoReference(convert(mmDiagramConfig.getContext())); final org.osate.ge.diagram.AadlPropertiesSet enabledAadlProperties = mmDiagramConfig .getEnabledAadlProperties(); if (enabledAadlProperties != null) { for (final String enabledProperty : enabledAadlProperties.getProperty()) { configBuilder.addAadlProperty(enabledProperty); } } configBuilder.connectionPrimaryLabelsVisible(mmDiagramConfig.getConnectionPrimaryLabelsVisible()); } ageDiagram.modify("Configure Diagram", m -> { m.setDiagramConfiguration(configBuilder.build()); }); if (ageDiagram.getConfiguration().getContextBoReference() == null) { throw new RuntimeException("Contextless diagrams are not supported"); } ageDiagram.modify("Read from File", m -> readElements(m, extRegistry, ageDiagram, mmDiagram, new HashSet<>(), false)); return ageDiagram; }