A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cr.openjdk.org/~iris/se/22/latestSpec/ below:

Java SE 22 ( JSR 397)

Work on features in the Java SE 22 Reference Implementation is organized in terms of JDK Enhancement Proposals (JEPs). Each feature description gives a link to the corresponding JEP document as a convenience, but that document is not a normative part of this Specification. Some features are included in the Java SE 22 Reference Implementation on a preview basis, to gain exposure before achieving permanent status in a later release of the Java SE Platform.

Summary

Libraries

Class-File API (Preview)

Provide a standard API for parsing, generating, and transforming Java class files. This is a preview API.

Foreign Function & Memory API

Introduce an API by which Java programs can interoperate with code and data outside of the Java runtime. By efficiently invoking foreign functions (i.e., code outside the JVM), and by safely accessing foreign memory (i.e., memory not managed by the JVM), the API enables Java programs to call native libraries and process native data without the brittleness and danger of JNI.

Scoped Values (Second Preview)

Introduce scoped values, which enable managed sharing of immutable data both with child frames in the same thread, and with child threads. Scoped values are easier to reason about than thread-local variables and have lower space and time costs, especially when used in combination with Virtual Threads and Structured Concurrency. This is a preview API.

Stream Gatherers (Preview)

Enhance the Stream API to support custom intermediate operations. This will allow stream pipelines to transform data in ways that are not easily achievable with the existing built-in intermediate operations. This is a preview API.

Structured Concurrency (Second Preview)

Simplify concurrent programming by introducing an API for structured concurrency. Structured concurrency treats groups of related tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability. This is a preview API.

Language

Implicitly Declared Classes and Instance Main Methods (Second Preview)

Evolve the Java programming language so that students can write their first programs without needing to understand language features designed for large programs. Far from using a separate dialect of the language, students can write streamlined declarations for single-class programs and then seamlessly expand their programs to use more advanced features as their skills grow. This is a preview language feature.

Statements before super(...) (Preview)

In constructors in the Java programming language, allow statements that do not reference the instance being created to appear before an explicit constructor invocation. This is a preview language feature.

String Templates (Second Preview)

Enhance the Java programming language with string templates. String templates complement Java's existing string literals and text blocks by coupling literal text with embedded expressions and template processors to produce specialized results. This is a preview language feature and API.

Unnamed Variables & Patterns

Enhance the Java programming language with unnamed variables and unnamed patterns, which can be used when variable declarations or nested patterns are required but never used. Both are denoted by the underscore character, _.

Preview features A preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented, and yet impermanent. Preview features must possess the following properties:

Preview features may be removed in a future release, or upgraded to permanent features of the Java SE Platform.

The Java SE API consists solely of Java APIs, but the complete Java SE Platform includes non-Java APIs, such as JNI and JVM TI, and language-independent protocols, such as JDWP and Java Object Serialization. A preview feature may include changes to non-Java APIs and language-independent protocols.

Implementations of this Specification must:

Additional details about preview features, including a description of a preview feature’s life cycle and the relationship of preview features in the Java language to preview features in the Java SE API, are available in JEP 12 Preview Features.

This section may be compared to the corresponding section that appeared in Java SE 18.

Restricted methods Various methods in the Java SE API allow Java code to interoperate with resources outside the Java runtime in such a way that the runtime cannot prove correct or safe use of the resources. These methods, which are provided because of their high utility, are specified as having the potential to crash the Java runtime or corrupt memory. They are known as restricted methods.

All methods in the Java SE API that are not restricted are unrestricted. Given the potential danger of restricted methods, developers should use restricted methods only when no suitable functionality is available in unrestricted methods. To encourage developers to seek unrestricted alternatives to restricted methods, the following rule applies:

An Implementation may provide a means to invoke its run-time system with all restricted methods treated as unrestricted when invoked from code identified to the run-time system.

If the run-time system is invoked in this way, then by definition there are no restricted methods for the identified code to invoke, so no warnings are issued during the execution of such code.

If code other than that identified to the run-time system invokes a restricted method, the Implementation may give a signal other than a warning issued on the standard error stream.

(The Reference Implementation provides the ability to treat restricted methods as unrestricted for code in certain modules via the command-line option --enable-native-access=M. M is a comma-separated list of modules whose code is permitted to invoke restricted methods as if they were unrestricted, i.e., without warnings. The special operand
ALL-UNNAMED indicates every unnamed module, which includes code on the class path. When the --enable-native-access option is present, any invocation of restricted methods from code outside the listed modules will cause an IllegalCallerException to be thrown, rather than a warning to be issued.)

The list of restricted methods may be found in the Restricted Methods section of the API Specification.

Compared to Java SE 21, this Specification does not add or remove any restricted methods.

Preparing for removal of finalization An Implementation must support the finalization of objects, as described in The Java Language Specification, section 12.6. However, the Java SE 18 Platform Specification deprecates finalization, for removal. To aid preparations for the removal of finalization, an Implementation may provide a means to invoke its run-time system with finalization disabled. If finalization is disabled, the effect is that the Java Virtual Machine never invokes an object’s finalizer before the storage for the object is reclaimed by the garbage collector. An Implementation must not, by default, disable finalization.

(The Reference Implementation provides the ability to disable finalization via the command-line option --finalization=disabled.)

Future revisions of this Platform Specification are expected to disable finalization by default and, eventually, to remove finalization from the Java Language Specification.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4