Eclipse sends out first release train of the year, provides mainly clean-ups for old code

Eclipse sends out first release train of the year, provides mainly clean-ups for old code

The Eclipse 2021-03 release train has reached the station with version 4.19 of the Eclipse IDE in tow, which fits the development environment with a whole bunch of code clean-up options and helpers to get going with Java 16.

Out of the box, the latest edition of the Java editor includes new quick assists to create a try-with-resources block with the expression assigned to a resource variable, and adds catch clauses for exceptions thrown by auto-closed statements. Developers can also get additional help when creating permitted class or interface declarations, and let the editor reduce indentation when possible.

When looking to clean up older code, the editor offers new capabilities to convert catch clauses with the same body to multi-catches as introduced in Java 7, or replace plain comparator instances with a lambda expression passed to a Comparator.comparing() method. Additional optimisations automatically convert fields that are only used locally into local variables and turn inner classes static should they not use top level class members.

Since loops and if/else statements can weigh quite heavily on a program’s performance, the Eclipse team also threw in some functions to seek out and remove empty and passive or duplicate if conditions, and replace certain while loops with if statements for a bit of speedup and code clarity. 

Another clean-up can be activated to let the editor use pattern matching for the instanceof operator, a feature reaching GA in Java 16, when possible. To get full Java 16 support though, Java aficionados will have to make a quick trip to the Eclipse Marketplace and download an extra patch.

Functionality to toggle breakpoints and method breakpoints have been added as well and can be found via the Java Editor line ruler and context menus for method lists containing abstract entries.

Plugin developers will find a new option to include or exclude bundles from the Target Definition view and a corresponding preference to warn users when a plugin is missing from the API baseline, when examining the new version. Other small platform changes include a function to repeat one’s last search in a forward or backward direction when in Console view, and a context-menu option for disabling all breakpoints.

While the update provides Java devs with quite a lot to play with, C/C++ programmers will have to make do with new settings to rename terminal tabs and temporarily invert the colours of the active terminal in Eclipse C/C++ Development Tooling. Users of CDT should also be aware that the project’s standalone debugger is now part of the main download and no longer provided separately.

Eclipse Web Tools Platform for developing web and Java EE applications reached v3.21 as part of the release train, and now includes Jakarta EE 9 Schemas in the XML catalogue, a simplified version of the XML file wizard, and a preference page for typing help when writing JSON files. More details on what changed in all the projects taking part in the release can be found on the Eclipse website.

The current release is the first after the Eclipse Foundation, which aims at advancing the IDE and associated projects, announced the formal establishment of a new European home earlier this year. US and German subsidiaries were promised to stay untouched by the new Brussel-based non-profit.