Skip to content

Java 9, 10, 11 JRE Emulation Β #9547

Closed

Description

@slavap

Just for the future java 9 support in GWT.

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

Activity

  1. niloc132 commented on Mar 28, 2018

    @niloc132
    Member

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

  2. self-assigned this
    on Oct 17, 2018
  3. niloc132 commented on Oct 18, 2018

    @niloc132
    Member

    Additions so far:

    java.util.List

    • of (with its zero-10 overloads, plus a varargs overload)
    • List copyOf(Collection) (Java 10)

    java.util.Map

    • of (with its zero-10 key/value pair overloads, plus a varargs overload)
    • entry(K, V)
    • ofEntries(Entry...)
    • Map copyOf(Map) (Java 10)

    java.util.Set

    • of (with its zero-10 overloads, plus a varargs overload)
    • Set copyOf(Collection) (Java 10)

    java.util.stream.Stream

    • static Stream<T> iterate(T, Predicate<T>, UnaryOperator<T>)
    • static Stream<T> ofNullable(T)
    • Stream<T> dropWhile(Predicate<T>)
    • Stream<T> takeWhile(Predicate<T>)

    java.util.stream.Collectors

    • 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?

  4. changed the title [-]Java 9 stream API extension [/-] [+]Java 9, 10 JRE Emulation [/+] on Oct 18, 2018
  5. axls commented on Oct 18, 2018

    @axls
    Contributor

    java.util.Enumeration

    • asIterator()

    java.util.Optional

    • ifPresentOrElse(Consumer, Runnable)
    • or(Supplier)
    • stream()
    • orElseThrow() (Java 10)
  6. ibaca commented on Oct 27, 2018

    @ibaca
    Contributor

    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

  7. niloc132 commented on Oct 27, 2018

    @niloc132
    Member

    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...

  8. added a commit that references this issue on Oct 31, 2018
  9. added a commit that references this issue on Dec 16, 2018
  10. abashev commented on Aug 21, 2020

    @abashev

    Missed API from Java 11

    java.util.Optional

    • isEmpty()
  11. changed the title [-]Java 9, 10 JRE Emulation [/-] [+]Java 9, 10, 11 JRE Emulation [/+] on Aug 22, 2020
  12. abashev commented on Aug 23, 2020

    @abashev

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

  13. abashev commented on Sep 13, 2020

    @abashev

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

  14. 16 remaining items

  15. added a commit that references this issue on Nov 10, 2023
  16. niloc132 commented on Nov 10, 2023

    @niloc132
    Member

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

  17. natros commented on Nov 10, 2023

    @natros
    Contributor

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

  18. niloc132 commented on Nov 10, 2023

    @niloc132
    Member

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

  19. natros commented on Nov 10, 2023

    @natros
    Contributor

    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.

  20. jnehlmeier commented on Nov 10, 2023

    @jnehlmeier
    Member

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

  21. niloc132 commented on Nov 10, 2023

    @niloc132
    Member

    @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.

  22. natros commented on Nov 12, 2023

    @natros
    Contributor
  23. jnehlmeier commented on Nov 13, 2023

    @jnehlmeier
    Member

    @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 jnehlmeier#15 but it is far from complete and also outdated right now.

  24. added a commit that references this issue on Dec 5, 2023
  25. niloc132 commented on Dec 23, 2023

    @niloc132
    Member

    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.

  26. added a commit that references this issue on Jan 29, 2024
  27. added a commit that references this issue on Mar 19, 2024
    c5d74f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions