gwt-download

39 views
Skip to first unread message

Tom Sorgie

unread,
Apr 16, 2009, 5:37:35 PM4/16/09
to Google Collections Library - users list

I hope i didn't miss somewhere that you guys explained this, but i
don't see an obvious way to get the the collections library working in
gwt. I see the annotation, but expected to see a different download
for include in gwt.

We're really excited to get moving with the 1.0 google-collections
branch with gwt, and would fully understand if its still volatile.

Is it available somewhere, and if not, is there a cmd, to build the
gwt jar?

thanks.

tom.

Kevin Bourrillion

unread,
Apr 16, 2009, 6:40:53 PM4/16/09
to Tom Sorgie, Google Collections Library - users list
RC2 or RC3 is planned to include a gwt module that should work for you right out of the box.  If any user would like to try building this themselves, I've just checked the necessary emulation classes into svn:
http://code.google.com/p/google-collections/source/browse/#svn/trunk/gwtemul/com/google/common/

It would be outstanding if someone could get that working in ant and send us the patch!

This, I think, would be enough to make the code work in GWT, but you still can't serialize things like ImmutableList back and forth from client to server; for that we need to also copy out our *_CustomFieldSerializer classes into svn as well, which we'll try to get to soon.
--
Kevin Bourrillion @ Google
internal:  http://go/javalibraries
google-collections.googlecode.com
google-guice.googlecode.com

Alen Vrecko

unread,
Apr 18, 2009, 8:25:34 AM4/18/09
to Google Collections Library - users list
Hi, Kevin.

I was able to get it working without to much troubles. But it is far
from ideal. There are some issues beside Serialization

1) Gwt compatible classes make use of java.util.concurrent
(TimeUnit,AtomicInteger, ConcurrentMap,ConcurrentHashMap) and
java.util.Properties. This classes are not available in GWT.

Whole java concurrent package is just plain deceiving in GWT since JS
is Single Threaded.

My workaround is to just emulate the missing classes with super-
source.

2) jsr305 Nullable is not available in GWT. I've used super-source
once again.

3) Joiner and AbstractImutableMultimap should be annotated with
@GwtCompatible

4) I've also emulated java.io.* with do nothing classes. Better
solution is maybe to automatically rewrite the @GwtIncompatible
methods to throw an exception or something like that.

I think that is about it. It goes without saying you guys rock! It is
very cool to know that collections will soon be available for gwt.

Cheers,
Alen

On Apr 17, 12:40 am, Kevin Bourrillion <kev...@google.com> wrote:
> RC2 or RC3 is planned to include a gwt module that should work for you right
> out of the box.  If any user would like to try building this themselves,
> I've just checked the necessary emulation classes into svn:http://code.google.com/p/google-collections/source/browse/#svn/trunk/...

Alen Vrecko

unread,
Apr 18, 2009, 1:36:45 PM4/18/09
to Google Collections Library - users list
Forgot to mention gwt doesn't handle @Override in
MapDifference.ValueDifference

http://code.google.com/p/google-web-toolkit/issues/detail?id=2223

Got ant to build the gwt jar. Don't know how to upload the patch.

Cheers,
Alen

Kevin Bourrillion

unread,
Apr 18, 2009, 2:20:03 PM4/18/09
to Alen Vrecko, Google Collections Library - users list
This is strange - we build using JDK 1.5, so any @Override problems
should have already failed before.

I think you can just svn diff > file and send that to me; there might
be some easier way in Google Code by now but I haven't looked around
for it lately.

You might also want to wait until I stick all our emulated java.*
classes into svn as well; I didn't think of it, but I can do that
shortly. Those are necessary for things to really work right.
Reply all
Reply to author
Forward
0 new messages