[Engine-devel] Use java.util.Collection where possible?

Yair Zaslavsky yzaslavs at redhat.com
Thu Mar 1 15:18:03 UTC 2012


Hi,
I see that in some places in engine-core we use Java.Util.List, or even
Java.Util.ArrayList as types of method arguments, while in the method
code we do nothing besides iterating over the collection.
I then found all kinds of usages like this:

x.foo(new ArrayList<MyType>(myMap.values()));

As you can see need to instantiate a new ArrayList in order to use the
values of the map in method foo.
Do you see any reason why not change the argument type (at method
signature) to Collection in such places, where possible?

Yair




More information about the Engine-devel mailing list