Support for standard library polyfillsSee original GitHub issue
I really like the idea behind this project. What the frontpage does not mention, is that a valid Java 8 bytecode can’t still have a hard time running on actual JRE8 because of missing pieces of the standard library like
So the idea is that the plugin could somehow rewrite references of
java.util.List#of() to a different static method in a specially created polyfill library.
What do you think?
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
It also worth mentioning that the language features enabled by Jabel do not require any new stdlib methods btw
Hi, you might be interested in UniJ, which provides a backport of JDK 9+ APIs in the form of a facade.
UniLists.of(1, 2) corresponds to
List.of(1, 2). At runtime, it delegates to:
List.of(1, 2)(for JDK 9+)
Collections.unmodifiableList(Arrays.asList(1, 2))(for JDK 8)
- you added a dependency on UniJ
- and Jabel could rewrite
you’d achieve the effect you want.
Instance methods (like
Optional.stream()) would be much more problematic to rewrite, though.
Disclaimer: I’m the author of UniJ.