Skip to main content

Java development tools

Java™ 19 Support

Java 19 Java 19 is out and Eclipse JDT supports Java 19 in 4.25 via Marketplace.

The release notably includes the following Java 19 features:
JEP 405: Record Patterns (Preview).
JEP 427: Pattern Matching for Switch (Third Preview).
JEP 425: Virtual Threads (Preview).
JEP 428: Structured Concurrency (Incubator).

Please note that preview option should be on for preview language features. For an informal introduction of the support, please refer to Java 19 Examples wiki.

JUnit

Test Suite wizard supports JUnit 5 The New JUnit Test Suite Wizard has been enhanced to now allow the creation of a JUnit 5 test suite using the @Suite annotation. To open the New JUnit Test Suite Wizard for the current package, go to New > Other > Java > JUnit > JUnit Test Suite.

The following shows what the wizard now looks like:

Test Suite Wizard

The result of this is:

JUnit 5 Test Suite

Java Editor

Convert while loops to enhanced for loops The clean-up to convert to enhanced 'for' loops where possible has been enhanced to convert eligible while statements that use an iterator into enhanced for loops. The current clean-up already supports converting 'for' loops using an iterator into an enhanced 'for' loop.

To apply the cleanup, select the Java 5 Convert to enhanced 'for' loops checkbox on the Java Feature tab in your cleanup profile.

With the cleanup, the following:

Before

Is changed to:

After

The secondary option: Only if loop variable used applies as normal with loops that do not access the loop variable being ignored.

Convert to switch expression The clean-up to convert to a switch expression where possible has been enhanced to recognize switch statements that have every case either end in a return statement or a throw of an exception. In such a case the switch statement is converted into a return of a switch expression.

To apply the cleanup, select the Java 14 Convert to switch expression where possible checkbox on the Java Feature tab in your cleanup profile.

With the cleanup, the following:

Before

is changed to:

After

Debug

Double click in "All References and "All Instances" pop-up to navigate to Type Previously, clicking on any of the shown items in the "All References" and "All Instances" popup wasn't acted upon. This is now improved - if the selected variable or field type's source code is available, the editor tries to open it, and navigate to the declaration.

Popup

Previous Up Next

Back to the top