ModelTransferableGraphSourceRequst.composeTGValueModifier has been broken for a long time
I don't know how this has escaped us but ModelTransferableGraphSourceRequest.composeTGValueModifier has been broken ever since it was introduced in SVN commit
r32932 | lehtonen | 2016-06-29 19:03:10 +0000 (Wed, 29 Jun 2016) | 5 lines
which merged other earlier commits that I don't care too much about browsing backwards in time anymore. However this particular commit changed the code constructing TGValueModifier
list from this:
ArrayList<TGValueModifier> valueModifiers =
configuration.valueModifiers == null
? new ArrayList<TGValueModifier>(2)
: new ArrayList<TGValueModifier>(configuration.valueModifiers);
valueModifiers.add(new ResourceTGValueModifier(ss));
valueModifiers.add(RevisionTGValueModifier.INSTANCE);
this.valueModifier = new ComposedTGValueModifier(
valueModifiers.toArray(new TGValueModifier[valueModifiers.size()]));
to this:
private TGValueModifier composeTGValueModifier(Collection<TGValueModifier> configuredModifiers) {
List<TGValueModifier> valueModifiers = configuredModifiers == null ? new ArrayList<>(2) : new ArrayList<>(configuredModifiers.size() + 2);
valueModifiers.add(new ResourceTGValueModifier(support));
valueModifiers.add(RevisionTGValueModifier.INSTANCE);
return new ComposedTGValueModifier(valueModifiers.toArray(new TGValueModifier[valueModifiers.size()]));
}
which is obviously broken.
The function has since its inception taken the externally configured TGValueModifier
s (via TransferableGraphConfiguration2
) as an argument but didn't have the strength to actually add those to the returned value List<TGValueModifier>
. So the code always only uses two built-in TGValueModifiers and that's it.
This broke org.simantics.event
based event DB structure export used in Apros so that it never actually used a separately configured TGValueModifier
whose purpose was to time-shift events (modify their timestamps).