google / guava

Google core libraries for Java
Apache License 2.0
50.07k stars 10.87k forks source link

TreeRangeSet still don't work in GWT 2.7+ #3049

Open anton-tregubov opened 6 years ago

anton-tregubov commented 6 years ago

@GwtIncompatible("uses NavigableMap") public class TreeRangeSet

That means that users with GWT 2.7.0+(https://github.com/gwtproject/gwt/issues/4236) unable to use TreeRangeSet even NavigableMap was supported in this version. Problem root cause is that all annotated files with GwtIncompatible are skip sources packaging in guava-gwt.

Please remove it or describe why it's not possible.

Also maybe you know easy WA to make TreeRangeSet usable in guava 18.0?

cpovirk commented 6 years ago

Last time I looked into this, I spent a little time and then concluded:

This is looking nontrivial, since our RangeSet implementations rely on our other NavigableSet implementations, which we haven't yet made available under GWT.

It would be nice to do someday, but I wouldn't expect it to become a priority, sorry :(

anton-tregubov commented 6 years ago

https://github.com/google/guava/blob/master/guava/src/com/google/common/collect/TreeRangeSet.java Use only NavigableMap.

I actually don't understand your point about NavigableSet. And even if we accept fact that there are some guava implementations that are not available under GWT, i think this classes are marked with @ GwtIncompatible and unavailable with or without fixed TreeRangeSet.

cpovirk commented 6 years ago

Sorry, you're right, NavigableMap, not NavigableSet.

That includes AbstractNavigableMap and its dependencies, including DescendingMap and NavigableKeySet.

nikhilbarar commented 6 years ago

@cpovirk Can i send a PR for the changes if any required?

cpovirk commented 6 years ago

This has turned out to look more complicated than we'd hoped, but we could take a patch if you get it working.

aepshteyn commented 4 years ago

@cpovirk I agree with @anton-tregubov - there doesn't seem to be any good reason why the RangeSet interface is marked @GwtIncompatible. I can accept that you can't make your TreeRangeSet class compatible (though I don't understand why), but making the interface @GwtIncompatible needlessly prevents users from writing their own implementation that is compatible.