ollie314 / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

IsArray constructor takes array instead of Collection #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Since you took of that last issue so quickly... :-)

I also notice that IsArray is the only one of the collection matchers that
takes an array of Matchers, rather than a List (most case) or Collection
(IsArrayContainingInAnyOrder). Apart from preferring consistency, my issue
with this is that the argument type is an array of a parameterized type,
which can't be created except through a varargs method, and even then a
compiler warning is generated.

A second factory method should also be added that takes a collection. See
IsArrayContainingInOrder for a model. This provides the option of building
the matcher list some other way and avoiding the compiler warning.

Original issue reported on code.google.com by mhack...@kanayo.com on 26 Apr 2009 at 9:30

GoogleCodeExporter commented 8 years ago
At first glance, it looks to me like IsArray is now redundant with 
IsArrayContainingInOrder and that we should 
just remove it.

Original comment by smgfree...@gmail.com on 27 Apr 2009 at 1:10

GoogleCodeExporter commented 8 years ago
Yes, I suppose that is true. I don't know why I chose IsArray of
IsArrayContainingInOrder. I guess it just looked simpler. :-)   Oh well, if you 
can
delete some unused code, that's always good.

Thanks, Steve.

Original comment by mhack...@kanayo.com on 27 Apr 2009 at 1:57