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

Add support for jdk9 and jdk10 #157

Closed
javadev opened this issue Mar 30, 2018 · 5 comments
Closed

Add support for jdk9 and jdk10 #157

javadev opened this issue Mar 30, 2018 · 5 comments
Assignees

Comments

@javadev
Copy link
Contributor

javadev commented Mar 30, 2018

It may be new settings for travis-ci.

@aNNiMON aNNiMON self-assigned this Mar 30, 2018
@PromanSEW
Copy link
Contributor

Please add these new methods from Java 10:

A new method orElseThrow has been added to the Optional class. It is synonymous with and is now the preferred alternative to the existing get method.

https://docs.oracle.com/javase/10/docs/api/java/util/Optional.html#orElseThrow()

New methods toUnmodifiableList, toUnmodifiableSet, and toUnmodifiableMap have been added to the Collectors class in the Stream package. These allow the elements of a Stream to be collected into an unmodifiable collection.

https://docs.oracle.com/javase/10/docs/api/java/util/stream/Collectors.html#toUnmodifiableList() and other toUnmodifiable* collectors

Source:
http://www.oracle.com/technetwork/java/javase/10-relnote-issues-4108729.html#NewFeature

@javadev javadev changed the title Add support fo jdk9 and jdk10 Add support for jdk9 and jdk10 Mar 30, 2018
@aNNiMON
Copy link
Owner

aNNiMON commented Apr 1, 2018

@PromanSEW since toUnmodifiable* collectors use Java 9 List.of, the preferred alternative in LSA would be

Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList);

Unfortunately, Collections.unmodifiable* methods are added in Android API 24. I can't drop Android pre-24 support.

@PromanSEW
Copy link
Contributor

PromanSEW commented Apr 1, 2018

@aNNiMON I have just checked, these methods exist in the source code of API 16 at least. I think they existed since older API than 16 too. Android documentation can contain errors, for example ConcurrentLinkedDeque was added in API 21, but I found this class in API 16 too. I think checking the source code of earlier APIs is a good idea.

@aNNiMON
Copy link
Owner

aNNiMON commented Apr 1, 2018

@PromanSEW you're right. I just check Android 2.3 source code and it has Collections.unmodifiableList. It's bad that Android documentation contains errors like this.

@aNNiMON aNNiMON closed this as completed in 3e04125 Apr 4, 2018
@javadev
Copy link
Contributor Author

javadev commented Jun 15, 2018

oraclejdk10 is also supported by travis-ci now.

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