DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

GWT 2.6.0 The method divide(int, int, RoundingMode) is undefined for the type IntMath #1684

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

I have this log as an error in devMode, but that does not prevent the 
application to run correctly.
It is just an annoying log.

The methd is marked as @GwtIncompatible in 11.0.2 but not in 12.0 and further 
versions

Original issue reported on code.google.com by wokier on 27 Feb 2014 at 1:08

GoogleCodeExporter commented 9 years ago
What version of Guava are you using? Also, can you include the full error 
message (including any line number and other context)?

Original comment by cpov...@google.com on 27 Feb 2014 at 2:39

GoogleCodeExporter commented 9 years ago
Oh, sorry, I see the Release16 tag now. Just the surrounding error details 
then. Thanks.

Original comment by cpov...@google.com on 27 Feb 2014 at 2:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by cpov...@google.com on 27 Feb 2014 at 6:04

GoogleCodeExporter commented 9 years ago
I was migrating from 2.5.1 to 2.6.0
I use guava in my application
I use guava in a different version in a test framework wich is also open in 
eclipse

Maybe i messed up somewhere but here is what i have understood.

GWT Version | Test guava version | App guava version | Works | Warning
2.5.1       | 11.0.2             | 14.0.1            | Yes   | No
2.6.0       | 11.0.2             | 14.0.1            | No    | No
2.6.0       | 11.0.2             | 16.0.1            | No    | No
2.6.0       | 12.0               | 16.0.1            | Yes   | Yes

[ERROR] [ui] - Errors in 
'jar:file:/C:/repository/com/google/guava/guava-gwt/16.0.1/guava-gwt-16.0.1.jar!
/com/google/common/collect/super/com/google/common/collect/Lists.java'
    [ERROR] [ui] - Line 607: The method divide(int, int, RoundingMode) is undefined for the type IntMath

Original comment by wokier on 27 Feb 2014 at 6:05

GoogleCodeExporter commented 9 years ago
Ah, the conflicting versions of Guava could explain this. If you see the 
problem when using the same version of Guava everywhere, let us know.

Original comment by cpov...@google.com on 27 Feb 2014 at 6:12

GoogleCodeExporter commented 9 years ago
Migrated all to 16.0.1
The error IntMath.divide remains, still not blocking

and i have another error:
[ERROR] [ui] - Errors in 
'jar:file:/C:/repository/com/google/guava/guava-gwt/16.0.1/guava-gwt-16.0.1.jar!
/com/google/common/collect/TransformedListIterator.java'
    [ERROR] [ui] - Line 39: The method cast(Iterator<capture#2-of ? extends F>) is undefined for the type Iterators

and this one is a real blocking one trown in my application and prenvent in it 
from working correctly. 

This one happen on a 
listDataProvider.getList().addAll(resultOfAGuvaTransform);

Original comment by wokier on 28 Feb 2014 at 9:06

GoogleCodeExporter commented 9 years ago
Just noticed that those 2 classes are @GwtCompatible(emulated = true)

I have found
http://code.google.com/p/guava-libraries/source/browse/guava-gwt/src-super/com/g
oogle/common/math/super/com/google/common/math/IntMath.java
where divide( exists

and
http://code.google.com/p/guava-libraries/source/browse/guava-gwt/src-super/com/g
oogle/common/collect/super/com/google/common/collect/Iterables.java
where cast( does not exists

Those classes are integrated in guava-gwt sources.

Original comment by wokier on 28 Feb 2014 at 9:48

GoogleCodeExporter commented 9 years ago
To replace addAll by a loop with add(resultOfAGuvaTransform.get(i)) is a 
workaround.
But i feel bad to have nice transform, and then to use a loop to exploit its 
result.

Original comment by wokier on 28 Feb 2014 at 2:12

GoogleCodeExporter commented 9 years ago
The call is to Itera*tor*s.cast rather than Itera*ble*s.cast. The former method 
does exist in 16.0.1: 
https://code.google.com/p/guava-libraries/source/browse/guava-gwt/src-super/com/
google/common/collect/super/com/google/common/collect/Iterators.java?name=v16.0.
1#1270

I suspect that there is still a second copy of guava-gwt (probably version 11 
or earlier) on your classpath.

Original comment by cpov...@google.com on 28 Feb 2014 at 2:50

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07