Harvest Sorting

In expanders versions < 4.0.0, the order of anchors in the harvest files was defined by the order they added in by the java implementation of the expander. In expanders 4.0.0 and higher, the harvest occurs automatically and the harvested anchors are sorted by one of two options:

Default sorting

By default, the harvest will sorted by the following order:

  1. the anchors custom-imports, custom-variables and custom-methods will always occur first, in that order.
  2. the rest of the anchors will be sorted alphabetically

This order is used by default because it is stable towards future versions of the expanders. E.g. some methods in the bean may change place when they are extracted as features. Also, introduced features do not have a strictly deterministic ordering when introducing new features. Because of this, this order will introduce less changes to harvest files than the next ordering.

The 3 ‘priority anchors’ are placed at the start because this introduces less changes in the harvest files to the versions before 4.0.0 and because they will improve readability for the most harvest files.

Order by appearance

If the expansionOption sortHarvestByAppearance is defined, harvested anchors will keep the order they appeared in in the file. This has the advantage of producing more readable harvest files. It may also produce less changes than the alphabetic order of the default sorting to versions before 4.0.0.

This can, however, introduce changes in the harvest files each time an expander is updated and is thus less transparent when updating expander versions.


Release Expander version Change
2019.5.1 4.0.1 implemented