gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.51k stars 372 forks source link

Java 9, 10, 11 JRE Emulation #9547

Closed slavap closed 9 months ago

slavap commented 7 years ago

Just for the future java 9 support in GWT.

https://blog.codefx.org/java/java-9-stream/

niloc132 commented 6 years ago

As this seems to be the only jre+java9 issue so far, adding this too: http://openjdk.java.net/jeps/269

niloc132 commented 5 years ago

Additions so far:

java.util.List

java.util.Set

java.util.stream.Stream

java.util.stream.Collectors

Anything I'm missing?

axls commented 5 years ago

java.util.Enumeration

ibaca commented 5 years ago

I'm going to try to help with this missing emulation. I have made a pretty trivial PR just as starting point, and also, hehe it is an interface that I'm interested in 😉a reactive interface in the JRE. https://gwt-review.googlesource.com/c/gwt/+/21420

niloc132 commented 5 years ago

Awesome! I've got the ones in my comment all written (and tests for about half of them), will try to get that batch up for review soon. The hard part at the moment is getting the tests to actually compile, as that requires using a java10+ jdk, which our current set of build scripts can't run on yet.

I've got this fork which refactors everything into modules (for use in maven, but gradle would be just as easy), maybe its time to pick that back up and finish it off...

abashev commented 4 years ago

Missed API from Java 11

java.util.Optional

abashev commented 4 years ago

There is my PR https://gwt-review.googlesource.com/c/gwt/+/22740 for Optional.isEmpty

abashev commented 4 years ago

@axls do I need something more to merge it into master branch?

axls commented 4 years ago

@abashev PR should contains tests at least. But, IIUC, currently there is no final decision how to execute tests for Java 9+ (https://groups.google.com/g/google-web-toolkit-contributors/c/eyBpbrtYgyY). @niloc132 Maybe I missed something and you have new information regarding testing jre emulation for Java 9+?

niloc132 commented 1 year ago

Reopening, only the first chunk of this is merged.

niloc132 commented 10 months ago

With the last PRs submitted for review, I think everything here is covered?

natros commented 10 months ago

java.util.function.Predicate#not (java 11) ?

niloc132 commented 10 months ago

Thanks @natros, I don't think that made any of the lists I'd seen so far. Want to propose a patch?

natros commented 10 months ago

Thanks @natros, I don't think that made any of the lists I'd seen so far. Want to propose a patch?

I can try it over the weekend.

jnehlmeier commented 10 months ago

@niloc132 How far do you want to go? All reasonable to emulate method additions of classes we already emulate?

niloc132 commented 10 months ago

@jnehlmeier when we started, it was from a list you had made as I recall, and were picking out existing classes that were missing methods/etc. My goal for 2.11 was to at least finish off bringing those existing types up to Java 11 compatibility, so that 2.12 can drop Java 8 support (at least for compiling to JS) and target Java 17 features, then backfill from there on emulation. From my perspective, with these closed, we should finalize any PRs that are going to get more testing, and then cut a release, and then bump JDT and Jetty to whatever we can reasonably manage.

But I'd be happy closing the door on this particular issue, and following up with specific other emulation later.

natros commented 10 months ago

https://github.com/gwtproject/gwt/pull/9862

jnehlmeier commented 10 months ago

@jnehlmeier when we started, it was from a list you had made as I recall, and were picking out existing classes that were missing methods/etc. My goal for 2.11 was to at least finish off bringing those existing types up to Java 11 compatibility, so that 2.12 can drop Java 8 support (at least for compiling to JS) and target Java 17 features, then backfill from there on emulation. From my perspective, with these closed, we should finalize any PRs that are going to get more testing, and then cut a release, and then bump JDT and Jetty to whatever we can reasonably manage.

But I'd be happy closing the door on this particular issue, and following up with specific other emulation later.

@niloc132 Ok, then we are still missing some stuff in existing classes. But curating a list manually is always pretty time consuming. Maybe we should develop a tool that automates it. I once did a diff using Jdiff but because that tool is so old it was pretty annoying to get it running. Also the output is far from being instantly usable. Based on that diff I started https://github.com/jnehlmeier/gwt-sandbox/issues/15 but it is far from complete and also outdated right now.

niloc132 commented 9 months ago

With completion of #9860, which as far as I can tell covers the remaining items mentioned in this ticket, I'm going to close this. We can open other tickets to list additional missing APIs, but there are tons of PRs already tied to this, and all closed for the moment.