gwt-2.6.0-rc1 can't compile guava-gwt

958 views
Skip to first unread message

Michael Hirsch

unread,
Nov 8, 2013, 3:01:01 PM11/8/13
to google-we...@googlegroups.com
When I compile my app with gwt-2.6.0-rc1, I get complaints about guava-gwt:
     [ERROR] Errors in 'jar:file:/home/mhirsch/.gradle/caches/artifacts-24/filestore/com.google.guava/guava-gwt/14.0.1/jar/de1f56fc5149d9e80c0e5107493370db2fa2d5e9/guava-gwt-14.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java'
         [ERROR] Line 112: Name clash: The method copyOf(Map<? extends K,? extends V>) of type ImmutableSortedMap<K,V> has the same erasure as copyOf(Map<? extends K,? extends V>) of type ImmutableMap<K,V> but does not hide it
      [ERROR] Errors in 'jar:file:/home/mhirsch/.gradle/caches/artifacts-24/filestore/com.google.guava/guava-gwt/14.0.1/jar/de1f56fc5149d9e80c0e5107493370db2fa2d5e9/guava-gwt-14.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java'
         [ERROR] Line 140: Name clash: The method copyOf(Collection<? extends E>) of type ImmutableSortedSet<E> has the same erasure as copyOf(Collection<? extends E>) of type ImmutableSet<E> but does not hide it
         [ERROR] Line 145: Name clash: The method copyOf(Iterable<? extends E>) of type ImmutableSortedSet<E> has the same erasure as copyOf(Iterable<? extends E>) of type ImmutableSet<E> but does not hide it
         [ERROR] Line 150: Name clash: The method copyOf(Iterator<? extends E>) of type ImmutableSortedSet<E> has the same erasure as copyOf(Iterator<? extends E>) of type ImmutableSet<E> but does not hide it

I'm not sure if I can use guava 15.  Errai pulls in version 14, I think.

Michael
 

Iker Olabarria

unread,
Dec 11, 2013, 8:44:18 AM12/11/13
to google-we...@googlegroups.com
I have the same error using guava 15

Thomas Broyer

unread,
Dec 11, 2013, 9:14:19 AM12/11/13
to google-we...@googlegroups.com
I seem to remember having seen somewhere that this issue is due to how Java 7 deals with generics.
Unless you use Java 7 language features, try passing -sourceLevel 6 to the GWT compiler (or DevMode).
 
I'm not sure if I can use guava 15.  Errai pulls in version 14, I think.

Guava has a clear compatibility policy, so unless Errai uses @Beta or @Deprecated APIs from Guava 14, it should Just Work™ with Guava 15. 

Iker Olabarria

unread,
Dec 11, 2013, 11:57:05 AM12/11/13
to google-we...@googlegroups.com
Thank you Thomas. 

It looks that sourceLevel is being ignored. I've tried -sourceLevel 6 , sourceLevel XX ... nothing.

My default JDK is 1.6 , but also proved on JDK 1.7. 

Always getting the same exception . 



   [ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java'

Thomas Broyer

unread,
Dec 11, 2013, 12:23:36 PM12/11/13
to google-we...@googlegroups.com, Roberto Lublinerman, Christian Gruber

[+cc rluble, cgruber]


On Wednesday, December 11, 2013 5:57:05 PM UTC+1, Iker Olabarria wrote:


El miércoles, 11 de diciembre de 2013 15:14:19 UTC+1, Thomas Broyer escribió:


On Friday, November 8, 2013 9:01:01 PM UTC+1, Michael Hirsch wrote:
When I compile my app with gwt-2.6.0-rc1, I get complaints about guava-gwt:
     [ERROR] Errors in 'jar:file:/home/mhirsch/.gradle/caches/artifacts-24/filestore/com.google.guava/guava-gwt/14.0.1/jar/de1f56fc5149d9e80c0e5107493370db2fa2d5e9/guava-gwt-14.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java'
         [ERROR] Line 112: Name clash: The method copyOf(Map<? extends K,? extends V>) of type ImmutableSortedMap<K,V> has the same erasure as copyOf(Map<? extends K,? extends V>) of type ImmutableMap<K,V> but does not hide it
      [ERROR] Errors in 'jar:file:/home/mhirsch/.gradle/caches/artifacts-24/filestore/com.google.guava/guava-gwt/14.0.1/jar/de1f56fc5149d9e80c0e5107493370db2fa2d5e9/guava-gwt-14.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java'
         [ERROR] Line 140: Name clash: The method copyOf(Collection<? extends E>) of type ImmutableSortedSet<E> has the same erasure as copyOf(Collection<? extends E>) of type ImmutableSet<E> but does not hide it
         [ERROR] Line 145: Name clash: The method copyOf(Iterable<? extends E>) of type ImmutableSortedSet<E> has the same erasure as copyOf(Iterable<? extends E>) of type ImmutableSet<E> but does not hide it
         [ERROR] Line 150: Name clash: The method copyOf(Iterator<? extends E>) of type ImmutableSortedSet<E> has the same erasure as copyOf(Iterator<? extends E>) of type ImmutableSet<E> but does not hide it

I seem to remember having seen somewhere that this issue is due to how Java 7 deals with generics.
Unless you use Java 7 language features, try passing -sourceLevel 6 to the GWT compiler (or DevMode).
 
I'm not sure if I can use guava 15.  Errai pulls in version 14, I think.

Guava has a clear compatibility policy, so unless Errai uses @Beta or @Deprecated APIs from Guava 14, it should Just Work™ with Guava 15. 

Thank you Thomas. 

It looks that sourceLevel is being ignored. I've tried -sourceLevel 6 , sourceLevel XX ... nothing.

My default JDK is 1.6 , but also proved on JDK 1.7. 

Always getting the same exception . 


But I'd wonder why Google wouldn't have already run into it then… 
I'd rather suspect a bug in Guava that hasn't ship in a release yet (see e.g. https://code.google.com/p/guava-libraries/source/detail?r=1908e9db5c671f0ef95202b8b0aab1ade954bd0f )

Chris Povirk

unread,
Dec 11, 2013, 6:42:47 PM12/11/13
to Christian Gruber, google-we...@googlegroups.com, Roberto Lublinerman, Thomas Broyer
[re-sending now that I think I have group posting permissions]

I see the problem with GWT 2.6 + Guava 15 but not with GWT 2.5 + Guava
15 or GWT 2.6 + Guava 14. I suspect that Michael is right that Java
7's changes to generics enforcement are responsible. I assume that we
fixed the problem for Guava 15 when switching to Java 7 for our
non-GWT compiles. Are you able to update to Guava 15 (or at least to
easily verify that that Guava 15 solves the problem, in case I got my
tests mixed up)?

Chris Povirk

unread,
Dec 11, 2013, 6:49:22 PM12/11/13
to Christian Gruber, google-we...@googlegroups.com, Roberto Lublinerman, Thomas Broyer
Sorry, I'm doing a poor job of following the threading.

The fix that Thomas identified is in Guava 15:
http://code.google.com/p/guava-libraries/source/detail?r=1908e9db5c671f0ef95202b8b0aab1ade954bd0f&name=release15

I wouldn't expect there to be problems with that version. Iker, can
you double-check that all copies of Guava 14 were removed from your
dependencies when you tested with Guava 15?

Iker Olabarria

unread,
Dec 12, 2013, 4:52:04 AM12/12/13
to google-we...@googlegroups.com, Christian Gruber, Roberto Lublinerman, Thomas Broyer
SOLVED!!!

Chris was right!  Yesterday i did a prove in that sense....

We have  "n"  GWT Clients projects and another one for the Server side.   One of the  Client project uses another "standard" Java Client Project with dependencies with GUAVA.  The problem was here.  That common project was using GUAVA 14. 

I did  this: 

1. Update ALL  proyects  to GUAVA 15  ( specially that "common utility" project).
2. After updating all proyects  i compiled whithout problem. 
3. Off Topic:
     I  had another Issue with Guava 15 ( now in the Server side) , for using Reflections 0.9.5 + Guava 15. Just solved updating to the release version  0.9.9 RC


THANK YOU TO ALL .!!!!

Andrei Cojocaru

unread,
Jun 14, 2014, 5:49:50 AM6/14/14
to google-we...@googlegroups.com
Hi guys,

upgrading guava definitely solves the problem. I was using guava 14.0.1 and GWT 2.5.1. I upgraded to GWT 2.6.1 and encountered that same problem. Afterwards I upgraded to guava 17.0 and everything is going fine. Cheers!

coderinabstract

unread,
Sep 6, 2014, 11:41:25 PM9/6/14
to google-we...@googlegroups.com
Works with jdk 1.6 however errors with jdk 1.7.. any ideas?
Reply all
Reply to author
Forward
0 new messages