Description:
|
(rep by Rick Mann)
In JavaDeserializer.JavaDeserializer(Class cl):
When computing the cost of a constructor, int types are used. One of our constructors has 13 parameters, resulting in an overflow error. That is, the resulting value exceeds the signed MAX_INT, so the result becomes negative (Java really needs unsigned types), and thus more complex constructors get a lower computed cost. I changed the type of cost and bestCost to be long, and that accommodated our constructor, but this approach doesn't scale. Perhaps BigDecimal is better? Or, choose the no-arg constructor directly when found, or don't compute full cost until comparing two constructors with the same number of arguments...many possibilities.
|