Source:
<code>protected ICommand getAfterCreateRelationshipCommand(CreateRelationshipRequest request) { ICommand defaultCommand = super.getAfterCreateRelationshipCommand(request); View sourceView = RequestParameterUtils.getSourceView(request); View targetView = RequestParameterUtils.getTargetView(request); if (request.getElementType() instanceof ISpecializationType) { ArrayList<IElementType> elementTypesHierarchy = new ArrayList<IElementType>(); elementTypesHierarchy.add(request.getElementType()); ISpecializationType iSpecializationType = (ISpecializationType) request.getElementType(); elementTypesHierarchy.addAll(Arrays.asList(iSpecializationType.getAllSuperTypes())); if ((elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION)))) { if (sourceView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), sourceView, true); <START> EMFToIEditCommandWrapper editCommandWrapper = new EMFToIEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand <END> = CompositeCommand.compose(defaultCommand, editCommandWrapper); } if (targetView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), targetView, false); EMFToIEditCommandWrapper editCommandWrapper = new EMFToIEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } } } return defaultCommand; }</code><technical_language>lines factorize if/else, if of type Property</technical_language>

Target:
protected ICommand getAfterCreateRelationshipCommand(CreateRelationshipRequest request) { ICommand defaultCommand = super.getAfterCreateRelationshipCommand(request); View sourceView = RequestParameterUtils.getSourceView(request); View targetView = RequestParameterUtils.getTargetView(request); if (request.getElementType() instanceof ISpecializationType) { ArrayList<IElementType> elementTypesHierarchy = new ArrayList<IElementType>(); elementTypesHierarchy.add(request.getElementType()); ISpecializationType iSpecializationType = (ISpecializationType) request.getElementType(); elementTypesHierarchy.addAll(Arrays.asList(iSpecializationType.getAllSuperTypes())); if ((elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION)))) { if (sourceView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), sourceView, true); EMFToIEditCommandWrapper editCommandWrapper = new EMFToCreateElementEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } if (targetView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), targetView, false); EMFToIEditCommandWrapper editCommandWrapper = new EMFToCreateElementEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } } } return defaultCommand; }