no such method error: ImmutableList.copyOf()

Guava is a fully compatible superset of Google Collections — we did not change anything in an incompatible way. (This is tested by running the entire Google Collections test suite (which is extensive) against the lastest guava jar.)

I believe you have a copy of google-collect-*.jar still makings its way into your classpath. Either explicitly, or because some other jar included it without repackaging it. You just have to find it and remove it.

In Google Collections, there was an ImmutableList.copyOf(Iterable) method, and there was no public ImmutableList.copyOf(Collection) method. Which is fine, because a collection is also an iterable. In Guava, we’ve added the Collection overload. This is completely compatible, as all source that used to compile still can, and any source previously compiled will simply still reference the original method.

The problem comes in if you compile against Guava but then run against Google Collections. I believe that is likely what is happening.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)