I like to learn about Java's features by taking a look at the corresponding JEP. Is there a JEP for Java's Optional
? I wasn't able to find anything searching this list for Java 8 features.

- 113
- 7
-
As this got downvoted - is there something wrong with this question? – nistel Jan 15 '22 at 19:37
-
There might not be a JEP for the `Optional
` class, but there is the ticket [JDK-8001642](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8001642) which introduced it. – Progman Jan 15 '22 at 19:59 -
There was the [JEP 107](https://openjdk.java.net/jeps/107) with the corresponding [JSR 335](https://jcp.org/aboutJava/communityprocess/final/jsr335/index.html) that introduced `Stream` and `filter()` / `findFirst()` which (to my knowledge) led to the introduction of the `Optional` class. – Thomas Kläger Jan 15 '22 at 20:04
-
I don't understand why this question was closed. The reasons stated is "_We don’t allow questions seeking recommendations for books, tools, software libraries, and more._". However, I'm not asking for a recommendation. As Wikipedia states, JEPs are part of the official process to collect proposals for the enhancements to Java. For lots of features -- for example [_lambda expressions_](https://openjdk.java.net/jeps/126) -- there is a JEP. Therefore, what's wrong with asking if there is a JEP for `Optional` as well? It's not a subjective question and not about recommendations. – nistel Jan 16 '22 at 09:37
1 Answers
No, there is no separate JEP for Optional
. The history of Optional
is the following.
The Java Specification Request 335 dealt with Lambda Expressions for the Java™ Programming Language. Its goal was:
Extend the Java language to support compact lambda expressions (closures), as well as related language and library features to enable the Java SE APIs to use lambda expressions effectively.
It was this context which lead to the inclusion of Optional
in Java 8.
Members of the expert group for JSR-335 and strongly involved in the multiple discussions about Optional were people like Brian Goetz, Doug Lea and Rémi Forax. Chiming in were known experts like Joshua Bloch, Tim Peierls and others.
The archive of the lambda-libs-spec-experts mailing list contains opinion exchange about Optional.
So, Optional
were added as a result of JSR 335. This information was taken from here. There you can find details.

- 303,325
- 100
- 852
- 1,154

- 10,748
- 13
- 73
- 186
-
No, I'm looking for a JEP for [`Optional`](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html) which was introduced in Java 8. For example, lambda expressions were intoduced in Java 8 as well, and for them I could find [JEP 126](https://openjdk.java.net/jeps/126) in the list I linked in my question. – nistel Jan 15 '22 at 19:49
-
Thank you! As some parts of your answer are from the blog post you linked, they should be quoted as well, shouldn't they? – nistel Jan 16 '22 at 09:28