Source:
public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { List<Notification> notifications = event.getNotifications(); notifierWithoutRepresentationDescriptors = new HashSet<>(); notifierToDRepMap = new HashMap<>(); Set<DRepresentationDescriptor> descriptorsToUpdate = new HashSet<>(); Set<DRepresentationDescriptor> descriptorsToIgnore = 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); } if (ViewpointPackage.Literals.DREPRESENTATION_DESCRIPTOR.isInstance(notifier) && notification.getFeature() instanceof EAttribute && ViewpointPackage.Literals.DREPRESENTATION_DESCRIPTOR__CHANGE_ID.equals(notification.getFeature())) { descriptorsToIgnore.add((DRepresentationDescriptor) notifier); } } 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); } } } } descriptorsToUpdate.removeAll(descriptorsToIgnore); if (!descriptorsToUpdate.isEmpty()) { RecordingCommand changeIdRecordingCommand = new RecordingCommand(transactionalEditingDomain) { @Override protected void doExecute() { for (DRepresentationDescriptor dRepresentationDescriptor : descriptorsToUpdate) { RepresentationHelper.updateChangeId(dRepresentationDescriptor); } } }; return changeIdRecordingCommand; } return null; }

Target:
public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { List<Notification> notifications = event.getNotifications(); notifierWithoutRepresentationDescriptors = new HashSet<>(); notifierToDRepMap = new HashMap<>(); Set<DRepresentationDescriptor> descriptorsToUpdate = new HashSet<>(); Set<DRepresentationDescriptor> descriptorsToIgnore = 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); } if (ViewpointPackage.Literals.DREPRESENTATION_DESCRIPTOR.isInstance(notifier) && ViewpointPackage.Literals.DREPRESENTATION_DESCRIPTOR__CHANGE_ID.equals(notification.getFeature())) { descriptorsToIgnore.add((DRepresentationDescriptor) notifier); } } 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); } } } } descriptorsToUpdate.removeAll(descriptorsToIgnore); if (!descriptorsToUpdate.isEmpty()) { RecordingCommand changeIdRecordingCommand = new RecordingCommand(transactionalEditingDomain) { @Override protected void doExecute() { for (DRepresentationDescriptor dRepresentationDescriptor : descriptorsToUpdate) { RepresentationHelper.updateChangeId(dRepresentationDescriptor); } } }; return changeIdRecordingCommand; } return null; }