2

New proposal for Java: JEP 431: Sequenced Collections

 1 year ago
source link: https://devm.io/java/jep-431-jdk
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

There is a new JEP (JDK Enhancement Proposal) for the JDK. JEP 431: Sequenced Collections was reviewed on October 11, 2022 by Brian Goetz. Let’s see what it includes.

Sequenced Collections

From the summary of JEP 431, this proposal’s goal is to:

Introduce new interfaces to represent collections with a defined encounter order. Each such collection has a well-defined first element, second element, and so forth, up to the last element. It also provides uniform APIs for accessing its first and last elements, and for processing its elements in reverse order.

According to the JEP’s description, its proposal is motivated to fill a necessary gap in the language. Java does not have a collection type in the collections framework that can represent elements with a “defined encounter order” or a uniform set of operations for these conditions. If implemented into the JDK, this JEP would remediate issues associated with this lack of collection type.

What exactly is a "sequenced collection"? From the proposal:

A sequenced collection is a Collection whose elements have a defined encounter order. (The word "sequenced" as used here is the past participle of the verb to sequence, meaning "to arrange elements in a particular order.") A sequenced collection has first and last elements, and the elements between them have successors and predecessors. A sequenced collection supports common operations at either end, and it supports processing the elements from first to last and from last to first (i.e., forward and reverse).

JEP 431’s owner is Stuart Marks, Java/JDK/OpenJDK developer at Oracle, and it was reviewed by Brian Goetz, Java Language Architect at Oracle.

It is currently unknown if this candidate will make it to being an active feature to the JDK, as there are still more tests and analysis to be done. Keep an eye on this proposal for any developments.

From idea to proposal

JDK Enhancement Proposals are one way in which the JDK evolves and adds new changes. The process was created by Oracle and gives us a broader view about the JDK roadmap for future updates and view all proposed enhancements. What exactly is an enhancement?

From JEP 1: JDK Enhancement-Proposal & Roadmap Process:

An enhancement is an effort to design and implement a nontrivial change to the JDK code base or to do some other kind of work whose goals, progress, and result are worth communicating broadly. A JDK Enhancement Proposal (hereinafter "JEP") should be drafted for any work that meets at least one of the following criteria: it requires two or more weeks of engineering effort, it makes a significant change to the JDK, or to the processes and infrastructure by which it is developed, or it is in high demand by developers or customers.

One of the greatest things about Java is how open and transparent work on the OpenJDK is. Anyone can see what’s currently being worked on, join the community and participate in discussions, help with proposals, and help build upon the JDK. Mailing lists are viewable and all work is done formally, out in the open, with proper documentation.

Every JEP must go through a lengthy process of reviews and follow a set of guidelines and quality standards. There are thorough guidelines for development, investigation, reviews, and discussions within the community.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK