ox-it/wl-feedback — pull request #44 by nicholaswilson100 (2014-11-07 16:29:22+00:00)
Title: WL-3645 : Add the site contact first then the site updaters

Minor pain this one as the site contact (which needs to be first in the dropdown) actually depends on the site updaters (which are currently added first).

The logic is that if there are site updaters then the site contact gets added if there is one, but if there are no site updaters, then the site contact is added if it exists or else if there is no site contact then weblearn@it.ox.ac.uk.

At the moment the code adds the site updaters then the site contact based on this logic so I first tried looking for a hashmap that had an insert-at-head method but that also retained insertion order (which doesn't exist) and then I tried adding the site contact at the end still and looked in the Collections API for hashmap reversal (which doesn't exist). So finally I created 2 hashmaps, one for the drop down list and a submap of this for the site updaters (to do the logic from).

This way seemed the best from a readability, simplicity, fewest lines of code, most elegant point of view.