Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GWT (since Guava 19): Missing java.lang.Lang inherits in java.util.Util #2638

Closed
jnehlmeier opened this issue Nov 11, 2016 · 7 comments
Closed
Assignees

Comments

@jnehlmeier
Copy link

jnehlmeier commented Nov 11, 2016

Starting with Guava 19 emulations of java.util.concurrent.Future/CountDownLatch have been added and a matching java.util.Util.gwt.xml has been added to publish the super source. Both classes depend on java.lang.InterruptedException which has been super sourced as well using java.lang.Lang.gwt.xml.
However java.util.Util.gwt.xml does not inherit java.lang.Lang.gwt.xml so the GWT compiler generally does not see super source of java.lang.InterruptedException if you would only inherit Util.gwt.xml in a GWT app.

Basically if a GWT app does not directly or indirectly inherit Collect.gwt.xml (the only module that actually inherits Lang.gwt.xml) GWT compilation fails as nearly everything pulls in Base.gwt.xml which in turn pulls in Util.gwt.xml.

Also I am not so sure why Base.gwt.xml pulls in Util.gwt.xml as the code in the base package does not seem to depend on anything from java.util.concurrent, but maybe that's because inside Google you have more code covered through Base.gwt.xml.

So please revisit and fix your inherits structure for GWT.

@cpovirk
Copy link
Member

cpovirk commented Nov 11, 2016

Thanks. I figured this was what was going on in http://stackoverflow.com/questions/40360901/gwt-2-8-throws-exception-when-compiling-with-guava-20, but I'd been hoping the original poster would get back to me. We'll fix this.

@cpovirk cpovirk self-assigned this Nov 11, 2016
@cpovirk
Copy link
Member

cpovirk commented Nov 11, 2016

Also I am not so sure why Base.gwt.xml pulls in Util.gwt.xml as the code in the base package does not seem to depend on anything from java.util.concurrent, but maybe that's because inside Google you have more code covered through Base.gwt.xml.

That was my first guess, as well. After looking, though, I think it's for TimeUnit.

@cpovirk
Copy link
Member

cpovirk commented Nov 11, 2016

This will be fixed in the next Guava release. In the meantime, you can manually add java.lang.Lang to your .gwt.xml. If it's been a problem for a year and it affects only people who avoid collect (with only 2 reports to us), I don't know if it's worth a 20.0.1, given that I think we plan to release 21.0 soonish. @cgdecker ?

@jnehlmeier
Copy link
Author

I think it's fine to document it on the Guava 19 / 20 release notes as a known issue and publish the fix with 21.0.

Btw: It's likely that GWT will provide CompletableFuture emulation in the future, thus also emulating most if not all java.util.concurrent classes Guava currently provides. I am just curious but is there a reason why you guys don't contribute reasonable implemented JRE emulation to GWT itself?

@cpovirk
Copy link
Member

cpovirk commented Nov 11, 2016

We've talked to GWT about this on occasion. Part of the question is what the Future emulation will look like: Will it contain get(), which can't behave "correctly" on GWT? Another part is that, until we have CompletableFuture (or unless you have ListenableFuture), Future is of no use on it own, since, again, get() can't block. And part of it has been just differences in how important types are to Guava vs. how important they are to the GWT community at large.

Broadly speaking, we're happy to contribute whatever we can to GWT.

@cgdecker
Copy link
Member

I'm thinking "by the end of the month" for 21.0, FWIW. I suppose that means an RC next week. Is truth8-gwt out in a release yet? I suppose we could depend on a snapshot for a RC if not. Should also check with others if there's anything else we feel needs to happen before 21.0.

@cpovirk
Copy link
Member

cpovirk commented Nov 11, 2016

I don't think we have truth8-gwt yet. I guess we'll want to poke cgruber again soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants