Community
Participate
Working Groups
EmfFormatter.printInt can stabilize the length of a formatted Integer, but unhelpfully this is used to stabilize the index of a list entry as in FamilyPlanning { cref SurnamePlan surnamePlans [ 0 : SurnamePlan { attr EString name 'Flanders' For me, the sole use case of EmfFormatter is its excellent utility for comparing two models in a way that JUnit renders helpfully. However if a 9-element list is compared with an 11-element list, all entries are reported as different because the "0" index is stabilized as the two digit "1 " to match the max length of any index. Please remove the stabilization at line 118. (Also at line 62 "innerIdent" should be "innerIndent").
I am not sure if changing this would lead to semantic api changes and thus annoy people but maybe that could be done configurable
Obviously any change is a semantic API breakage; it's just a matter of whether it's reasonable or not. For the compare-equals use case, it makes no difference since equality of two serializations is unaffected. There is an issue of equality with a saved EmfFormatter serialization, but I have always avoided that since certainly I never regarded EMFFormatter as stable. I always compare EMFFormatter serializations of a new / old Resource not a new / old EMFFormatter serialization. For the human browsing use case, the change is a fractional improvement, but EmfFormatter is not very good for humans anyway. I find an EMF tree or pure XMI better. If you have other use cases and they are affected, then WONTFIX. If not it's a minor bug fix.
I think it wouldn't do any harm to add an option that allows to disable the padding.