I believe that I have found very interested undocumented bug in Salesforce.
I don't see in the documentation saying that List.sort method implementation depends on version, but looks like it does. If one reads SFDC Documentation on List sort method here and here, one may get impression that for list of SObject records of the same type with different names, the sort method will always sort them by name disregarding the version of class where the sort method is called, but it is wrong impression.
In fact, if you moved a single line of code
from a controller class with version 37 to some DAO class of version 19 you may find that list of SObject records now are sorted in some wrong order. They are no longer sorted alphabetically by the name. If you call that method again in controller class with version 37, the records will be sorted correctly. Also if you change the version of DAO Class from version 19 to version 37, the records will be also sorted as expected.
I wonder why the implementation of sort method has changed?
Does anyone know in which order Salesforce sorts SObject records if using version 19?