Source:
protected static ICommand getRTPortKindChangeCommand(Port port, boolean service, boolean wired, boolean behavior, VisibilityKind visibility) { RTPort rtPort = getStereotypeApplication(port); if (rtPort == null) { return UnexecutableCommand.INSTANCE; } TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(port); IElementEditService provider = ElementEditServiceUtils.getCommandProvider(port); IElementEditService rtProvider = ElementEditServiceUtils.getCommandProvider(rtPort); CompositeTransactionalCommand command = new CompositeTransactionalCommand(domain, "Setting RTPort Kind"); command.add(provider.getEditCommand(new SetRequest(port, UMLPackage.eINSTANCE.getPort_IsBehavior(), behavior))); command.add(provider.getEditCommand(new SetRequest(port, UMLPackage.eINSTANCE.getPort_IsService(), service))); command.add(provider.getEditCommand(new SetRequest(port, UMLPackage.eINSTANCE.getNamedElement_Visibility(), visibility))); command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_IsWired(), wired))); command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_IsPublish(), !wired && service))); if (wired) { command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_Registration(), PortRegistrationType.AUTOMATIC))); command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_RegistrationOverride(), ""))); } return command; }

Target:
protected static ICommand getRTPortKindChangeCommand(Port port, boolean service, boolean wired, boolean behavior, VisibilityKind visibility) { RTPort rtPort = getStereotypeApplication(port); if (rtPort == null) { return UnexecutableCommand.INSTANCE; } TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(port); IElementEditService provider = ElementEditServiceUtils.getCommandProvider(port); IElementEditService rtProvider = ElementEditServiceUtils.getCommandProvider(rtPort); CompositeTransactionalCommand command = new CompositeTransactionalCommand(domain, "Setting RTPort Kind"); if (port.isBehavior() != behavior) { command.add(provider.getEditCommand(new SetRequest(port, UMLPackage.eINSTANCE.getPort_IsBehavior(), behavior))); } if (port.isService() != service) { command.add(provider.getEditCommand(new SetRequest(port, UMLPackage.eINSTANCE.getPort_IsService(), service))); } if (port.getVisibility() != visibility) { command.add(provider.getEditCommand(new SetRequest(port, UMLPackage.eINSTANCE.getNamedElement_Visibility(), visibility))); } if (rtPort.isWired() != wired) { command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_IsWired(), wired))); } if (rtPort.isPublish() != (!wired && service)) { command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_IsPublish(), !wired && service))); } if (wired) { if (rtPort.getRegistration() != PortRegistrationType.AUTOMATIC) { command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_Registration(), PortRegistrationType.AUTOMATIC))); } if (!"".equals(rtPort.getRegistrationOverride())) { command.add(rtProvider.getEditCommand(new SetRequest(rtPort, UMLRealTimePackage.eINSTANCE.getRTPort_RegistrationOverride(), ""))); } } return command.reduce(); }