Closed slavap closed 9 months ago
As this seems to be the only jre+java9 issue so far, adding this too: http://openjdk.java.net/jeps/269
Additions so far:
of
(with its zero-10 overloads, plus a varargs overload)List copyOf(Collection)
(Java 10)
of
(with its zero-10 key/value pair overloads, plus a varargs overload)entry(K, V)
ofEntries(Entry...)
Map copyOf(Map)
(Java 10)of
(with its zero-10 overloads, plus a varargs overload)
Set copyOf(Collection)
(Java 10)static Stream<T> iterate(T, Predicate<T>, UnaryOperator<T>)
static Stream<T> ofNullable(T)
Stream<T> dropWhile(Predicate<T>)
Stream<T> takeWhile(Predicate<T>)
static Collector flatMapping(Function, Collector)
static Collector filtering(Predicate, Collector)
static Collector toUnmodifiableMap()
(Java 10)static Collector toUnmodifiableList()
(Java 10)static Collector toUnmodifiableSet()
(Java 10)Anything I'm missing?
asIterator()
ifPresentOrElse(Consumer, Runnable)
or(Supplier)
stream()
orElseThrow()
(Java 10)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
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...
Missed API from Java 11
isEmpty()
There is my PR https://gwt-review.googlesource.com/c/gwt/+/22740 for Optional.isEmpty
@axls do I need something more to merge it into master branch?
@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+?
Reopening, only the first chunk of this is merged.
With the last PRs submitted for review, I think everything here is covered?
java.util.function.Predicate#not
(java 11) ?
Thanks @natros, I don't think that made any of the lists I'd seen so far. Want to propose a patch?
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.
@niloc132 How far do you want to go? All reasonable to emulate method additions of classes we already emulate?
@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.
@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.
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.
Just for the future java 9 support in GWT.
https://blog.codefx.org/java/java-9-stream/