mtedone/podam — pull request #22 by daivanov (2013-11-10 12:22:59+00:00)
Title: Sort POJO constructors and try them in a certain order when constructing POJO

Podam unit tests behave differently in JDK6 and JDK7. In JDK6 for BigInteger creation
BigInteger(int numBits, Random rnd)
is picked up, however, in JDK7
BigInteger(int bitLength, int certainty, Random rnd)
is found first. The latter is really heavy call causing unit tests to do a heavy work for many minutes.

Trying to deal with this problem, I introduced a sorting for POJO constructors, in such a way, that constructors with PodamConstructor annotations will be tried first and then, if not successful, constructors with less parameters will be used one by one until successful object creation. The rationale behind the change is so that in general mocking less parameters should be easier.

Another point is that sorting will make Podam behave more predictable with different JDK versions