FlexTradeUKLtd / jfixture

JFixture is an open source library based on the popular .NET library, AutoFixture
MIT License
105 stars 22 forks source link

Improve efficiency of SpecimenType.equals #16

Closed richkeenan closed 8 years ago

richkeenan commented 9 years ago

SpecimenType currently creates a new instance of itself if a Type argument is passed into the equals(Object) method. This isn't ideal because nearly every builder checks the incoming request is of a certain type so we end up making loads of unnecessary instances of SpecimenType that get immediately thrown away.

Ideally the equals would work without having to do this. Although at present nothing elegant comes to mind.