You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quite often, there are more unique differences than "normal" differences.
These normal differences are counted via ActionReplayResult#getElementDifferences(), whereas the unique differences are counted via ActionReplayResult#getUniqueDifferences(). As can been seen, getElementDifferences() simply uses StateDifferences#getNonEmptyDifferences(), but getUniqueDifferences() calls getElementDifferences() and "unwraps" the contained differences (which can be different types).
If we assume that all possible differences of an element are wrapped inside an ElementDifference, then getUniqueDifferences() contains at least the number of differences as getElementDifferences(). But if a single element has multiple differences, e.g., two attribute changes, then getUniqueDifferences() leads to more differences than getElementDifferences().
This is confusing because one expects "unique" to be less than "normal". So, we should probably adapt the naming scheme. For instance:
getElementDifferences() => getElementDifferences() since it returns the list of differences of all elements that have changed.
getUniqueDifferences() => getAllDifferences() since it unwraps each ElementDifference into one or more AttributesDifference, IdentifyingAttributesDifference, DurationDifference or InsertedDeletedElementDifference.
The text was updated successfully, but these errors were encountered:
@martin-v isn't this a bug as existing functionality is broken? We want to improve the external quality, not just the internal one. So why refactoring instead of the bug?
Quite often, there are more unique differences than "normal" differences.
These normal differences are counted via
ActionReplayResult#getElementDifferences()
, whereas the unique differences are counted viaActionReplayResult#getUniqueDifferences()
. As can been seen,getElementDifferences()
simply usesStateDifferences#getNonEmptyDifferences()
, butgetUniqueDifferences()
callsgetElementDifferences()
and "unwraps" the contained differences (which can be different types).If we assume that all possible differences of an element are wrapped inside an
ElementDifference
, thengetUniqueDifferences()
contains at least the number of differences asgetElementDifferences()
. But if a single element has multiple differences, e.g., two attribute changes, thengetUniqueDifferences()
leads to more differences thangetElementDifferences()
.This is confusing because one expects "unique" to be less than "normal". So, we should probably adapt the naming scheme. For instance:
getElementDifferences()
=>getElementDifferences()
since it returns the list of differences of all elements that have changed.getUniqueDifferences()
=>getAllDifferences()
since it unwraps eachElementDifference
into one or moreAttributesDifference
,IdentifyingAttributesDifference
,DurationDifference
orInsertedDeletedElementDifference
.The text was updated successfully, but these errors were encountered: