Java logo Alamy

Java 19 Brings New Patterns to Open Source Programming Language

Java continues to move forward with features that improve performance and extend the capabilities of the open source programming language project led by Oracle.

Oracle officially announced the general availability of Java 19 on Sept. 20, marking the second release of the widely used open source programming language in 2022.

Java 19 follows Java 18 by six months and continues to provide new capabilities that aim to make the programming language easier for developers to use, while providing more features.

Java 19 is an incremental release and will only be supported for six months. As part of its rapid release cycle, Java features are grouped into larger projects that define a target capability that will be enabled via the introduction of individual Java features that are detailed by the JDK Enhancement Process (JEP).

The JEPs included in Java 19 help advance three key projects, Georges Saab, senior vice president of development, Java Platform at Oracle and chair of the OpenJDK Governing Board, explained to ITPro Today.

"One is for Project Loon, which is about scalability; the second is Project Amber, which is about evolution of the Java language itself and syntax; and final one is Project Panama, which is about interoperability with other languages," Saab said.

Bringing New Patterns to Java 19 Development

Inside of the Project Amber grouping, Java 19 benefits from a pair of enhancements that are now in preview.

The first is a Record Patterns capability. The feature is defined in JEP 405, which extends pattern matching to express more sophisticated, composable data queries. JEP 427 provides Pattern Matching for Switch, which enhances Java pattern matching for switch expressions and statements.

As part of Project Panama, Java has been expanded in recent years to better support functions that are normally outside of Java. For example, Java 15, which was released in September 2020, introduced JEP 383 as a new API for Foreign Memory Access. In Java 19, there is a further extension of foreign memory with JEP 424.

"Project Panama is an overarching project to improve the connections between Java and non-Java APIs," Saab said. "If we believe there will always be incremental improvements that can be made that will help developers using non-Java APIs, we will continue to innovate in those areas."

Specific to what's new in Java 19 with JEP 424, one key change in this release is more control over allocation and deallocation of foreign memory via the "MemorySession" API, he said. Also, there are improvements around the foreign function API.

Also new to Java 19 for Project Panama is JEP 426 which helps improve performance with an API to express vector computations.

Java performance will likely also benefit from the Project Loon effort for virtual threads that has made its way into Java 19.

"Virtual threads are lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications," JEP 425 states.

Java 19 will be the final release of Java in 2022. The next incremental release, Java 20, is currently scheduled for March 2023. Java 21, set for release in September 2023, will be a Long Term Support (LTS) update that will be supported for five years. The current Java LTS release is Java 17, which became generally available in September 2021 and will be supported until at least 2026.

About the author

 Sean Michael Kerner headshotSean Michael Kerner is an IT consultant, technology enthusiast and tinkerer. He consults to industry and media organizations on technology issues.
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish