Source:
<code>protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); EdgeStyleDescription esd = StyleFactory.eINSTANCE.createEdgeStyleDescription(); <START> esd.setSizeComputationExpression("2"); esd.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); <END> newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.EDGE_MAPPING__STYLE, esd)); BracketEdgeStyleDescription bsd = StyleFactory.eINSTANCE.createBracketEdgeStyleDescription(); bsd.setSizeComputationExpression("2"); bsd.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.EDGE_MAPPING__STYLE, bsd)); ConditionalEdgeStyleDescription conditionalEdgeStyle = DescriptionFactory.eINSTANCE.createConditionalEdgeStyleDescription(); EdgeStyleDescription edgeStyle = ((EdgeMapping) object).getStyle(); EdgeStyleDescription newStyle; if (edgeStyle != null && edgeStyle.eClass() == StylePackage.eINSTANCE.getBracketEdgeStyleDescription()) { newStyle = StyleFactory.eINSTANCE.createBracketEdgeStyleDescription(); } else { newStyle = StyleFactory.eINSTANCE.createEdgeStyleDescription(); } newStyle.setSizeComputationExpression("2"); newStyle.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); conditionalEdgeStyle.setStyle(newStyle); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.EDGE_MAPPING__CONDITIONNAL_STYLES, conditionalEdgeStyle)); }</code><technical_language>this code is duplicated (4x)</technical_language>

Target:
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); EdgeStyleDescription esd = StyleFactory.eINSTANCE.createEdgeStyleDescription(); edgeStyleInit(esd); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.EDGE_MAPPING__STYLE, esd)); BracketEdgeStyleDescription bsd = StyleFactory.eINSTANCE.createBracketEdgeStyleDescription(); edgeStyleInit(bsd); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.EDGE_MAPPING__STYLE, bsd)); ConditionalEdgeStyleDescription conditionalEdgeStyle = DescriptionFactory.eINSTANCE.createConditionalEdgeStyleDescription(); EdgeStyleDescription edgeStyle = ((EdgeMapping) object).getStyle(); EdgeStyleDescription newStyle; if (edgeStyle != null && edgeStyle.eClass() == StylePackage.eINSTANCE.getBracketEdgeStyleDescription()) { newStyle = StyleFactory.eINSTANCE.createBracketEdgeStyleDescription(); } else { newStyle = StyleFactory.eINSTANCE.createEdgeStyleDescription(); } edgeStyleInit(newStyle); conditionalEdgeStyle.setStyle(newStyle); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.EDGE_MAPPING__CONDITIONNAL_STYLES, conditionalEdgeStyle)); }