Class EMFCompareChangeRecorder
java.lang.Object
org.eclipse.emf.ecore.change.util.ListDifferenceAnalyzer
org.eclipse.emf.ecore.change.util.BasicChangeRecorder
org.eclipse.emf.ecore.change.util.ChangeRecorder
org.eclipse.emf.compare.domain.impl.EMFCompareChangeRecorder
- All Implemented Interfaces:
Adapter,Adapter.Internal
This custom implementation of a change recorder will avoid copying the internal lists every time they're
needed as they can grow to very large sizes along with the size of the compared models.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
Adapter.Internal -
Field Summary
Fields inherited from class org.eclipse.emf.ecore.change.util.ChangeRecorder
eObjectToProxyURIMap, loadingTargets, originalTargetObjects, resolveProxies, targetObjectsFields inherited from class org.eclipse.emf.ecore.change.util.BasicChangeRecorder
changeDescription, recording, recordingTransientFeatures -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginRecording(ChangeDescription changeDescription, Collection<?> rootObjects) This avoids growing the "originalTargetObjects" and "setOriginalTargetObjects" collections indefinitely during the same comparison each time a merge is executed.protected voidSee bug 562321.protected ChangeDescriptionprotected voidhandleFeature(EStructuralFeature feature, EReference containment, Notification notification, EObject eObject) The "setOriginalTargetObjects" Set is used to register target objects instead of the "originalTargetObjects" list to avoid duplicates, and fill this list with the bare minimum afterwards, for optimization purposes.voidOverrides the superclass method to ignore the "originalTargetObjets" list since we never resume recording a paused change description.Methods inherited from class org.eclipse.emf.ecore.change.util.ChangeRecorder
addAdapter, beginRecording, dispose, getEObjectToProxyURIMap, getTarget, handleResource, handleTarget, isAdapterForType, isOrphan, isResolveProxies, notifyChanged, prepareChangeDescriptionForResume, removeAdapter, setEObjectToProxyURIMap, setResolveProxies, shouldRecord, unsetTargetMethods inherited from class org.eclipse.emf.ecore.change.util.BasicChangeRecorder
createFeatureChange, createResourceChange, eliminateEmptyChanges, endRecording, finalizeChange, finalizeChange, getChangeDescription, getFeatureChange, getFeatureChanges, getResourceChange, getResourceChanges, isRecording, isRecordingTransientFeatures, setChangeDescription, setRecording, setRecordingTransientFeatures, shouldRecord, summarizeMethods inherited from class org.eclipse.emf.ecore.change.util.ListDifferenceAnalyzer
analyzeLists, analyzeLists, createAddListChange, createListChange, createListChanges, createMoveListChange, createRemoveListChange, equal
-
Constructor Details
-
EMFCompareChangeRecorder
public EMFCompareChangeRecorder()
-
-
Method Details
-
setTarget
Overrides the superclass method to ignore the "originalTargetObjets" list since we never resume recording a paused change description.- Specified by:
setTargetin interfaceAdapter- Overrides:
setTargetin classChangeRecorder
-
handleFeature
protected void handleFeature(EStructuralFeature feature, EReference containment, Notification notification, EObject eObject) The "setOriginalTargetObjects" Set is used to register target objects instead of the "originalTargetObjects" list to avoid duplicates, and fill this list with the bare minimum afterwards, for optimization purposes.- Overrides:
handleFeaturein classChangeRecorder
-
beginRecording
This avoids growing the "originalTargetObjects" and "setOriginalTargetObjects" collections indefinitely during the same comparison each time a merge is executed.- Overrides:
beginRecordingin classChangeRecorder
-
consolidateChanges
protected void consolidateChanges()See bug 562321. Some Sirius objects that changed during merging may become orphans and were removed by the org.eclipse.emf.ecore.change.util.ChangeRecorder#consolidateChanges() method. So we fill the originalTargetObjects list with these orphaned objects to keep them.- Overrides:
consolidateChangesin classChangeRecorder
-
createChangeDescription
- Overrides:
createChangeDescriptionin classBasicChangeRecorder
-