Wednesday, January 10, 2018

GWT and Guava collect

Hi all.
I am checking out Google Guava, and how to use it in GWT, but having a problem with it.

It seems that I can use things from com.google.common.base (Joiner, Splitter, Strings, MoreObjects) without a problem.

But when I try to use something from com.google.common.collect like Lists or FluentIterable the compiler spits out an error.

For example when trying List<Person> personList = Lists.newArrayList(person1, person2, person3, person4);

[ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/GwtPlatform.java' [ERROR] Line 38: The method createFrom(T[], int) is undefined for the type Array Tracing compile failure path for type 'com.google.common.collect.GwtPlatform' [ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/GwtPlatform.java' [ERROR] Line 38: The method createFrom(T[], int) is undefined for the type Array [ERROR] Hint: Your source appears not to live underneath a subpackage called 'client'; no problem, but you'll need to use the <source> directive in your module to make it accessible

Anyone has any idea what is going on ?

I added guava-gwt-23.0.jar and guava-gwt-23.0.jar from https://github.com/google/guava/wiki/Release23 to my classpath.

Using GWT2.8.2

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment