I have the following code that I wrote in groovy 1.8
someListOfLists.flatten().sort().unique()
I switched to groovy 2.3.x and eclipse (using the e4.4 GroovyEclipse plugin for Juno from the snapshot release) shows that the sort () method is now deprecated for sort(Collection<T> self) , which we recommend using sort(Iterable<T> self) .
How do I now combine methods like this to avoid failure warnings?
I thought that since flatten () returns an ArrayList ( which is Iterable ), this should be fine. In addition, I see what to do.
((Iterable) someListOfLists.flatten()).sort().unique()
removes the warning but looks ugly.
So, is this just an eclipse, not seeing that the correct type will actually be used, or is there some other way to express my chain of methods?
source share