mtedone / podam

PODAM - POjo DAta Mocker
https://mtedone.github.io/podam
MIT License
326 stars 749 forks source link

Fix for https://github.com/devopsfolks/podam/issues/234 #235

Closed Otanikotani closed 7 years ago

Otanikotani commented 7 years ago

This is one possible solution to fix the bug with raw ArrayList. This adds type manufacturers for ArrayList, LinkedList and HashSet, so those manufacturers will take precedence over the Cloneable manufacturer.

daivanov commented 7 years ago

And then someone will try to produce non-generic Vector and this won't work :)

daivanov commented 7 years ago

Well, I can merge your tests, but now this is not super easy due to conflict in AbstractRandomDataProviderStrategy. Could you please amend your commit for this?

Otanikotani commented 7 years ago

And then someone will try to produce non-generic Vector and this won't work :)

Yeah, you are right. Well, there is still a fallback with CollectionTypeManufacturer for other collection types, and of course someone who still uses Vector class is able to add the custom typemanufacturer. Maybe it will make them realize that those days are gone!

daivanov commented 7 years ago

Now Vector should be fine. The main problem here is that using ArrayList instead of List is a coupling problem as it imposes unnecessary constraint on a POJO's interface.