Martin Ahrer

Thinking outside the box

0001-01-01 1 min read

The following describes selected improvements of the Java API. See the Java 23 release notes.

Java 23 is introducing the following API enhancements as developer preview or Incubator.

  • JEP 466 is continuing with Class-File API, standard API for parsing, generating, and transforming Java class files

  • JEP 473 is continuing with Stream Gatherers. This will allow stream pipelines to transform data in ways that are not easily achievable with the existing built-in intermediate operations

  • JEP 480 is continuing with simplifying multithreaded programming by introducing an API for structured concurrency. Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability..

  • JEP 481 is continuing with scoped values, which enable the sharing of immutable data within and across threads. They are preferred to thread-local variables, especially when using large numbers of virtual threads

  • JEP 469 is continuing with Vector API, introduces an API to express vector computations that reliably compile at runtime to optimal vector instructions on supported CPU architectures, thus achieving performance superior to equivalent scalar computations.

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java language. See the Java 23 release notes. See Java Language Updates for Java SE 23.

Java 23 is introducing the following language enhancements as developer preview.

  • JEP 455 is starting with Primitive Types in Patterns, instanceof, and switch (Preview) as developer preview. Enhance pattern matching by allowing primitive type patterns in all pattern contexts, and extend instanceof and switch to work with all primitive types.

  • JEP 476 is starting with Module Import Declarations as developer preview. Enhance the Java programming language with the ability to succinctly import all of the packages exported by a module. This simplifies the reuse of modular libraries, but does not require the importing code to be in a module itself.

  • JEP 482 is continuing with Flexible Constructor Bodies as developer 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.

  • JEP 477 is continuing with Implicitly Declared Classes and Instance Main Methods.

Continue reading

0001-01-01 1 min read

Before Java 23 HTML JavaDoc syntax is verbose and hard to read in source code.

Basic Formatting Before Java23
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentythree/tooling/MarkdownDocumentationComments.java[tag=basicFormattingBeforeJava23]
Basic Formatting With Java23
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentythree/tooling/MarkdownDocumentationComments.java[tag=basicFormattingWithJava23]

Java 23 Markdown JavaDoc is clean and intuitive to write.

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java tooling. See the Java 23 release notes.

Java 23 is introducing the following tooling enhancements.

  • JEP 467 is adding the Markdown Documentation Comments. This enables JavaDoc documentation comments to be written in Markdown rather than solely in a mixture of HTML and JavaDoc @-tags.

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java API. See the Java 22 release notes.

Java 22 is introducing the following API enhancements as developer preview or Incubator.

  • JEP 446 is continuing with scoped values, which enable the sharing of immutable data within and across threads. They are preferred to thread-local variables, especially when using large numbers of virtual threads

  • JEP 457 is starting with a Class-File API to provide a standard API for parsing, generating, and transforming Java class files. This could eliminate the need for libraries like ASM.

  • JEP 453 is continuing with simplifying multithreaded programming by introducing an API for structured concurrency. Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability..

  • JEP 461 is starting Stream Gatherers. This will allow stream pipelines to transform data in ways that are not easily achievable with the existing built-in intermediate operations

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java language. See the Java 22 release notes. See Java Language Updates for Java SE 22.

With Java 22 the following language enhancements are now generally available

  • JEP 456 is releasing Unnamed Patterns and Variables. Unnamed patterns, which match a record component without stating the component’s name or type, and unnamed variables, which can be initialized but not used. Both are denoted by an underscore character, _.

Continue reading

0001-01-01 1 min read

The Java language mandates to declare variables (names) even when they are not needed (used). Often we also find ourselves to declare variables just for the sake of having a consistent look.

Unnamed Variables
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/twentytwo/lang/UnnamedVariablesAndPatterns.java[tag=unnamedVariables]
Unnamed Variables For Consistent Code Style
Continue reading
Older posts Newer posts