[CDO] Should a CDORevision already have changes of RevisionDelta applied? [message #1857849] |
Wed, 01 March 2023 14:29 |
Linuxhippy Mising name Messages: 71 Registered: July 2009 |
Member |
|
|
Hello,
Should a CDORevision already have the changes listed in its revision delta applied to it?
The reason I ask is I am currently debugging a diff-viewer table, which works as expected but in some corner-cases fails to show the correct values of the attributes of a revision.
It basically does (siplified) the following steps:
Revision revision = (Revision) cell.getElement(); // get revision of current row of the table
CDORevisionKey cdoRevisionKey = revision.getRevisionKey();
((CDORevisionDelta) cdoRevisionKey).getFeatureDeltas(); // search through all deltas
searching through the feature-deltas (by comparing the changed feature) finds a changed attribute named gwSubstanceGroup , which is a list which was previously empty and now has a single element ("CKW") added to it:
CDOFeatureDelta[gwSubstanceGroup, LIST, originSize=0, list=[CDOFeatureDelta[gwSubstanceGroup, ADD, value=CKW, index=0]]]
However, when I try to load the value that attribute had in this revision, I simply get null:
Object value = ((InternalCDORevision) revision).getValue(iemfProperty);
whereas iemfProperty is exactly the feature which matched the delta before:
org.eclipse.emf.ecore.impl.EAttributeImpl@4aae8619 (name: gwSubstanceGroup) (ordered: true, unique: true, lowerBound: 0, upperBound: -1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (iD: false)
Digging a bit into getValue the offset is calculated and really, the position in the Object[] just contains null. To me it seems the revision contains the attribute-values without the changes (delta) applied to it.
I came to this conclusion, because the next (newer) revision contains the modifications listed in the current feature delta. So e.g. revision 1 contains the delta but not the actual modifications, revision 2 does in contrast not contain the delta information but the values are set there...
Any ideas about what is happening here would be greatly appreciated.
Best regards, Clemens
PS: We are using CDO 4.9 unfortunatly
[Updated on: Wed, 01 March 2023 15:47] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01719 seconds