Source:
<code>public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { List<Notification> notifications = event.getNotifications(); notifierWithoutRepresentationDescriptors = new HashSet<>(); notifierToDRepMap = new HashMap<>(); Set<DRepresentationDescriptor> descriptorsToUpdate = new HashSet<>(); Iterator<Notification> notifIterator = notifications.iterator(); while (notifIterator.hasNext()) { Notification notification = notifIterator.next(); Object notifier = notification.getNotifier(); boolean isEObject = notifier instanceof EObject; boolean isTransient = notification.getFeature() instanceof EStructuralFeature && ((EStructuralFeature) notification.getFeature()).isTransient(); if (isEObject && !isTransient && (notifier instanceof IdentifiedElement <START> || notifier instanceof DRepresentation)) <END> { final DRepresentationDescriptor representationDescriptor = getDRepresentationDescriptor((EObject) notifier); if (representationDescriptor != null) { descriptorsToUpdate.add(representationDescriptor); } } else if (isEObject && !isTransient) { EClass eClass = ((EObject) notifier).eClass(); EPackage ePackage = eClass.getEPackage(); if ("notation".equals(ePackage.getNsPrefix())) { final DRepresentationDescriptor representationDescriptor = getDRepresentationDescriptor((EObject) notifier); if (representationDescriptor != null) { descriptorsToUpdate.add(representationDescriptor); } } } } if (!descriptorsToUpdate.isEmpty()) { RecordingCommand changeIdRecordingCommand = new RecordingCommand(transactionalEditingDomain) { @Override protected void doExecute() { for (DRepresentationDescriptor dRepresentationDescriptor : descriptorsToUpdate) { RepresentationHelper.updateChangeId(dRepresentationDescriptor); } } }; return changeIdRecordingCommand; } return null; }</code><technical_language>DRepresentation inherits IdentifiedElement</technical_language>

Target:
public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { List<Notification> notifications = event.getNotifications(); notifierWithoutRepresentationDescriptors = new HashSet<>(); notifierToDRepMap = new HashMap<>(); Set<DRepresentationDescriptor> descriptorsToUpdate = new HashSet<>(); Iterator<Notification> notifIterator = notifications.iterator(); while (notifIterator.hasNext()) { Notification notification = notifIterator.next(); Object notifier = notification.getNotifier(); boolean isEObject = notifier instanceof EObject; boolean isTransient = notification.getFeature() instanceof EStructuralFeature && ((EStructuralFeature) notification.getFeature()).isTransient(); if (isEObject && !isTransient && ViewpointPackage.Literals.IDENTIFIED_ELEMENT.isInstance(notifier)) { final DRepresentationDescriptor representationDescriptor = getDRepresentationDescriptor((EObject) notifier); if (representationDescriptor != null) { descriptorsToUpdate.add(representationDescriptor); } } else if (isEObject && !isTransient) { EClass eClass = ((EObject) notifier).eClass(); EPackage ePackage = eClass.getEPackage(); if ("notation".equals(ePackage.getNsPrefix())) { final DRepresentationDescriptor representationDescriptor = getDRepresentationDescriptor((EObject) notifier); if (representationDescriptor != null) { descriptorsToUpdate.add(representationDescriptor); } } } } if (!descriptorsToUpdate.isEmpty()) { RecordingCommand changeIdRecordingCommand = new RecordingCommand(transactionalEditingDomain) { @Override protected void doExecute() { for (DRepresentationDescriptor dRepresentationDescriptor : descriptorsToUpdate) { RepresentationHelper.updateChangeId(dRepresentationDescriptor); } } }; return changeIdRecordingCommand; } return null; }