Warning ! This site is currently under development, and may contain inaccurate and misleading information. Report an issue
| Status: Red. Known issues: | None

A JBoss Project
Red Hat

Posts tagged with 'codereadystudio'

JBoss Tools 4.19.0 and Red Hat CodeReady Studio 12.19 for Eclipse 2021-03 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.19 (2021-03) but we recommend using the latest Eclipse 4.19 2021-03 JEE Bundle since then you get most of the dependencies preinstalled.

Java11 is now required to run Red Hat Developer Studio or JBoss Tools (this is a requirement from Eclipse 4.17). So make sure to select a Java11 JDK in the installer. You can still work with pre-Java11 JDK/JRE and projects in the tool.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was an improved tooling for the Quarkus framework, improvements for container based development and bug fixing.

OpenShift

Login to Developer Sandbox from the tooling

Red Hat provides an online OpenShift environment called Developer Sandbox that makes it easy for developers to build, test and deploy cloud native applications and microservices.

In order to use Developer Sandbox, you must own a Red Hat SSO account (which can be linked to social accounts like GitHub,…​). Once logged in into Red Hat SSO, you will get an environment provisioned in Developer Sandbox but the first time you will try to login in to Developer Sandbox, your account needs to be verified (in order to prevent crypto miners and robots) thus you need to go through a verification phase where you will be asked to provide:

  • first your phone number and country code

  • then a verification code that you will receive on your smartphone.

So it is now possible to provision and log in to Developer Sandbox from the OpenShift tooling and connect it to the Developer Sandbox environment.

Open the OpenShift Application Explorer view (Window → Show View → Other…​, enter open and double click on OpenShift Application Explorer):

devsandbox1

Right click on the first node and select the Login context menu:

devsandbox2

In order to provision the Developer Sandbox environment, click on the Red Hat Developer Sandbox link: a browser window will open and you will be required to login to your Red Hat SSO account:

devsandbox3

Login to your account (please note that if you don’t have a Red Hat account, you can create a new one). Once you’re logged in, you should see the following window:

devsandbox4

Enter your contry code (+XX) and phone number and click the Verify button:

You will be required to provide the verification code that you should have received on your phone:

devsandbox5

Once your Developer Sandbox environment is provisioned; you will see the following window:

devsandbox6

Click on the Ǹext button to log in to your Developer Sandbox environment:

devsandbox7

Click on the DevSandbox link and log in with the same credentials: you will see the following window:

devsandbox8

Click on the Display Token link and the click on the Finish button, you should be back to the Login wizard:

devsandbox9

Please note that the URL and Token fields have been updated. Click the Finish button, the OpenShift Application Explorer will be updated with the Developer Sandbox URL and if you expand it, you will see 3 namespaces/projects available for you to start playing with:

devsandbox10

You’re now ready to work against this environment for free !!!.

Browser based login to an OpenShift cluster

When it comes to login to a cluster, OpenShift Tools supported two different authentication mechanisms:

  • user/password

  • token

The drawback is that it does not cover clusters where a more enhanced and modern authentication infrastructure is in place. So it is now possible to login to the cluster through an embedded web browser.

In order to use it, go to the Login context menu from the Application Explorer view:

weblogin1

Click on the Retrieve token button and an embedded web browser will be displayed:

weblogin2

Complete the workflow until you see a page that contains Display Token:

weblogin3

Click on Display Token:

The web browser is automatically closed and you’ll notice that the retrieved token has been set in the original dialog:

weblogin4

Devfile registries management

Since JBoss Tools 4.18.0.Final, the preferred way of developing components is now based on devfile, which is a YAML file that describe how to build the component and if required, launch other containers with other containers. When you create a component, you need to specify a devfile that describe your component. So either you component source contains its own devfile or you need to pick a devfile that is related to your component. In the second case, OpenShift Tools supports devfile registries that contains a set of different devfiles. There is a default registry (https://github.com/odo-devfiles/registry) but you may want to have your own registries. It is now possible to add and remove registries as you want.

The registries are displayed in the OpenShift Application Explorer under the Devfile registries node:

registries1

Please note that expanding the registry node will list all devfiles from that registry with a description:

registries2

A context menu on the Devfile registries node allows you to add new registries, and on the registry node to delete it.

Devfile enhanced editing experience

Although devfile registries can provide ready-to-use devfiles, there may be some advanced cases where users need to write their own devfile. As the syntax is quite complex, the YAML editor has been completed so that to provide:

  • syntax validation

  • content assist

Support for Python based components

Python-based components were supported but debugging was not possible. This release brings integration between the Eclipse debugger and the Python runtime.

Quarkus

Support for environment variables in Run/debug Quarkus configurations

Environment variables is one way to override properties values in the Quarkus properties file. It is now possible to specify environment variables in a Run/debug Quarkus configuration.

Server Tools

Wildfly 23 Server Adapter

A server adapter has been added to work with Wildfly 23.

EAP 7.4 Beta Server Adapter

The server adapter has been adapted to work with EAP 7.4 Beta.

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.30.Final and Hibernate Tools version 5.4.30.Final.

Platform

Views, Dialogs and Toolbar

Filter field for configuration details

A filter field has been added to the Installation Details > Configuration tab. This allows much faster lookup of specific information from the system details by showing only lines containing the filter criteria.

configuration filter
Preference to remember the last used page in search dialog

The Remember last used page check box was previously available from the Search dialog > Customize…​ > Search Page Selection dialog, which was not intuitive and hard to find. Now, the check box is moved to the Search preference page.

A new preference Remember last used page in the Search dialog has been added to Preferences > General > Search page. This new preference is enabled by default. image::https://www.eclipse.org/eclipse/news/4.18/images/remember-last-used.png[]

Text Editors

Horizontal Scrolling in Text Editor

You can now scroll horizontally in the Text Editor using Shift+Mouse Wheel and touchpad gestures on Windows. Horizontal scrolling with touchpad already works on Linux and macOS.

Open-with does not store the editor relationship anymore

The menu entry Open With ▸ …​ does not store the selected editor as default editor for the selected file as this was undesired in most cases and lead to confusion. Also, removing this association was not easy for the end user. The user can still assign a editor to a certain file type via the Open With ▸ Other…​ dialog.

Debug

Find Next/Previous in Console View

In the Console view, you can repeat your last search in the forward or backward direction in the following ways:

  • Right-click in the Console view, then select Find Next or Find Previous.

  • Use the keyboard shortcuts Ctrl+K or Ctrl+Shift+K.

console find next find previous 45017
Disable All in Breakpoints view

In the Breakpoints view, you can disable all the breakpoints using the new Disable All context-menu option available on right-click.

disable allbreakpoints
Terminate descendants of operating-system processes launched by Eclipse

Some types of launch-configurations start operating-system processes when launched from Eclipse. When you terminate the corresponding process before it completes (for example by clicking the terminate button, the red square) that operating-system process is destroyed. Now the descendants of that process, its child-processes created by the main-process and their children recursively, are destroyed too.

Termination of child processes of launched OS processes can be configured

Since Eclipse 4.18 child processes (descendants) of an operating system process launched from Eclipse are terminated too, when the launched process is terminated (for example by clicking the terminate button).

It is now possible to configure in the Launch Configuration whether the child processes of a launched process should be terminated too or if they should stay alive, in case the launched processes is terminated. You can control this with the checkbox Terminate child processes if terminating the launched process in the Common tab of the Run/Debug Configurations dialog. By default this checkbox is selected and child processes are terminated too.

configure child process termination

Preferences

External browsers on Windows

On Windows, the list of recognized External web browsers has been updated to include:

  • Microsoft Edge (%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe)

browsers windows update

Enable word wrap on console output

A new preference Enable word wrap is available in the Console preference page. This setting persists the current state of the "Word wrap" toggle on the console view between user sessions. By default, word wrapping is disabled on console output.

console preferences word wrap

Themes and Styling

New "System" theme

A new "System" theme is available in the Appearance preference page. This theme is built using system colors, and as a consequence integrates well in any OS and OS theme.

This screenshot shows the System theme in action under several GTK themes:

GTK Adwaita:

systemTheme gtkAdawaita

GTK Adwaita Dark:

systemTheme gtkAdawaitaDark

GTK Kripton:

systemTheme gtkKripton

GTK Dark Mint:

systemTheme gtkDarkMint
Windows dark theme styles progress bars

The progress bar in the dark theme on Windows OS is now styled:

progressbar dark win32
Light theme on macOS

The Light theme for macOS has been updated to fit the latest macOS design.

Old:

macTheme light old

New:

macTheme light new

General Updates

Equinox Linux Security JNA Fragment

A new fragment has been added for Linux password security using JNA. This new fragment replaces the old JNI x86_64-specific fragment and supports all Linux architectures.

Ant 1.10.9

Eclipse has adopted Ant version 1.10.9.

Java Developement Tools (JDT)

JUnit

JUnit 5.7.1

JUnit 5.7.1 is here and Eclipse JDT has been updated to use this version.

Java Editor

Quick assist to create try-with-resources

For expressions returning a type that is AutoCloseable there’s a new quick assist (Ctrl+1) available: Assign to new local variable in try-with-resources.

try with resources before

It creates a new try-with-resources block with the expression assigned to a resource variable. The variable type and name can be selected from a few suggestions:

try with resources after

The default hotkey sequence for this quick assist is Ctrl+2 followed by T.

Add catch clause to try-with-resources assists

There are multiple assists to surround auto-closeable statements in a try-with-resources statement including Surround with > Try-with-resources Block. Now, all forms will add a catch clause for any exceptions (such as IOException) thrown by the auto-close if not already handled via an existing catch clause or throws directive. In the case where the existing code catches or throws an exception that sub-classes the exceptions of the new catch clause, an additional catch clause will be added to rethrow the exception to ensure code logic remains consistent.

add catch clause to try with resources before
add catch clause to try with resources after
Quick fix to create permitted type declaration

You can use the following quick fixes (Ctrl+1) to create a new permitted class or interface declaration:

create permitted type declaration

The created type will declare the sealed type as its super type and it can be declared as final, non-sealed, or sealed with the available quick fixes for further inheritance control.

Java Feature clean ups

A new tab named Java Feature has been added to the Clean Up preferences. It lists the clean up options that introduce the use of language features from different Java versions. Relevant clean up options from other tabs have also been moved to this new tab.

You can use these clean ups while upgrading the Java version in your code.

java feature preferences
Pattern matching for instanceof clean up

A new clean up has been added that uses pattern matching for the instanceof operator when possible.

It is only applicable for Java 15 or higher when preview features are enabled.

To apply the clean up, select Pattern matching for instanceof check box on the Java Feature tab in your clean up profile.

pattern matching preferences

For the given code:

pattern matching before

One gets:

pattern matching after
Reduce indentation clean up

A new clean up has been added that removes useless indentation when the opposite workflow falls through.

When several blocks fall through, it reduces the block with the greatest indentation. It can negate an if condition if the else statements fall through.

To apply the clean up, select Reduce indentation when possible check box on the Code Style tab in your clean up profile.

reduce indentation preferences

For the given code:

reduce indentation before

One gets:

reduce indentation after
Extract increment clean up

A new clean up has been added that moves increment or decrement outside an expression.

A prefix increment/decrement (i`) first changes the value of the variable and then returns the updated value. A postfix increment/decrement (`i) first returns the original value and then changes the value of the variable.

But let’s look at this code:

int i = j++;

Most of the developers hardly remember which from the increment or the assignment comes first. One way to make the code obvious is to write the increment/decrement in a dedicated statement:

int i = j;
j++;

And so for the prefix expressions:

int i = ++j;

…​it goes like this:

j++;
int i = j;

The cleanup moves a prefix expression above the statement and a postfix expression below. It does not move increments from loop condition and it does not cleanup several increments in the same statement. The increment/decrement is always rewritten as a postfix expression for standardization.

To apply the clean up, select Extract increment/decrement from statement check box on the Code Style tab in your clean up profile.

extract increment preferences

For the given code:

extract increment before

One gets:

extract increment after
Use Comparator.comparing() clean up

A new clean up has been added that replaces a plain comparator instance by a lambda expression passed to a Comparator.comparing() method.

The feature is enabled only with Java 8 or higher.

The Comparator type must be inferred by the destination of the comparator. The algorithm of the comparator must be standard and based on one field or method. The cleanup can handle the null values and reversed orders.

To apply the clean up, select Use Comparator.comparing() check box on the Java Feature tab in your clean up profile.

comparator comparing preferences

For the given code:

comparator comparing before

One gets:

comparator comparing after
Multi-catch clean up

A new clean up has been added that converts catch clauses with same body to Java 7’s multi-catch.

The feature is enabled only with Java 7 or higher.

To apply the clean up, select Use Multi-catch check box on the Java Feature tab in your clean up profile.

multi catch preferences

For the given code:

multi catch before

One gets:

multi catch after
Convert fields into local variables

A new clean up has been added that refactors a field into a local variable if its use is only local.

The previous value should not be read. The field should be private. The field should not be final. The field should be primitive. The field should not have annotations.

To apply the clean up, select Convert fields into local variables if the use is only local check box on the Optimization tab in your clean up profile.

convert fields preferences

For the given code:

convert fields before

One gets:

convert fields after
Static inner class clean up

A new clean up has been added that makes inner class static if it doesn’t use top level class members.

To apply the clean up, select Make inner classes static where possible check box on the Optimization tab in your clean up profile.

static inner class preferences

For the given code:

static inner class before

One gets:

static inner class after
Use String.replace() clean up

A new clean up has been added that replaces String.replaceAll() by String.replace() when the pattern is a plain text.

The pattern must be constant.

To apply the clean up, select Use String.replace() instead of String.replaceAll() when no regex used check box on the Optimization tab in your clean up profile.

string replace preferences

For the given code:

string replace before

One gets:

string replace after
Primitive comparison clean up

A new clean up has been added that replaces the compareTo() method by a comparison on primitive.

It improves the space and time performance. The compared value must be a primitive.

To apply the clean up, select Primitive comparison check box on the Optimization tab in your clean up profile.

primitive comparison preferences

For the given code:

primitive comparison before

One gets:

primitive comparison after
Primitive parsing clean up

A new clean up has been added that avoids to create primitive wrapper when parsing a string.

The object should be used as a primitive and not as a wrapper.

To apply the clean up, select Primitive parsing check box on the Optimization tab in your clean up profile.

primitive parsing preferences

For the given code:

primitive parsing before

One gets:

primitive parsing after
Pull down common code from if/else statement clean up

A new clean up has been added that extracts common code from the end of an if / else if / else control flow.

Ultimately it removes the empty and passive if conditions.

The control flow should have an else clause and the duplicate code should not rely on variables declared in the block.

The statement matching performs a deep analysis. All the blocks should end with the same set of statements, or the blocks with different code should fall through with a jump statement (return, throw, continue or break).

To apply the clean up, select Pull down common code from if/else statement check box on the Duplicate code tab in your clean up profile.

control flow merge preferences

For the given code:

control flow merge before

One gets:

control flow merge after

And for the given code where all tails of blocks are identical except one block which falls through:

control flow merge jump statement before

The identical tails of blocks have been pulled down from the control flow and the falling through block has been left as it is:

control flow merge jump statement after
String.substring() clean up

A new clean up has been added that removes the second substring() parameter if this parameter is the length of the string. It’s the default value.

It must reference the same expression.

The expression must be passive.

To apply the clean up, select Redundant String.substring() parameter check box on the Unnecessary code tab in your clean up profile.

substring preferences

For the given code:

substring before

One gets:

substring after
Unreachable block clean up

A new clean up has been added that detects two if conditions that are identical and removes the second one.

The conditions should be passive.

No exceptions should be awaited.

It doesn’t create unreachable code below the if statement which would create a compile error. That is to say it avoids the case where only the removed block doesn’t fall through, all the other cases fall through, there are an else clause (not only if/else clauses) and a statement after the control workflow.

To apply the clean up, select Unreachable block check box on the Unnecessary code tab in your clean up profile.

unreachable block preferences

For the given code:

unreachable block before

One gets:

unreachable block after
Unlooped while clean up

A new clean up has been added that replaces a while loop that always terminates during the first iteration by an if.

The loop should not contain any continue statement.

The loop should only contain break statements without statements after.

To apply the clean up, select Convert loop into if when possible check box on the Unnecessary code tab in your clean up profile.

unlooped while preferences

For the given code:

unlooped while before

One gets:

unlooped while after
Source Fixing clean ups

A new tab named Source Fixing has been added to the Clean Up preferences. It lists the clean up options that fixes the behavior of the code. The Compare with != 0 for bitwise expression clean up option from Code style tab have also been moved to this new tab.

Use it carefully. You may get an unexpected behavior. It may trigger zombie code. A zombie code is a dead code that is dead because an error occurs before. The day someone fixes the error, the zombie code comes back to life and alters the behavior. Although most of the cleanups need review, those ones need testing.

source fixing preferences
Object.equals() on non null clean up

A new clean up has been added that inverts calls to Object.equals(Object) and String.equalsIgnoreCase(String) to avoid useless null pointer exception.

The caller must be nullable.

The parameter must not be nullable.

Beware! By avoiding null pointer exceptions, the behavior may change!

To apply the clean up, select Avoid Object.equals() or String.equalsIgnoreCase() on null objects check box on the Source Fixing tab in your clean up profile.

invert equals preferences

For the given code:

invert equals before

One gets:

invert equals after
Comparison to zero clean up

A new clean up has been added that fixes Comparable.compareTo() usage.

The code is not supposed to predict the 1 and -1 values; it is supposed to get zero or a value lesser or greater than zero.

Beware! The behavior may change if you implement a custom comparator!

To apply the clean up, select Compare to zero check box on the Source Fixing tab in your clean up profile.

comparison zero preferences

For the given code:

comparison zero before

One gets:

comparison zero after
Completion overwrites in Java editor

The Java Editor now uses Completion overwrites as the default. If Completion overwrites is on, the completion text replaces the characters following the caret position until the end of the word. If Completion inserts is on, the completion text is inserted at the caret position, so it never overwrites any existing text. Note that pressing Ctrl when applying a completion proposal toggles between the two insertion modes.

You can change the default in the Java > Editor > Content Assist preference page.

Insert best guessed parameters in Java editor

Instead of simply inserting the method parameter names as placeholders, when a method is completed, the Java Editor now inserts the best guessed parameters by default.

You can change the default in the Java > Editor > Content Assist preference page.

Quick assist to create new implementation

Invoking the Quick Assist (Ctrl+1) to create new implementation on an interface or abstract class declaration launches the New Java Class wizard:

quick assist interface
Quick fixes on permitted types

You can add sealed, non-sealed, or final modifiers on permitted type declarations, as applicable, using the new Quick Fixes (Ctrl+1).

On a permitted class declaration:

permitted class

On a permitted interface declaration:

permitted interface
Convert to switch expression

A new quick assist and clean up has been added that converts switch statements to switch expressions (Java 14 or higher) where possible.

Switch statements that use control statements such as nested switch statements, if/else blocks, for/while loops are not considered as is the case for return/continue statements. All cases of the switch statement must either have a last assignment statement that sets the same variable/field as other cases, or else has a throw statement. Fall-through is allowed between cases but only if there are no other statements in between. The switch statement must have a default case unless the switch expression is an enum type and all possible enum values are represented in the cases.

To apply the quick assist, press Ctrl+1 on the target switch statement and select Convert to switch expression, if offered.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Convert to switch expression check box on the Code Style tab (or the Java Feature tab starting from Eclipse 2021-03).

switch expressions preferences

For the given code:

switch expressions before

One gets:

switch expressions after
Uses the else-if pseudo keyword

A new clean up has been added that combines nested if statement in else block to else if.

Beware for any comments after the else keyword. It will be lost.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Combine nested 'if' statement in 'else' block to 'else if' check box on the Code Style tab.

For the given code:

else if before

One gets:

else if after
Bitwise expressions in comparisons

A new clean up has been added that replaces the > operator with != when the comparison expression has a bitwise expression operand and a 0 operand.

This resolves an anti-pattern for such kind of comparisons, which can also be a bug when the bitwise expression is involving a negative constant value. This code smell is further described by the FindBugs project as bug description "BIT: Check for sign of bitwise operation".

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Compare with != 0 for bitwise expression on the Code Style tab (or the Source fixing tab starting from Eclipse 2021-03).

bitwise expressions preferences

For the given code:

bitwise expressions before

You get this after the clean up:

bitwise expressions after
Pull up assignment

A new clean up has been added that moves assignments inside an if condition above the if node.

It improves the readability of the code.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Pull up assignment check box on the Code Style tab.

For the given code:

pull up assignment before

One gets:

pull up assignment after
Use switch

A new clean up has been added that replaces if/else if/else blocks to use switch when possible.

It converts to switch when there are more than two cases.

It does not convert if the discriminant can be null, that is to say only primitive.

It does a variable conflict analyze.

The case value can be literals or constants.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Convert if/else if/else chain to switch check box on the Code Style tab.

For the given code:

use switch before

One gets:

use switch after
Add elements in collections without loop

A new clean up has been added that uses Collection.addAll() or Collections.addAll() instead of a for loop.

It refactors for loops with index, for loops with iterator and foreach loops.

If the source is an array, the list is raw, and the Java version is 1.5 or higher, we use Arrays.asList() to handle the erasure type. It doesn’t decrease the performance.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Add elements in collections without loop check box on the Code Style tab.

add remove preferences

For the given code:

add remove before

One gets:

add remove after
Use ternary operator

A new clean up has been added that replaces (X && Y) || (!X && Z) by X ? Y : Z.

The operands must be passive and boolean.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Replace (X && Y) || (!X && Z) by X ? Y : Z check box on the Duplicate Code tab.

ternary operator preferences

For the given code:

ternary operator before

One gets:

ternary operator after
Use '==' or '^' on booleans

A new clean up has been added that replaces (X && !Y) || (!X && Y) by X ^ Y and replaces (X && Y) || (!X && !Y) by X == Y.

It only works on boolean.

It works with lazy or eager operators.

The operands must be passive.

It does not matter an operand is on the left or right.

It does a deep negation expression analyze.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Use '==' or '^' on booleans check box on the Duplicate Code tab.

For the given code:

xor before

One gets:

xor after
Redundant falling through blocks

A new clean up has been added that detects a list of statements that ends with a jump statement (return, break, continue or throw), and has the same list of statements below that.

It detects similar statements. It also checks that the declarations of the variables in the statements are the same. It looks for redundant statements in if, else, catch and finally but not in loops.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Remove redundant end of block with jump statement check box on the Duplicate Code tab.

For the given code:

redundant falling blocks before

One gets:

redundant falling blocks after
Redundant if condition

A new clean up has been added that removes a condition on an else that is negative to the condition of the previous if.

The condition must be passive. The removed code should not throw an expected exception. The cleanup uses a deep condition comparison algorithm.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Redundant if condition check box on the Duplicate Code tab.

For the given code:

if condition before

One gets:

if condition after
Use Objects.hash()

A new clean up has been added that rewrites Eclipse-autogenerated hashCode() method by Eclipse-autogenerated hashCode() method for Java 7 using Objects.hash().

Let’s remind that you can autogenerate your hashCode() and equals() methods by right-clicking on your class, selecting Source and clicking on Generate hashCode() and equals() methods…​. Since Eclipse 2018-09, a checkbox allows you to generate your methods using Java 7 API. This cleanup rewrites your method as if it has been generated using this option.

This clean up does not generate again your method from scratch, it rewrites it using a more modern syntax. That is to say, if your method is missing or voluntary does not process a field, this field still won’t be processed.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Use Objects.hash() check box on the Unnecessary Code tab (or the Java Feature tab starting from Eclipse 2021-03).

hash preferences

For the given code:

hash before

One gets:

hash after
Use String.join()

A new clean up has been added that uses String.join() when possible.

It detects all types of for loops. The delimiter can be added before or after. The condition can be a boolean or an index comparison.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Use String.join() check box on the Unnecessary Code tab (or the Java Feature tab starting from Eclipse 2021-03).

For the given code:

string join before

One gets:

string join after
Use Arrays.fill()

A new clean up has been added that replaces for loops to use Arrays.fill() where possible.

The value must be hard-coded.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Use Arrays.fill() check box on the Unnecessary Code tab.

For the given code:

arrays fill before

One gets:

arrays fill after
Evaluate without null check

A new clean up has been added that removes redundant null checks.

It removes null check on value before equals() or equalsIgnoreCase() method and before instanceof expression.

It only removes redundant passive expressions.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Evaluate without null check check box on the Unnecessary Code tab.

For the given code:

redundant null check before

One gets:

redundant null check after
Avoid double negation

A new clean up has been added that reduces double negation in boolean expression.

It removes negations on both operands in an equality/difference operation.

It prefers equality/difference operation rather than negated operand.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Double negation check box on the Unnecessary Code tab.

For the given code:

double negation before

One gets:

double negation after
Redundant comparison statement

Removes useless bad value checks before assignments or return statements. Such useless bad value checks are comparing an expression against bad value, then either assigning bad value or the expression depending on the result of the bad value check. It is simpler to directly assign the expression.

The expression should be passive.

The excluded value should be hard coded.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Remove redundant comparison statement check box on the Unnecessary Code tab.

For the given code:

redundant comparison statement before

One gets:

redundant comparison statement after
Unnecessary super() call

A new clean up has been added that removes call to super constructor with empty arguments.

Such a call is redundant. See JLS section 12.5 for more info.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Remove redundant super() call in constructor check box on the Unnecessary Code tab.

For the given code:

redundant super before

One gets:

redundant super after
Initialize collection at creation

A new clean up has been added that replaces the creation of a new Collection, then invoking Collection.addAll() on it, by the creation of the new Collection with the other Collection as parameter.

Only well known collection classes are refactored to avoid behavior changes. The cleanup is enabled only if there is no useful instantiation parameters.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Initialize collection at creation check box on the Unnecessary Code tab.

For the given code:

collection cloning before

One gets:

collection cloning after
Initialize map at creation

A new clean up has been added that replaces creating a new Map, then invoking Map.putAll() on it, by creating the new Map with the other Map as parameter.

Only well known map classes are refactored to avoid behavior changes. The cleanup is enabled only if there is no useful instantiation parameters.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Initialize map at creation check box on the Unnecessary Code tab.

For the given code:

map cloning before

One gets:

map cloning after
Remove overridden assignment

A new clean up has been added that removes passive assignment when the variable is reassigned before being read.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Remove overridden assignment check box on the Unnecessary Code tab.

For the given code:

overridden assignment before

One gets:

overridden assignment after
Raise embedded if into parent if

A new clean up has been added that merges inner if statement into the parent if statement.

The cleanup checks that there is no else statement.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Raise embedded if into parent if check box on the Unnecessary Code tab.

For the given code:

embedded if before

One gets:

embedded if after
Redundant return

A new clean up has been added that removes useless lone return at the end of a method or lambda.

The cleanup checks that there is no value on the return statement.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Remove useless return check box on the Unnecessary Code tab.

For the given code:

redundant return before

One gets:

redundant return after
Redundant continue

A new clean up has been added that removes useless lone continue at the end of a loop.

A continue statement at the end of a loop is removed. A continue statement at the end of a control statement is removed if the control statement is at the end of a loop. A continue statement is kept if it has a label.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Remove useless continue check box on the Unnecessary Code tab.

For the given code:

redundant continue before

One gets:

redundant continue after
Use try-with-resource

A new clean up has been added that changes code to make use of Java 7 try-with-resources feature. In particular, it removes now useless finally clauses.

It may move an inner closeable assignment as a resource. It handles finally with a simple close() invocation, a null-check and remaining statements below.

It is only enabled from Java 7 and it also handles the Java 9 syntax.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Use try-with-resource check box on the Unnecessary Code tab (or the Java Feature tab starting from Eclipse 2021-03).

For the given code:

try with resource before

One gets:

try with resource after
Exit loop earlier

A new clean up has been added that adds a break to avoid passive for loop iterations.

The inner assignments must not do other different assignments after (assign other values or assign into other variables).

There must be no side effects after the first assignments.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Exit loop earlier check box on the Optimization tab.

For the given code:

break loop before

One gets:

break loop after
Use StringBuilder

A new clean up has been added that replaces String concatenation by StringBuilder when possible.

It uses StringBuffer for Java 1.4-.

It only replaces strings on several statements and the concatenation should have more than two pieces.

The variable should be only concatenated and it should retrieve the string once.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Replace String concatenation by StringBuilder check box on the Optimization tab.

For the given code:

stringbuilder before

One gets:

stringbuilder after
Primitive serialization

A new clean up has been added that replaces a primitive boxing to serialize by a call to the static toString() method.

It works for all the primitive types: boolean, char, byte, short, int, long, float and double.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Primitive serialization check box on the Optimization tab.

For the given code:

primitive serialization before

One gets:

primitive serialization after
Prefer boolean literal

A new clean up has been added that replaces Boolean.TRUE/Boolean.FALSE by true/false when used as primitive.

To apply the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog, select Prefer boolean literals check box on the Optimization tab.

boolean literal preferences

For the given code:

boolean literal before

One gets:

boolean literal after
Diamond operator <> (Remove redundant type arguments)

The clean up Remove redundant type arguments has been renamed Use diamond operator and is still available in the Unnecessary Code tab in Eclipse 2020-12.

The clean up will be moved to the future Java Feature tab in Eclipse 2021-03.

Java Views and Dialogs

A new preference option has been added and enabled by default: Preferences > Java > Enable parallel index search. Depending on the available hardware, this option should improve performance for all index based Java search operations, but could also lead to possible regressions. To switch back to the old sequential index search, turn this option off:

parallel index search
Coloring restricted identifiers

A new option named Restricted identifiers has been added under Java category in Java > Editor > Syntax Coloring preferences.

Some identifiers (e.g. var, yield, record etc.) are restricted identifiers because they are not allowed in some contexts. Semantic highlighting options for such identifiers can be controlled by the element Restricted identifiers under Java category in Java > Editor > Syntax Coloring preference page.

restricted identifier preference
Externally annotate sources

The concept of external null annotations has been extended to apply to source folders, too.

External annotations were introduced in Eclipse 4.5 in order to overlay not-editable library classes with null annotations to specify the null contract against which library calls should be analysed. You can now apply the same concept for another kind of classes that should not be edited: generated source code.

In the Java Build Path dialog, also source folders now have a node External annotations where a path to Eclipse External Annotation files (.eea) can be configured.

annotate sources config

Given a project that is configured for annotation based null analysis, and given a Java class inside a source folder configured for external annotations, the editor now offers a quick assist (Ctrl+1) for annotating individual type references in the signatures of methods and fields.

annotate sources assist

The selected option will record that the return type should be interpreted as @NonNull List<Attribute> (the popup to the right showing the internal format how this annotation will be stored in an .eea file). With this annotation in place, the annotated signature will be shown in hovers and will be used for null analysis:

annotate sources effect
static import org.mockito.Mockito.* available as favorite

Imports for static org.mockito.Mockito. are added to the Java favorites in the preferences under *Java > Editor > Content Assists > Favorites. This way the organize imports action in the IDE will automatically add static imports to this class when you use the Mockito library in your tests.

Fine-grained search for permitted types

You can perform a fine-grained search for permitted type declarations in the Search dialog (Ctrl+H) > Java Search > Limit To > Match Locations with the new option:

search permitted type
Sort library entries alphabetically in Package Explorer enabled by default

The Preferences > Java > Appearance > [x] Sort library entries alphabetically in Package Explorer is now enabled by default. This makes it easier for you to see if a library is available or not.

If you want to see the order in which the libraries are added to the classpath, e.g. to understand classpath loading issues, you can disable the preference.

Debug

Toggle tracepoints in editor ruler

A new Toggle Tracepoint context-menu entry has been added to the Java Editor line ruler. Both the Toggle Tracepoint options i.e. the new context-menu entry and the existing option under Run menu have a new icon and are now available for Java class files also along with Java source files.

toggle tracepoints
Toggle breakpoint on a list of methods including abstract method

You can now Toggle Method Breakpoint on a list of methods which includes an abstract method.

debug toggle breakpoint
Support for @argfiles when launching

A new check box was added to the Arguments tab for Java based launch configurations (Java Application, JUnit, and others) for writing arguments into an @argfile. This is disabled below Java 9 and can be enabled for Java programs launched with Java 9 and above.

launch with argfile
Stabilized logical structures in Variables view with active GC

The Debug view no longer breaks when logical structures are shown while the application’s garbage collector is active (com.sun.jdi.ObjectCollectedException occurred while retrieving value).

Java Formatter

Annotations wrapping

The formatter now allows more control over how multiple annotations on a single element should be divided into lines. Previously, they could either all be placed in a single line along with the annotated element, or each in a separate line. The settings that controlled this behavior (in the New Lines > After annotations section) now only control a line break between the last annotation and the annotated element. Line breaks between annotations are controlled by a new group of settings in the Line Wrapping > Wrapping Settings > Annotations section.

Just like with standard wrapping settings, they can be set to keep everything in a single line (Do not wrap), each annotation in a separate line (Wrap all elements), or only break lines that exceed the width limit (Wrap where necessary). The last option along with the Never join already wrapped lines setting effectively means manual control over each case. The annotation wrapping settings differ from other wrapping settings in that the indentation control is not available.

The formatter configuration sections can be found in the Profile Editor (Preferences > Java > Code Style > Formatter > Edit…​).

formatter wrap annotations

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.19.0 and Red Hat CodeReady Studio 12.19 out we are already working on the next release.

Enjoy!

Jeff Maury

JBoss Tools 4.18.0 and Red Hat CodeReady Studio 12.18 for Eclipse 2020-09 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.17 (2020-09) but we recommend using the latest Eclipse 4.17 2020-09 JEE Bundle since then you get most of the dependencies preinstalled.

Java11 is now required to run Red Hat Developer Studio or JBoss Tools (this is a requirement from Eclipse 4.17). So make sure to select a Java11 JDK in the installer. You can still work with pre-Java11 JDK/JRE and projects in the tool.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was an improved tooling for the Quarkus framework, improvements for container based development and bug fixing.

OpenShift

Devfile based deployments

The Application Explorer view is now based on odo 2.x, which allows deployments to be based on devfile (developer oriented manifest file). The components from the default odo registry are listed with legacy S2I components:

devfile

It is also now possible to bootstrap from an empty project as the components from the registry may expose starter projects (sample code that will initialize your empty project).

devfile1

Quarkus

Support for codestarts in New Quarkus project wizard

code.quarkus.io has added a new option codestart that allows extension that support this new feature to contribute sample code in the generated project. It is enabled by default and is accessible from the second step in the wizard:

quarkus30

Server Tools

Wildfly 22 Server Adapter

A server adapter has been added to work with Wildfly 22.

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.27.Final and Hibernate Tools version 5.4.27.Final.

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.20.Final and Hibernate Tools version 5.3.20.Final.

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.18.0 and Red Hat CodeReady Studio 12.18 out we are already working on the next release.

Enjoy!

Jeff Maury

JBoss Tools 4.17.0 and Red Hat CodeReady Studio 12.17 for Eclipse 2020-09 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.17 (2020-09) but we recommend using the latest Eclipse 4.17 2020-06 JEE Bundle since then you get most of the dependencies preinstalled.

Java11 is now required to run Red Hat Developer Studio or JBoss Tools (this is a requirement from Eclipse 4.17). So make sure to select a Java11 JDK in the installer. You can still work with pre-Java11 JDK/JRE and projects in the tool.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was an improved tooling for the Quarkus framework, improvements for container based development and bug fixing. Eclipse 2020-09 itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse 2020-09 and JBoss Tools plugins that I think are worth mentioning.

OpenShift

OpenShift Container Platform 4.6 support

With the new OpenShift Container Platform (OCP) 4.6 now available, JBoss Tools is compatible with this major release in a transparent way. Just define your connection to your OCP 4.6 based cluster as you did before for an OCP 3 cluster, and use the tooling !

Quarkus

Support for YAML configuration file

Quarkus supports configuration through YAML format. For more information, see the Quarkus documentation

In order to use it, follow the steps:

  • create a Quarkus project using the new Quarkus wizard

  • create a new application.yaml or application.yml next to the application.properties in src/main/resources

The editor will open and you will get content assist and syntax validation.

Server Tools

Wildfly 21 Server Adapter

A server adapter has been added to work with Wildfly 21. It adds support for Java EE 8, Jakarta EE 8 and Microprofile 3.3.

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.21.Final and Hibernate Tools version 5.4.21.Final.

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.18.Final and Hibernate Tools version 5.3.18.Final.

Platform

Views, Dialogs and Toolbar

Adjustable view fonts

The font used for tree and table views can now be customized with a font preference. This preference is called "Tree and Table font for views" and can be found in Window > Preferences > General > Appearance > Colors and Fonts under the "View and Editor Folders" category.

adjustable view font preference

The Project Explorer is an example of a view that gets affected by this font preference.

adjustable view font
Remove gifs from views

Several years ago, the icons of the platform views were migrated to .png files. As already opened views store their reference to the image, the .gif files were left in the code. These have been removed now. If you are using the same workspace for multiple years and view icons are missing due to that removal, you have to close and reopen the view.

Default changed for confirm on exit for last window

By default, Eclipse now closes if you select the close icon on the last window without additional confirmation dialog. If you want to get a confirmation dialog, you can enable that via Window > Preferences > General > Startup and Shutdown > Confirm exit when closing last window.

Workbench models created in releases before 2014 are not automatically converted

Workbench models (workbench.xmi) stored in workspaces created with releases before 2014 and never opened with a later release are not automatically converted anymore if opened with the 2020-09 release.

Text Editors

Multiple Last Edit Locations

Previous Edit Location navigation (formerly named Last Edit Location) is now expanded to remember multiple edit locations.

The last 15 edit locations are now remembered. For convenience, similar edit locations in close proximity to each other are also merged so that each of the 15 remembered locations remains distinct.

multiple last edit locations

How to use

Two new keyboard shortcuts are introduced:

  • Ctrl+Alt+LEFT_ARROW (or on Mac Ctrl+Opt+LEFT_ARROW) navigates to the most recent edit location, just as Ctrl+Q always has in prior releases.

    However, now continuing to hold Ctrl+Alt and then pressing LEFT_ARROW again begins a traversal through the history of prior edit locations, with each additional press of LEFT_ARROW moving a step further back in history. Once traversal stops, future Ctrl+Alt+LEFT_ARROW actions are now temporarily anchored to this older historical location for easy exploration of that code region.

    The classic Ctrl+Q mapping has been likewise enhanced with this new functionality, so that Ctrl+Q and Ctrl+Alt+LEFT_ARROW are synonymous.

  • Ctrl+Alt+RIGHT_ARROW (or on Mac Ctrl+Opt+RIGHT_ARROW) conversely moves the anchor forward through edit history, so after traversing backward with Ctrl+Alt+LEFT_ARROW, you can go forward again by holding Ctrl+Alt and repeatedly pressing RIGHT_ARROW. A new menu item has likewise been added for this forward navigation as well.

New edit locations are always inserted at the end, so original historical ordering is always maintained. New edits also reset the last location "anchor" back to the most recent edit, so that pressing Ctrl+Alt+LEFT_ARROW once again brings you to the most recent edit rather than a historical one.

Printing editor content adds date in header

Printing editor content now includes the current date in addition to the filename in the header of each printed page.

print header date

Themes and Styling

Improved GTK light theme

The GTK light theme has been updated to align better with the default GTK3 Adwaita theme.

Old:

gtk light old

New:

gtk light new
Windows menus are styled in the dark theme

SWT now natively styles the menu under Windows in the dark theme.

Old:

menu background old

New:

menu background dark
Dropbox boxes (Combos) are styled under Windows in the dark theme

SWT now natively styles drop-down boxes under Windows in the dark theme.

Old:

combo win32 dark old

New:

combo win32 dark new
Selection highlighter for dark theme

The active tab selection highlighter has been enabled for Eclipse’s default dark themes. This will help users identify which tab is active at a glance.

dark selection highlighter
Selection highlighter for tables under Windows in the dark theme

SWT now natively supports selection highlighter in tables under Windows in the dark theme.

selection highlight

Debug

Filter null bytes from console output

The interpretation of ASCII control characters in the Console View was extended to recognize the characters: \0 - null byte. If interpretation is enabled, any null byte will be stripped and not shown in console view. This is most relevant for the Linux platform where a null byte in console view causes anything after it on the same line to be not rendered.

This feature is disabled by default. You can enable it on the Run/Debug > Console preference page.

General Updates

Builds for Linux AArch64 (aka Arm64) added

Binaries for Linux AArch64 (Arm64) are available for testing. With the raising popularity of this architecture people can continue using the Eclipse IDE even when changing their machine.

Java Developement Tools (JDT)

Java 15 Support

Java 15

Java 15 is out and Eclipse JDT supports Java 15 for 4.17 via Marketplace.

The release notably includes the following Java 15 features:

  • JEP 378: Text Blocks (Standard).

  • JEP 384: Records (Second Preview).

  • JEP 375: Pattern Matching for Instanceof (Second Preview).

  • JEP 360: Sealed Classes (Preview).

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

JUnit

Collapse all nodes in JUnit view

JUnit view now provides a context-menu option to collapse all nodes:

junit collapse all
Sort test results by execution time

JUnit view now provides the ability to sort results by execution time. By default, results will be sorted by execution order. Choosing Sort By > Execution Time from the JUnit View menu will reorder the results once all tests are complete. While tests are still running, they will be shown in execution order.

junit sort time before

Sorting by execution order results in:

junit sort time after

Java Editor

Substring/Subword matches for types

Content Assist now fully supports both substring and subword matches for types:

substring types

Substring matches are always shown and subword matches can be enabled/disabled with the existing Show subword matches option on the Java > Editor > Content Assist preference page.

Optimization tab

A new tab has been added that gathers cleanups that improve the time performance: the existing lazy operator cleanup and the regex precompiler cleanup.

regex preferences
Objects.equals()

A new clean up has been added that makes use of Objects.equals() to implement the equals(Object) method.

It reduces the code and improves the reading. The cleanup is only available for Java 7 or higher. Although this kind of comparison is almost exclusively seen in the equals(Object) method, it can also reduce code in other methods.

To select the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Use Objects.equals() in the equals method implementation on the Unnecessary Code tab.

objects equals preferences

For the given code:

objects equals before

You get this after the clean up:

objects equals after
Precompiles the regular expressions

A new clean up has been added that optimizes the regular expression execution by precompiling it.

It replaces some usages of java.lang.String by usages of java.util.regex.Pattern. The cleanup is done only if it is sure that the string is used as a regular expression. If there is any doubt, nothing is done. The regular expression must be explicitly used several times to be sure the cleanup is useful.

To select the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Precompiles reused regular expressions on the Optimization tab.

regex preferences

For the given code:

regex before

You get this after the clean up:

regex after
String.format quickfix

A new quickfix has been added to replace string concatenation with String.format, similar to the existing ones for StringBuilder and MessageFormat.

String.format quickfix
Method reference quickfix

A new quickfix has been added to create missing methods for method references.

Current restriction is that this quickfix is only available on current class.

Expect current implementation to work on simple cases only.

Method references invoking nested generics or type parameters might be problematic to resolve correct.

methodreference 1

Java Views and Dialog

Toggle Code Minings From Find Actions Menu

The code minings within an editor can be enabled/disabled through the Find Actions menu (Ctrl+3).

toggle code minings

Java Formatter

Assert statement wrapping

A new setting in the Formatter profile controls line wrapping of assert statements. A line wrap can be added between the assert condition and its error message. The setting can be found in the Profile Editor (Preferences > Java > Code Style > Formatter > Edit…​) in the Line Wrapping > Wrapping Settings > Statemtens > 'assert' messages node.

formatter wrap assert

Debug

Anonymous class instance in evaluation

The JDT debugger is now capable of inspecting/evaluating expressions with anonymous class instances.

anon instance inspection code
anon instance inspection
JEP 358: Helpful NullPointerExceptions

The JDT debugger has now a checkbox option to activate the command line support for JEP 358. This is disabled below Java 14 and enabled by default for Java programs launched with Java 14 and above.

-XX:+ShowCodeDetailsInExceptionMessages

helpfulNullPointerExceptions

JVM is now capable of analyzing which variable was null at the point of NullPointerException and describe the variable with a null-detail message in the NPE.

Actual type in Variables view

The option Show Type Names in the Variables and Expressions views now displays the value’s actual type instead of its declared type. This simplifies debugging especially when variable details (toString()) is shown As the label for all variables.

To enable Show Type Names in the Variables view, column mode must be disabled (View Menu > Layout > Show Columns).

Example:

Object s = "some string";
	Collection<?> c = Arrays.asList(s, 1);
	// breakpoint
variables actual type

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.17.0 and Red Hat CodeReady Studio 12.17 out we are already working on the next release.

Enjoy!

Jeff Maury

JBoss Tools 4.16.0 and Red Hat CodeReady Studio 12.16 for Eclipse 2020-06 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.16 (2020-06) but we recommend using the latest Eclipse 4.16 2020-06 JEE Bundle since then you get most of the dependencies preinstalled.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was a new tooling for the Quarkus framework, improvements for container based development and bug fixing. Eclipse 2020-06 itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse 2020-06 and JBoss Tools plugins that I think are worth mentioning.

OpenShift

Secure URL support

It is now possible to create secured URLs in the Application Explorer View. If you select this option, the created URL will be accessible through https.

secure url

When such an URL is displayed in the tree, the icon now has a secure lock indicator.

secure url1

OpenShift Container Platform 4.5 support

With the new OpenShift Container Platform (OCP) 4.5 now available, JBoss Tools is compatible with this major release in a transparent way. Just define your connection to your OCP 4.4 based cluster as you did before for an OCP 3 cluster, and use the tooling !

Quarkus

Server Tools

Wildfly 20 Server Adapter

A server adapter has been added to work with Wildfly 20. It adds support for Java EE 8, Jakarta EE 8 and Microprofile 3.3.

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.17.Final and Hibernate Tools version 5.4.17.Final.

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.17.Final and Hibernate Tools version 5.3.17.Final.

Platform

Views, Dialogs and Toolbar

Create missing folders from the New File wizard

You can now create missing folders directly via the New File wizard, without explicitly creating folders beforehand.

file and folder

Text Editors

Support for ligatures on Windows

Eclipse now supports font ligatures on Windows. It was already supported on Linux and macOS. You can specify the font with ligatures to be used by the Text editors using the preference:

General > Appearance > Colors and Font > Basic > Text Font

Screenshot of ligatures rendered in the Java Editor on Windows 10:

eclipse ligatures support win

Themes and Styling

Native dark scrollbars in Windows dark theme

The Eclipse dark theme now uses the native dark scrollbars and retired the software solution for the editor area.

dark theme scrollbars
Eclipse toolbar’s styling on Windows aligned with Win 10

The default Eclipse light theme has been updated to align better with the Windows 10 default theme.

Old:

old light theme

New:

new light theme
Square tabs for views

Square tabs are now used by default for the views in the Eclipse IDE.

dark theme square tabs

In order to switch back to using round tabs, a preference has been added.

round tabs preference option
Consistent toolbar colors in dark theme

The toolbar styling in the dark theme is now consistent.

dark theme toolbar

Preferences

Verify installation operations against current JRE

A new option (on by default) is available in the Install/Update preference page: Verify provisioning operation is compatible with current running JRE. This enables some extra check when installing, updating or uninstalling content using the standard dialogs so the operation will fail with a useful message if the units you’re installing require a newer or incompatible Java runtime than the one that’s currently in use to run the IDE.

incompatibleJREPref

Here is how the error message looks like, for example when you’re trying to install a unit that requires Java 14 and you’re running the Eclipse IDE with an older Java version:

incompatibleJREMessage
Preference to inline rename resource

The preference to rename resource inline or using dialog was added in 4.15 as a radio button and has now been changed to a check box.

inlineRenameResource

Debug

'Select All' and 'Deselect All' for Import breakpoints wizard

You can now use Select All or Deselect All buttons to select or deselect all the breakpoint markers during import of breakpoints.

import selectall

General Updates

Show key bindings when command is invoked

For presentations, screen casts and learning purposes, it is very helpful to show the corresponding key binding when a command is invoked. This was added some releases ago.

show keybindings

It is now possible to enable this feature separately for keyboard interaction and mouse clicks. So you can enable it for mouse clicks only, for keyboard interaction only or for both. Enabling this only for mouse clicks is very helpful for users who want to learn existing key bindings.

You can enable this on the Preferences dialog via the Show key binding when command is invoked group on the General > Keys preference page. To change this setting quickly the command 'Toggle Show Key Bindings' can be used (e.g. via the find actions dialog).

show keybindings pref
Ant 1.10.8

Eclipse has adopted Ant version 1.10.8.

Java Developement Tools (JDT)

Java 14 Support

Java 14

Java™ 14 is available and Eclipse JDT supports Java 14 for the Eclipse 4.16 release.

The release notably includes the following Java 14 features:

  • JEP 361: Switch Expressions (Standard).

  • JEP 359: Records (Preview).

  • JEP 368: Text Blocks (Second Preview).

  • JEP 305: Pattern Matching for Instanceof (Preview).

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

Set JDK Compliance to 14

You can set the JDK compliance to 14 and enable the preview features in Preferences > Java > Compiler:

jdk compliance 14
Template to create new record

You can use the new_record template to create a record in an empty .java file:

newrecord
Record Creation Wizard

You can create a new record using the Record creation wizard that can be opened by:

  • Right Click on the Project > New > Record

  • Right Click on the Project > New > Other and search for Record

  • Right Click on the Project > New > Other > Java > Record

The Record creation wizard comes up as shown below.

fileAddJ14RecordCreation

Note: In older workspaces the "Record" entry may not appear directly under the "New" menu in the Java perspective. To resolve this, either use a new workspace or launch eclipse with the option -clearPersistedState for your existing workspace.

Enable preview features

You can now quickly enable the preview features on an applicable Java project by right-clicking on it and selecting Configure > Enable preview features:

enable preview

You can also change the default severity (warning) of the preview features compile problem in the opened Project properties dialog:

preview severity

Java Editor

Non-blocking Java code completion

By default, code completions in the Java editor are now configured to be computed (when possible) in a separate non-UI thread in order to prevent UI freezes in case of long computations.

Users can restore the legacy behavior in Preferences > Java > Editor > Content Assist > Advanced by unchecking the enable non-blocking completion checkbox; integrators can change the value of the org.eclipse.jdt.ui.content_assist_noUIThread_computation to false.

jdtNonBlockingCompletionPref
Merge control workflows

A new clean up has been added that merges conditions of if/else if/else that have the same blocks when it is possible.

The code in the blocks should be the same. An else block may be different and won’t be merged. One condition may be made opposite to allow the merge. The conditions are merged with || to keep the control workflow the same. Parenthesis is added to avoid priority issue. Most of the brackets, formatting and comments are kept.

To select the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Merge conditions of if/else if/else that have the same blocks on the Unnecessary Code tab.

merge control workflows preferences

For the given code:

merge control workflows before

You get this after the clean up:

merge control workflows after
Local variable type inference

A new clean up has been added that makes use of the var keyword for the local variable when it is possible and is enabled only for Java 10 and higher.

The clean up replaces the explicit variable type by var when this type can be known by the variable initialization. It also replaces the diamond operator in instance creation by a parameterized type. Eventually, it adds a suffix to initialization number literal to match the variable type. In any case, the variable type is still exactly the same.

To select the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Use the local variable type inference on the Code Style tab.

var preferences

For the given code:

var before

You get this after the clean up:

var after
Prefer lazy logical operators

A new clean up has been added that replaces eager logical operators by lazy operators when it is possible.

The clean up respectively replaces | and & by || and && when the following operands can’t make side effect. Any assignments, increments, decrements, object creations or method call may cause side effect. So, in such case, it will keep the eager operator. It also leaves the binary operations as it is.

To select the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Use the lazy logical operator on the Code Style tab.

lazy logical preferences

For the given code:

lazy logical before

You get this after the clean up:

lazy logical after
Quick fix to change return statement to yield statement in Switch Expression

A quick fix has been added to convert a return statement in a Switch Expression to yield statement.

quickfix switch expression return to yield

Java Formatter

Record declarations support

A lot of new settings have appeared in the formatter profile to control the formatting of record declarations. They are very similar to existing settings related to other type declarations. To see them all, you can use the filter field and type in the keyword record.

formatter records

Debug

Synthetic variables inspection

The JDT debugger is now capable of inspecting synthetic variables which are generated by the Java compilers. One such example is debugging the following method ` java.util.stream.ReferencePipeline.filter(Predicate<? super P_OUT>)` and inspecting the predicate variable.

Before:

synthetic var without fix

Now:

synthetic var with fix

Preferences

Substring Matching

The content assist preference option Show Substring Matches has been removed and the feature is now always enabled.

Any application or user can still disable it using the VM property: -Djdt.codeCompleteSubstringMatch=false

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.16.0 and Red Hat CodeReady Studio 12.16 out we are already working on the next release for Eclipse 2020-09.

Enjoy!

Jeff Maury

JBoss Tools 4.15.0 and Red Hat CodeReady Studio 12.15 for Eclipse 2020-03 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.15 (2020-03) but we recommend using the latest Eclipse 4.15 2020-03 JEE Bundle since then you get most of the dependencies preinstalled.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was a new tooling for the Quarkus framework, improvements for container based development and bug fixing. Eclipse 2020-03 itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse 2020-03 and JBoss Tools plugins that I think are worth mentioning.

OpenShift

OpenShift Container Platform 4.4 support

With the new OpenShift Container Platform (OCP) 4.4 now available, JBoss Tools is compatible with this major release in a transparent way. Just define your connection to your OCP 4.4 based cluster as you did before for an OCP 3 cluster, and use the tooling !

Quarkus

Language support for Kubernetes, Openshift, S2i and Docker properties

There is now completion, hover, documentation and validation for kubernetes., openshift., s2i., docker. properties

quarkus20

Enter kubernetes prefix:

quarkus21

Enter openshift prefix:

quarkus22

Enter s2i prefix:

quarkus23

Language support for MicroProfile REST Client properties

Likewise, there is now completion, hover, documentation and validation for the MicroProfile properties from REST Client.

After registering a REST client using @RegisterRestClient like so:

package org.acme;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

@RegisterRestClient
public interface MyServiceClient {
	@GET
    @Path("/greet")
    Response greet();
}

The related MicroProfile Rest config properties will have language feature support (completion, hover, validation, etc.).

quarkus24

Change the Java code so that the configuration key is changed:

package org.acme;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

@RegisterRestClient(configKey = "myclient")
public interface MyServiceClient {
	@GET
    @Path("/greet")
    Response greet();
}

and notice the code assist is changed accordingly:

quarkus25

Language support for MicroProfile Health

Likewise, there is now completion, hover, documentation and validation for the MicroProfile Health artifacts.

So if you have the following Health class:

package org.acme;

import org.eclipse.microprofile.health.Health;

@Health
public class MyHealth {

}

you will get a validation error (as the class does not implement the HealthCheck interface:

quarkus26

Similarly, if you have a class that implements HealthCheck but is not annotated with Health, some workflow applies:

package org.acme;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;

public class MyHealth implements HealthCheck {

	@Override
	public HealthCheckResponse call() {
		// TODO Auto-generated method stub
		return null;
	}

}

you will get a validation message (as the class is not annotated with Health interface):

quarkus27

As there are several ways to fix the problem, then several quick fixes are proposed.

Better extensions reporting in the Quarkus project wizard

With the Quarkus extensions ecosystem growing, we improved information about extensions in the Quarkus project wizard.

When you select an extension in the wizard, you will see the extension description in the lower side of the wizard. If the extension has a guide on the Quarkus web site, a link will also be displayed and clicking on that link will open the guide on your local web browser.

quarkus28
quarkus29

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.14.Final and Hibernate Tools version 5.4.14.Final.

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.16.Final and Hibernate Tools version 5.3.16.Final.

Platform

Views, Dialogs and Toolbar

Hierarchical project layout by default in Project Explorer

To better handle multi-module, nested and hierarchical projects, the default project layout in Project Explorer view has been changed from Flat to Hierarchical.

You can restore the layout to Flat using the view menu (⋮).

Debug

Console View now interprets form feed and vertical tab characters

The interpretation of ASCII control characters in the Console View was extended to recognize the characters: \f - form feed and \v - vertical tab (in languages that support it).

This feature is disabled by default. You can enable it on the Run/Debug > Console preference page.

formfeed
Termination time in Console View

The Console View label will now show the termination time of a process in addition to the launch time.

process termination time

Preferences

Preference to select resource rename mode

A preference has been added in the General preferences page, that allows you to select the resource renaming mode in the Project Explorer: either open an inlined text field or a dialog. By default, the inline rename mode is selected.

The preference can also be specified via product customization:

  • org.eclipse.ui.workbench/RESOURCE_RENAME_MODE=inline

  • org.eclipse.ui.workbench/RESOURCE_RENAME_MODE=dialog

Rename that would affect more than 1 resource is always performed with a dialog.
resource rename mode preference

Themes and Styling

Welcome screen in dark theme

When Eclipse is in dark theme, the welcome screen also appears dark on macOS and Linux.

dark welcome

General Updates

Interactive performance

Interactive performance has been further improved in this release.

Redraw is turned off by default during collapse and expand operations in tree viewer

To improve interactive performance, redraw is turned off by default during the collapse and expand operation of tree viewers. This significantly improves these operations compared to drawing the updates synchronously.

Java Developement Tools (JDT)

Java 14 Support

Java 14

Java™ 14 is available and Eclipse JDT supports Java 14 for the Eclipse 4.15 release.

The release notably includes the following Java 14 features:

  • JEP 361: Switch Expressions (Standard).

  • JEP 359: Records (Preview).

  • JEP 368: Text Blocks (Second Preview).

  • JEP 305: Pattern Matching for Instanceof (Preview).

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

Java Editor

Subword code completion

Content Assist now supports subword patterns, similar to Eclipse Code Recommenders and other IDEs. For example, completing on addmouselistener proposes results like addMouseMoveListener and addMouseWheelListener.

subword code completion

This feature can be enabled using the Show subword matches option on the Java > Editor > Content Assist preference page.

Subtype code completion

Content Assist will prioritize displaying constructor completions whose declaring type inherits from the expected return type within the completion context.

For example, completing on :

Queue<String> queue = new L

prioritizes constructors for LinkedBlockingQueue, LinkedBlockingDeQueue and LinkedList.

subtype code completion
Option for non-blocking Java completion

Code completion in the Java editor can now be run in a separate non-UI thread to prevent UI freezes in case of long computations. To enable this non-blocking computation, go to Preferences > Java > Editor > Content Assist > Advanced and check Do not block UI Thread while computing completion proposals preference. This option is currently disabled by default.

Non-blocking completion is useful when completion proposals are long to compute, as it allows you to type or use other parts of the IDE in the meantime.

Some completion participants may prevent this option from being effective (typically if the Java completion extension doesn’t declare requiresUIThread="false"), so the UI thread may still be used even if this option is set.

Quick fix to wrap Optional statements

A quick fix has been added to wrap an Optional statement.

The options for a primitive statement are: Optional.empty() and Optional.of(). Type statements also have Optional.ofNullable().

Example for type objects:

wrapOptional1

Selecting Wrap with nullable Optional for type object results in:

wrapOptional4

Example for primitive:

wrapOptional2

Selecting Wrap with Optional for primitive results in:

wrapOptional3
Simplify functional interface instances

A new clean up has been added that simplifies the lambda expression and the method reference syntax and is enabled only for Java 8 and higher.

The clean up removes parenthesis for a single untyped parameter, return statement for a single expression and brackets for a single statement. It replaces a lambda expression by a creation or a method reference when possible.

To select the clean up, invoke Source > Clean Up…​, use a custom profile, and on the Configure…​ dialog select Simplify lambda expression and method reference syntax on the Code Style tab.

lambda expression enhancements

For the given code:

lambda expression enhancements before

You get this after the clean up:

lambda expression enhancements after
Directly use Map method

Some map manipulations are unnecessarily verbose. The new cleanup option Operate on Maps directly calls methods on a map instead of calling the same methods on the key set or the values.

Beware! If you create Map implementations that don’t follow the Map specification, this cleanup may break the behavior (a size() method that changes the values, an iterator that destroys the items…​).

map method preferences

For the given code:

map method before

You get this after the clean up:

map method after
Uppercase for long literal suffix

A new cleanup option Use uppercase for long literal suffix has been added. It will rewrite long literals like 101l with an uppercase L like 101L to avoid ambiguity.

uppercase literal suffix
Surround with "try-with-resources" block

Corresponding to the quick fix which will surround a selection with a "try-with-resources" block, a new action has been added to the Surround With menu.

For example, selecting the lines as shown:

surroundwithresources1

and right-clicking and selecting Surround With → Try-with-resources Block

surroundwithresources

results in:

surroundwithresources2
Quick fixes for module-info Javadoc

Quick fixes have been added to fix the missing and duplicate @provides and @uses Javadoc tags in a module-info file.

modulequickfix
No more spurious semicolon from import completion

Almost 18 years ago, it was reported that completion for imports adds an unnecessary semicolon if one already exists (like when changing an existing import). Now this extra semicolon is no longer inserted.

Java Compiler

Warn when legacy code can taint null-checked values

When using null-annotations for advanced null analysis, it is inherently tricky to combine your code with "legacy" code that has no null annotations and has not been blessed by such analysis.

Previously, Eclipse would only warn you when you obtain a dubious value from a legacy API, but it would keep silent in the opposite case: passing a value of an annotated type into legacy API. Still in specific situations this can cause a NullPointerException to be thrown in your null-checked code:

null into nonnull list

The console shows an exception thrown from within your checked main method (see the class-level @NonNullByDefault). It also shows the new warning, which Eclipse raises to alert you of this danger.

Hint: The shown code assumes the list names to have type List<@NonNull String>, but the legacy method Legacy.printNames() succeeds to taint this list by inserting a null element. This goes unnoticed because that method views the list has having type List<String>, with no nullness constraint on the type argument.

By default this problem is raised at level info, but the severity can be configured in the compiler settings:

configure null vs legacy problem
Improved Resource leak analysis

Resource leak analysis has been improved in several ways.

Most importantly, the analysis now consistently considers resources (=values of type AutoCloseable) which are acquired using a method call, where previously under some circumstances resource allocation got unnoticed if it was wrapped in a factory method, like in the following example:

makePrintWriter("/tmp/log.txt").printf("%d", 42);
// a PrintWriter is never closed!

Second, resource leak analysis now leverages knowledge about well-known resource classes that support fluent programming, i.e., instance methods which return this to enable chains of method calls. Where a naive analysis could consider the method result as a new resource coming into scope, special knowledge about these classes informs the analysis that it is one and the same resource. This concerns the following system classes:

from java.io

CharArrayWriter, Console, PrintStream, PrintWriter, StringWriter, Writer

from java.nio.channels

AsynchronousFileChannel, AsynchronousServerSocketChannel, FileChannel, NetworkChannel, SeekableByteChannel, SelectableChannel, Selector, ServerSocketChannel

from java.util

Formatter

The following example is now understood to be safe, because analysis understands that the resource returned by append() is the same as the initial pw:

PrintWriter pw = new PrintWriter("/tmp/log.txt");
pw.printf("%d", 42).append(" is the answer").close();

Generally, resource leak analysis was made more precise regarding several specific situations.

Java Formatter

Java formatter application requires a workspace

The Java formatter application will provide a sensible error message if a workspace is required but not provided (-data command line option). This also enables the -help option to be run on the formatter without a workspace specified.

A new bundle services the org.eclipse.jdt.core.JavaCodeFormatter application. This new bundle is part of the JDT feature. Users who are not using the JDT feature to define their set of bundles will need to add org.eclipse.jdt.core.formatterapp to their set of bundles.

Debug

Functional debug expressions

Lambda expressions and method references are now supported in debug expressions, such as in the Expressions view and in breakpoint condition expressions.

debug functional expressions

JDT Developers

New bundle org.eclipse.jdt.core.formatterapp

The entry point of the org.eclipse.jdt.core.JavaCodeFormatter application has been moved to a new bundle, org.eclipse.jdt.core.formatterapp.

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.15.0 and Red Hat CodeReady Studio 12.15 out we are already working on the next release for Eclipse 2020-06.

Enjoy!

Jeff Maury

JBoss Tools 4.14.0 and Red Hat CodeReady Studio 12.14 for Eclipse 2019-12 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.14 (2019-12) but we recommend using the latest Eclipse 4.14 2019-12 JEE Bundle since then you get most of the dependencies preinstalled.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was a new tooling for the Quarkus framework, improvements for container based development and bug fixing. Eclipse 2019-12 itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse 2019-12 and JBoss Tools plugins that I think are worth mentioning.

OpenShift

OpenShift Container Platform 4.3 support

With the new OpenShift Container Platform (OCP) 4.3 now available (see this article), JBoss Tools is compatible with this major release in a transparent way. Just define your connection to your OCP 4.3 based cluster as you did before for an OCP 3 cluster, and use the tooling !

New OpenShift Application Explorer view

A new OpenShift Application Explorer window has been added in addition to the OpenShift Explorer. It is based on OpenShift Do. It provides a different and simplified user experience allowing easy and rapid feedback through inner loop and debugging.

Let’s see it in action.

Opening the OpenShift Application Explorer view

If you opened a brand new workspace, you should see the OpenShift Application Explorer view in the list of views available on the botton part of the screen:

application explorer

If you don’t see the view being listed, you can open it through the Window -→ Show View -→ Other menu, enter open in the filter text box and then select OpenShift Application Explorer:

application explorer1
application explorer2

Expanding the root node will display the list of projects available on the cluster:

application explorer3
Java based micro service

We will show how to deploy a Java based microservice and how to use the various features. But we first need to load the component source code in our workspace. Thanks to the launcher wizard, we can do that easilly. Try Ctrl+N and select the Launcher project wizard:

application explorer4

Then click the Next button:

Select rest-http in the Mission field, vert.x community in the Runtime field, myservice in the Project name field:

application explorer5

Then click the Finish button: a new project will be added to your workspace. Once the dependencies resolution has been completed, we’re ready to start playing with the cluster.

Create the component

Now that we have the source code, we can create the component. From the OpenShift Application Explorer view, right select the project (myproject), and the click the New → Component menu:

application explorer6

Enter myservice in the Name field, click the Browse button to select the project we have just created, select java in the Component type field, select 8 in the Component version field, enter myapp in the Application field and uncheck the Push after create check-box:

application explorer7

Then click the Finish button. The component will be created and expanding the project node will now show the application that contains our component:

application explorer8

Expanding the application will now display our component:

application explorer9

The component has been created but it is not yet deployed on the cluster (as we unchecked the Push after create check-box. In order to deploy it,right select the component and click the Push menu. The deployment will be created and then a build will be launched. A new window will be created in the Console view. After a while, you should see the following output:

application explorer10

The component is now deployed to the cluster but we cannot access it as we need to define an URL to access it externally. Right select the component and click the New → URL menu:

application explorer11

Enter url1 in the Name field and select 8080 in the Port field:

application explorer12

Then click on the Finish button. The URL is created but not on the cluster, so we need to push again the component so that the local configuration is synchronized with the configuration on the cluster. The Console window will display a message claiming that a push is now required:

application explorer13

So push the component again (component → Push).

Let’s check that we can now access the service. Expand the component level so that we can see the URL we have just created:

application explorer14

Right select the URL and click the Open in Browser menu, you should see the new browser window:

application explorer15

You can test the service: enter demo in the text box and click the Invoke button:

application explorer16
Feedback loop

We will now see how we can get fast feedback on code changes. So let’s modify the application code and see how we can synchronize the changes to the cluster.

In the Project Explorer view, locate the HttpApplication.java file:

application explorer17

Double click on the file to open the editor:

application explorer18

On line 14, change the line:

  protected static final String template = "Hello, %s!";

to

  protected static final String template = "Hello, %s!, we modified the code";

and press the Ctrl+S key in order to save the file.

For the OpenShift Application Explorer, right click the component (myservice) and click the Push menu to send the changes to the cluster: the component will be built again on the cluster with the next changes and after a few seconds, it will be available again:

application explorer19

Select the browser window again, enter demo1 in the textbox (we need to change the value we used before in order to make sure cache is not involved) and click the Invoke button again:

application explorer20

We’ve seen that, through a sequence of code modification(s) followed by a synchronize action (push) to the cluster, we can get a very fast feedback. If you don’t want to manually synchronize the the cluster (push), you can opt to automatically synchronize to the cluster with the Watch action: each time a code modification is done locally on your workstation, a new build will be automatically launched on the cluster.

Going further: debug your application on the cluster

Testing an application through code changes is a great achievement so far but it may be difficult for complex applications where we need to understand how the code behaves without the need to use the UI. That’s why the next step is to be able to debug our application live on the cluster.

The new OpenShift Application Explorer allow such a scenario. We will first set up a breakpoint in our application code. Select again the HttpApplication.java file and scroll down to the greeting method:

application explorer21

On line 41, double click in the left ruler column so that a breakpoint is set:

application explorer22

We are now ready to debug our application. In order to do that, we need to launch a local (Java in our case) debugger that will be connected to our application on the cluster. This is what the Debug action is doing: right select the component (myservice) and click the Debug menu: you will see that port forwarding has been started so that our local (Java) debugger can connect to the remote Java virtual machine:

application explorer23

and then a local (Java) debugger is launched and connected to that port. Let’s check now that we can debug our application:

Select the browser window again, enter demo2 in the textbox (we need to change the value we used before in order to make sure cache is not involved) and click the Invoke button again: as our breakpoint is hit, you will be asked if you want to switch to the Debug perspective (this may not be displayed if you previously selected the Remember my decision checkbox:

application explorer24

Click the Switch button and you will see the Debug perspective:

application explorer25

You are now debugging a Java component running on a remote cluster just like it was running locally on your workstation. Please note that we demoed this feature using a Java based component but we also support the same feature to NodeJS based components.

Quarkus

Starting with this release, we’ve added a new Quarkus tooling for applications built on top of the Supersonic Subatomic Java Quarkus framework.

Quarkus project creation wizard

A new wizard has been added to create a new Quarkus application project in your workspace. In order to launch it, first enter Ctrl+N to get the list of available wizards

quarkus1

In the filter text box, enter the qu characters to filter the list of wizards:

quarkus2

Select the Quarkus Project wizard and click the Next button:

quarkus3

The Project type combo allows you to choose between Maven or Gradle tool used to manage your project. We’ll go with Maven for this tutorial.

Enter a project name (we will use code-with-quarkus) and click the Next button:

quarkus4

This dialog allows you to choose various parameters for you project, like the project coordinates (group id, artifact id and version) along with the base REST endpoint information. We’ll use the default so click on the Next button:

quarkus5

This dialog allows to select which Quarkus extensions you want to add to your project. The extensions are grouped by categories, so first select a specific category in the left table. We will choose the Web one:

quarkus6 1

You should have noticed that the middle table has been updated. In order to add an extension, double click on the extension in the middle table. We will add RESTEasy JAX-RS and RESTEasy Qute (a templating engine):

quarkus7 1

You should have noticed that the extensions that you double clicked on are now being added to the right table. If you want to remove an extension from the list of selected ones, double click again either in the center table or in the right table.

We are now all set so click on the Finish button to launch the project creation. The project creation job is then launched, dependencies are being retrieved and after a while, the new project will appear in the Project Explorer window:

quarkus8

We have successfully created our first Quarkus project. Let’s see now how we can launch this application and debug it.

Running the Quarkus application

Running a Quarkus application can be done from the workbench Run configurations. Select the Run → Run Configurations…​ menu to display the dialog allowing to create a Run configuration.

quarkus9

Scroll down until the Quarkus Application is visible and select it:

quarkus10 1

Click on the New configuration button (top left):

quarkus11 1

A workspace project needs to be associated with the configuration so click on the Browse button to see the project selection dialog:

quarkus12 1

As the workspace contains a single project, it is automatically selected and we can click on the OK button:

quarkus13 1

The configuration is now ready to be used. So let’s start our Quarkus application by clicking on the Run button:

You should see a new Console being displayed.

quarkus14

The application is being built and after a while, it will be started:

quarkus15

Debugging the Quarkus application

Debugging a Quarkus application is just a simple as launching the previous configuration we’ve just created in Debug. You just need to open the Run → Debug Configurations…​. menu and click on the Debug button.

It will start the Quarkus application like in the previous paragraph but also connect a remote JVM debug configuration to your running Quarkus application. So if you have set breakpoints in your application source files, the execution will automatically stops there.

application.properties content assist

Every Quarkus application is configured through a configuration called application.properties.

The content of this configuration file is dependent of the set of Quarkus extensions that your application is using. Some settings are mandatory, some others are not and the possible values are specific to the nature of the setting: boolean, integer, limited set of values (enumerations).

So, as a developer, you need to look at various guides and documentations (the core Quarkus and the extension specific ones)

So Quarkus Tools provides content assist on those specific files that:

  • validates the content of the application.properties files

  • provides you with the possible setting names and values

Let’s see it in action.

Go to src/main/resources/application.properties in the project and right click and select Open With → Generic Text Editor:

quarkus16

Go the third line of the file and invoke code completion (Ctrl + Space):

quarkus17

For each setting, a documentation is displayed when you mouse over the setting. Let try to add quarkus.http.port to the file and mouse over this name:

quarkus18

If we enter a wrong value (false instead of a numeric value), then the error will be highlighted:

quarkus19

This is the first set of features that will be integration into the next version of JBoss Tools. We encourage you to used it and if you are missing features and/or enhancements, don’t hesitate to report them here: JBoss Tools issue tracker

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.12.Final and Hibernate Tools version 5.4.12.Final.

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.15.Final and Hibernate Tools version 5.3.15.Final.

Deprecation

The Forge, Java Server Tools (JST) and Visual Page Editor (VPE) have been deprecated. Even though they received an update with this release, we have no plan to maintain or add new features and they may be removed in the future.

In addition, the adapters for Red Hat JBoss Enterprise Application Server 4.3 and 5.0 have also been deprecated.

Platform

Views, Dialogs and Toolbar

New view menu icon

The view menu chevron icon (▽) is replaced by a modern equivalent, the vertical ellipsis ( ⠇).

Almost every view has a menu that may contain additional configuration settings like filters, layout settings, and so on. The view menu was often overlooked and we expect that this change will help users to find it.

view menu
Find Actions: The improved Quick Access

The formerly called Quick Access action has been retitled to Find Actions to better emphasize its goal.

The related UI has changed a bit to improve its usage and accessibility:

  • The widget item is now a regular toolbar item (button-like)

  • An icon is shown

  • Right-clicking on the tool item works and shows typical actions, including Hide

  • The proposals are now a regular dialog, centered on the workbench

These changes will greatly improve the experience if you’re using a screen reader as it relies on a more standardized focus state. This also leverages all the default and usual accessibility features of dialogs (moveable, resizable…​).

Loading the proposals has been improved as well to avoid UI freezes when loading proposals.

Find Actions finds text in file contents

Find Actions is now extended by the Quick Text Search feature to show the potential text matches in file contents also in the proposals.

file content find action

If the Quick Text Search bundle wasn’t started yet, you may miss those matches. In this case, you can use Find Actions itself to activate the Quick Text Search by finding and selecting the Activate bundle for 'File content' proposals entry.

activate file content
Find Actions lists workspace files

Find Actions can now list matching file names from the workspace (similar to the Open Resource dialog). Upon selection the file is opened in the editor.

find actions resources
Inline rename for simple resources while in Project Explorer.

In the Project Explorer, renaming (with the F2 shortcut or Rename context menu) will start an inline rename for normal resources when other files aren’t affected by the rename.

project explorer inline renaming

In cases where other files are affected by the rename, or the rename operation is customized, the rename dialog will appear as it previously did.

Text Editors

Show problem markers inline

You can now see the errors, warnings, and info markers inline in most of the text editors. No more mousing around to see the actual error message!

annotation code mining jdt

You can see the available quick fixes by clicking on the message.

annotation code mining quickfix

You can enable it on the General > Editors > Text Editors preference page and set Show Code Minings for Annotations to:

  • None (default)

  • Errors only

  • Errors and Warnings

  • Errors, Warnings and Info

Backspace/delete can treat spaces as tabs

If you use the Insert spaces for tabs option, now you can also change the backspace and delete keys behavior to remove multiple spaces at once, as if they were a tab.

The new setting is called Remove multiple spaces on backspace/delete and is found on the General > Editors > Text Editors preference page.

delete spaces as tabs

Debug

Collapse All Button in the Debug View

In the Debug View, now you can now use the new Collapse All button to collapse all the launches.

Before collapsing:

collapse all debug view before

After collapsing:

collapse all debug view after
Control character interpretation in Console View

The Console View can now interpret the control characters backslash (\b) and carriage return (\r).

This feature is disabled by default. You can enable it on the Run/Debug > Console preference page.

animated progress in console

Themes and Styling

Improvements in UI Forms Styling

CSS customization of ExpandableComposite and Section was reworked to give you more control over their styling. In dark mode, those elements now integrate better with other Form elements.

Old:

pom dark old

New:

pom dark new
Perspective switcher gets aligned with normal toolbar styling

The special styling of the Perspective switcher has been removed to make the Toolbar look consistent. This also reduces OS specific styling issues with the perspective switcher.

Old:

old perspective switcher

New:

new perspective switcher
Usage of consistent colors for the dark theme

The usage of different shades of gray in the dark theme was reduced.

The styling of the widgets is also not based on the selected view anymore, which makes the UI more consistent.

General Updates

Ant 1.10.7

Eclipse has adopted Ant version 1.10.7.

Support for the Ant include task added

The Ant include task (available in the Ant library since 1.8.0) is now fully recognized by the ant-ui-plugin and validated accordingly.

Java Developement Tools (JDT)

Java 13 Support

Java 13

Java™ 13 is available and Eclipse JDT supports Java 13 for the Eclipse 4.14 release.

The release notably includes the following Java 13 features:

  • JEP 354: Switch Expressions (Preview).

  • JEP 355: Text Blocks (Preview).

Please note that these are preview language feature and hence enable preview option should be on. For an informal introduction of the support, please refer to Java 13 Examples wiki.

Keyboard shortcut for Text Block creation

A keyboard shortcut Ctrl + Shift + ' is added in the Java Editor for text blocks, which is a preview feature added in Java 13.

Conditions under which this keyboard shortcut works are:

  • The Java Project should have a compliance of 13 or above and the preview features should be enabled.

  • The selection in the editor should not be part of a string or a comment or a text block.

Examples:

textblock pre creation1

Pressing the shortcut gives:

textblock post creation1

You can also encompass a selected text in text block as below:

textblock pre creation2

On pressing the shortcut, you get this:

textblock post creation2

Java Editor

Remove unnecessary array creation

A new cleanup action Remove unnecessary array creation has been added. It will remove explicit array creation for varargs parameters.

unnecessary array creation option

For the given code:

unnecessary array creation before

After cleanup, you get this:

unnecessary array creation after
Push negation down in expression

A new Java cleanup/save action Push down negation has been added. It reduces the double negation by reverting the arithmetic expressions.

For instance:

!!isValid; becomes isValid;

!(a != b); becomes (a == b);

push down negation
Provide templates for empty Java source files

When dealing with empty Java source files, some basic templates (class, interface, enum) will now be available from the content assist popup.

templates empty java file
Postfix completion proposal category

Postfix completion allows certain kinds of language constructs to be applied to the previously entered text.

For example: Entering "input text".var and selecting the var - Creates a new variable proposal, will result in String name = "input text".

postfix completion
try-with-resources quickfix

A quickfix has been added to create a try-with-resources statement based on the selected lines. Lines that are selected must start with declarations of objects that implement AutoCloseable. These declarations are added as the resources of the try-with-resources statement.

If there are selected statements that are not eligible resources (such as Objects that don’t implement AutoCloseable), then the first such statement and all the following selected statements will be placed in the try-with-resources body.

Method before applying try-with-resources:

tryWithResource1

Select all the lines inside the method, then use the short-cut Ctrl+1 and click on Surround with try-with-resources from the list:

tryWithResource2

This results in:

tryWithResource3
Javadoc tag checking for modules

Support has been added to check the Javadoc of a module-info.java file to report missing and duplicate @uses and @provides tags depending on the compiler settings (Preferences > Java > Compiler > Javadoc).

checkModuleJavadoc

Java Formatter

Formatting of text blocks

The code formatter can now handle text blocks, which is a preview feature added in Java 13. It’s controlled by the Text block indentation setting, found right in the Indentation section of the Profile Editor (Preferences > Java > Code Style > Formatter > Edit…​).

By default, text block lines are indented the same way as wrapped code lines, that is with two extra tabs relative to the starting indentation (or whatever is set as Default indentation for wrapped lines in the Line Wrapping section). You can also set it to use only one tab for indentation (Indent by one), align all lines to the position of the opening quotes (Indent on column), or preserve the original formatting (Do not touch).

formatter text block
Blank lines between Javadoc tags

The code formatter can now divide Javadoc tags into groups (by type, for example @param, @throws, @returns) and separate these groups with blank lines. This feature can be turned on in the Comments > Javadocs section by checking the Blank lines between tags of different type box.

Space after not operator

A new setting has been added to control whether a space should be added after not (!) operator, independently from other unary operators. To find it, expand sections Whitespace > Expressions > Unary operators and go to the last checkbox.

formatter space after not

JUnit

BREE update for org.eclipse.jdt.junit.runtime

The Bundle Required Execution Environment (BREE) for the org.eclipse.jdt.junit.runtime bundle is now J2SE-1.5.

Debug

No suspending on exception recurrence

A new workspace preference has been added for exception breakpoints: Suspend policy for recurring exception instances controls whether the same exception instance may cause the debugger to suspend more than once.

preference exception recurrence

This option is relevant when debugging an application that has try blocks at several levels of the architecture. In this situation an exception breakpoint may fire multiple times for the same actual exception instance: A throw statement inside a catch block may re-throw the same exception. The same holds for each finally block or try-with-resources block.

When the debugger stops due to an exception breakpoint, you may want to continue your debug session by pressing Resume (F8), but all that catching and re-throwing will force you to observe all locations where the same exception will surface again and again. Suspending at all try blocks on the call stack may also spoil your context of open Java editors, by opening more editors of classes that are likely irrelevant for the debugging task at hand.

The JDT Debugger will now detect this situation, and the first time it notices the same exception instance recurring at the surface, a new question dialog is shown:

dialog exception recurrence

If you select Skip in this dialog, the current exception instance will be dismissed for good. Still, new instances of the same exception type will cause suspending when they are thrown.

If you check Remember my decision your choice will be stored in the mentioned workspace preference to be effective for all exception breakpoints.

Even after choosing Skip — resp. Only once in the preferences — you can have the old behavior simply by pressing Step Return (F7) instead of Resume.

JDT Developers

Flag whether content assist extension needs to run in UI thread

The existing org.eclipse.jdt.ui.javaCompletionProposalComputer, org.eclipse.jdt.ui.javadocCompletionProposalComputer and org.eclipse.jdt.ui.javaCompletionProposalSorters extension points now allow a new attribute requiresUIThread that allows a developer to declare whether running in the UI thread is required or not.

This information will be used by the Content Assist operation to allow some optimizations and prevent UI freezes by reducing the amount of work happening in the UI thread.

To preserve backward compatibility, the default value for this attribute (if unset) is true, meaning the extension is expected to run in the UI thread.

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.14.0 and Red Hat CodeReady Studio 12.14 out we are already working on the next release for Eclipse 2020-03.

Enjoy!

Jeff Maury

JBoss Tools 4.13.0 and Red Hat CodeReady Studio 12.13 for Eclipse 2019-09 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.13 (2019-09) but we recommend using the latest Eclipse 4.13 2019-09 JEE Bundle since then you get most of the dependencies preinstalled.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was improvements for container based development and bug fixing. Eclipse 2019-09 itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse 2019-09 and JBoss Tools plugins that I think are worth mentioning.

OpenShift

OpenShift Container Platform 4.2 support

With the new OpenShift Container Platform (OCP) 4.2 now available (see this article), even if this is a major shift compared to OCP 3, JBoss Tools is compatible with this major release in a transparent way. Just define your connection to your OCP 4.2 based cluster as you did before for an OCP 3 cluster, and use the tooling !

CodeReady Containers 1.0 Server Adapter

A new server adapter has been added to support the next generation of CodeReady Containers 1.0. While the server adapter itself has limited functionality, it is able to start and stop the CodeReady Containers virtual machine via its crc binary. Simply hit Ctrl+3 (Cmd+3 on OSX) and type new server, that will bring up a command to setup a new server.

crc server adapter

Enter crc in the filter textbox.

You should see the Red Hat CodeReady Containers 1.0 server adapter.

crc server adapter1

Select Red Hat CodeReady Containers 1.0 and click the Next button.

crc server adapter2

All you have to do is set the location of the CodeReady Containers crc binary file, the pull secret file location (the pull secret file can be downloaded from https://cloud.redhat.com/openshift/install/crc/installer-provisioned).

crc server adapter3

Once you’re finished, a new CodeReady Containers server adapter will then be created and visible in the Servers view.

crc server adapter4

Once the server is started, a new OpenShift connection should appear in the OpenShift Explorer View, allowing the user to quickly create a new Openshift application and begin developing their AwesomeApp in a highly-replicatable environment.

crc server adapter5

Server tools

Wildfly 18 Server Adapter

A server adapter has been added to work with Wildfly 18. It adds support for Java EE 8 and Jakarta EE 8.

EAP 7.3 Beta Server Adapter

A server adapter has been added to work with EAP 7.3 Beta.

Hibernate Tools

Hibernate Runtime Provider Updates

A number of additions and updates have been performed on the available Hibernate runtime providers.

Runtime Provider Updates

The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.7.Final and Hibernate Tools version 5.4.7.Final.

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.13.Final and Hibernate Tools version 5.3.13.Final.

Platform

Views, Dialogs and Toolbar

The new Quick Search dialog provides a convenient, simple and fast way to run a textual search across your workspace and jump to matches in your code. The dialog provides a quick overview showing matching lines of text at a glance. It updates as quickly as you can type and allows for quick navigation using only the keyboard. A typical workflow starts by pressing the keyboard shortcut Ctrl+Alt+Shift+L (or Cmd+Alt+Shift+L on Mac). Typing a few letters updates the search result as you type. Use Up-Down arrow keys to select a match, then hit Enter to open it in an editor.

quick search
Save editor when Project Explorer has focus

You can now save the active editor even when the Project Explorer has focus. In cases where an extension contributes Saveables to the Project Explorer, the extension is honored and the save action on the Project Explorer will save the provided saveable item instead of the active editor.

save project explorer
"Show In" context menu available for normal resources

The Show In context menu is now available for an element inside a resource project on the Project Explorer.

showin project explorer
Show colors for additions and deletions in Compare viewer

In simple cases such as a 2-way comparison or a 3-way comparison with no merges and conflicts, the Compare Viewer now shows different colors, depending on whether text has been added, removed or modified. The default colors are green, red and black respectively.

compare editor colors

The colors can be customized through usual theme customization approaches, including using related entries in the Colors and Fonts preference page.

Editor status line shows more selection details

The status line for Text Editors now shows the cursor position, and when the editor has something selected, shows the number of characters in the selection as well. This also works in the block selection mode.

These two new additions to the status line can be disabled via the General > Editors > Text Editors preference page.

selection count
selection offset
Shorter dialog text

Several dialog texts have been shortened. This allows you to capture the important information faster.

Previously

long dialog text

Now

short dialog
Close project via middle-click

In the Project Explorer, you can now close a project using middle-click.

Debug

Improved usability of Environment tab in Launch Configurations

In the Environment Tab of the Launch Configuration dialog, you can now double-click on an environment variable name or value and start editing it directly from the table.

environment variable inline editing

Right-clicking on the environment variable table now opens a context menu, allowing for quick addition, removal, copying, and pasting of environment variables.

environment variable context menu
Show Command Line for external program launch

The External Tools Configuration dialog for launching an external program now supports the Show Command Line button.

external tool showcommandline

Preferences

Close editors automatically when reaching 99 open editors

The preference to close editors automatically is now enabled by default. It will be triggered when you have opened 99 files. If you continue to open editors, old editors will be closed to protect you from performance problems. You can modify this setting in the Preferences dialog via the General > Editors > Close editors automatically preference.

In-table color previews for Text Editor appearance color options

You can now see all the colors currently being used in Text Editors from the Appearance color options table, located in the Preferences > General > Editors > Text Editor page.

text editors color intable
Automatic detection of UI freezes in the Eclipse SDK

The Eclipse SDK has been configured to show stack traces for UI freezes in the Error Log view by default for new workspaces. You can use this information to identify and report slow parts of the Eclipse IDE.

freeze event

You can disable the monitoring or tweak its settings via the options in the General > UI Responsiveness Monitoring preference page as shown below.

ui monitor preference

Themes and Styling

Start automatically in dark theme based on OS theme

On Linux and Mac, Eclipse can now start automatically in dark theme when the OS theme is dark. This works by default, that is on a new workspace or when the user has not explicitly set or changed the theme in Eclipse.

Display of Help content respects OS theme

More and more operating systems provide a system wide dark theme. Eclipse now respects this system wide theme setting when the Eclipse help content is displayed in an external browser. A prerequisite for this is a browser that supports the prefers-color-scheme CSS media query.

As of writing this the following browser versions support it:

  • Firefox version 67

  • Chrome version 76

  • Safari version 12.1

help system dark
Help content uses high resolution icons

The Help System as well as the help content of the Eclipse Platform, the Java Development Tooling and the Plug-in Development Environment now use high resolution icons. They are now crisp on high resolution displays and also looks much better in the dark theme.

help system high res
Improved dark theme on Windows

Labels, Sections, Checkboxes, Radio Buttons, FormTexts and Sashes on forms now use the correct background color in the dark mode on windows.

correct backgrounds

General Updates

Interactive performance

Interactive performance has been further improved in this release and several UI freezes have been fixed.

Show key bindings when command is invoked

For presentations, screen casts and learning purposes, it is very helpful to show the corresponding key binding when a command is invoked. When the command is invoked (via a key binding or menu interaction) the key binding, the command’s name and description are shown on the screen.

show key bindings

You can activate this in the Preferences dialog via the Show key binding when command is invoked check box on the General > Keys preference page. To toggle this setting quickly the command 'Toggle Whether to Show Key Binding' can be used (e.g. via the quick access).

Java Developement Tools (JDT)

Java 13 Support

Java 13

Java 13 is out and Eclipse JDT supports Java 13 for 4.13 via Marketplace.

The release notably includes the following Java 13 features:

  • JEP 354: Switch Expressions (Preview).

  • JEP 355: Text Blocks (Preview).

Please note that these are preview language feature and hence enable preview option should be on. For an informal introduction of the support, please refer to Java 13 Examples wiki.

Java Views and Dialogs

Synchronize standard and error output in console

The Eclipse Console view currently can not ensure that mixed standard and error output is shown in the same order as it is produced by the running process. For Java applications the launch configuration Common Tab now provides an option to merge standard and error output. This ensures that standard and error output is shown in the same order it was produced but at the same time disables the individual coloring of error output.

merge process output

Java Editor

Convert to enhanced 'for' loop using Collections

The Java quickfix/cleanup Convert to enhanced 'for' loop is now offered on for loops that are iterating through Collections. The loop must reference the size method as part of the condition and if accessing elements in the body, must use the get method. All other Collection methods other than isEmpty invalidate the quickfix being offered.

foreachcollectionbefore
foreachcollectionquickfix
foreachcollectionafter
Initialize 'final' fields

A Java quickfix is now offered to initialize an uninitialized final field in the class constructor. The fix will initialize a String to the empty string, a numeric base type to 0, and for class fields it initializes them using their default constructor if available or null if no default constructor exists.

finalquickfix1
finalquickfix2
Autoboxing and Unboxing

Use Autoboxing and Unboxing when possible. These features are enabled only for Java 5 and higher.

autoboxing unboxing feature
Improved redundant modifier removal

Remove redundant modifier now also removes useless abstract modifier on the interfaces.

abstract removal feature

For the given code:

abstract removal before

You get this:

abstract removal after
Javadoc comment generation for module

Adding a Javadoc comment to a Java module (module-info.java) will result in automatic annotations being added per the new module comment preferences.

modulejavadocprefs

The $(tags) directive will add @uses and @provides tags for all uses and provides module statements.

modulejavadoc
Chain Completion Code Assist

Code assist for "Chain Template Proposals" will be available. These will traverse reachable local variables, fields, and methods, to produce a chain whose return type is compatible with the expected type in a particular context.

The preference to enable the feature can be found in the Advanced sub-menu of the Content Assist menu group (Preferences > Java > Editor > Content Assist > Advanced) .

chain completion

Java Formatter

Remove excess blank lines

All the settings in the Blank lines section can now be configured to remove excess blank lines, effectively taking precedence over the Number of empty lines to preserve setting. Each setting has its own button to turn the feature on, right next to its number control. The button is enabled only if the selected number of lines is smaller than the Number of empty lines to preserve, because otherwise any excess lines are removed anyway.

formatter remove excess blank lines
Changes in blank lines settings

There’s quite a lot of changes in the Blank lines section of the formatter profile.

Some of the existing subsections and settings are now phrased differently to better express their function:

  • The Blank lines within class declarations subsection is now Blank lines within type declaration

  • Before first declaration is now Before first member declaration

  • Before declarations of the same kind is now Between member declarations of different kind

  • Before member class declarations is now Between member type declarations

  • Before field declarations is now Between field declarations

  • Before method declarations is now Between method/constructor declarations

More importantly, a few new settings have been added to support more places where the number of empty lines can be controlled:

  • After last member declaration in a type (to complement previously existing Before first member declaration setting)

  • Between abstract method declarations in a type (these cases were previously handled by Between method/constructor declarations)

  • At end of method/constructor body (to complement previously existing At beginning of method/constructor body setting)

  • At beginning of code block and At end of code block

  • Before statement with code block and After statement with code block

  • Between statement groups in 'switch'

Most of the new settings have been put in a new subsection Blank lines within method/constructor declarations.

formatter new blank lines settings

JUnit

JUnit 5.5.1

JUnit 5.5.1 is here and Eclipse JDT has been updated to use this version.

Debug

Enhanced support for --patch-module during launch

The Java Launch Configuration now supports patching of different modules by different sources during the launch. This can be verified in the Override Dependencies…​ dialog in the Dependencies tab in a Java Launch Configuration.

launch dependencies
enhanced patch module

Java Build

Full build on JDT core preferences change

Manually changing the settings file .settings/org.eclipse.jdt.core.prefs of a project will result in a full project build, if the workspace auto-build is on. For example, pulling different settings from a git repository or generating the settings with a tool will now trigger a build. Note that this includes timestamp changes, even if actual settings file contents were not changed.

For the 4.13 release, it is possible to disable this new behavior with the VM property: -Dorg.eclipse.disableAutoBuildOnSettingsChange=true. It is planned to remove this VM property in a future release.

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.13.0 and Red Hat CodeReady Studio 12.13 out we are already working on the next release for Eclipse 2019-12.

Enjoy!

Jeff Maury

JBoss Tools 4.12.0 and Red Hat CodeReady Studio 12.12 for Eclipse 2019-06 are here waiting for you. Check it out!

crstudio12

Installation

Red Hat CodeReady Studio comes with everything pre-bundled in its installer. Simply download it from our Red Hat CodeReady product page and run it like this:

java -jar codereadystudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) CodeReady Studio require a bit more:

This release requires at least Eclipse 4.12 (2019-06) but we recommend using the latest Eclipse 4.12 2019-06 JEE Bundle since then you get most of the dependencies preinstalled.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat CodeReady Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/photon/stable/updates/

What is new?

Our main focus for this release was improvements for container based development and bug fixing. Eclipse 2019-06 itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse 2019-06 and JBoss Tools plugins that I think are worth mentioning.

OpenShift

OpenShift Container Platform 4 support

With the new OpenShift Container Platform (OCP) 4 now available (see this article), even if this is a major shift compared to OCP 3, JBoss Tools is compatible with this major release in a transparent way. Just define your connection to your OCP 4 based cluster as you did before for an OCP 3 cluster, and use the tooling !

Server tools

Wildfly 17 Server Adapter

A server adapter has been added to work with Wildfly 17. It adds support for Java EE 8.

Hibernate Tools

New Runtime Provider

The new Hibernate 5.4 runtime provider has been added. It incorporates Hibernate Core version 5.4.3.Final and Hibernate Tools version 5.4.3.Final

Runtime Provider Updates

The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.10.Final and Hibernate Tools version 5.3.10.Final.

Maven

Maven support updated to M2E 1.12

The Maven support is based on Eclipse M2E 1.12

Platform

Views, Dialogs and Toolbar

Import project by passing it as command-line argument

You can import a project into Eclipse by passing its path as a parameter to the launcher. The command would look like eclipse /path/to/project on Linux and Windows, or open Eclipse.app -a /path/to/project on macOS.

pass directory to launcher
Launch Run and Debug configurations from Quick Access

From the Quick Access proposals (accessible with Ctrl+3 shortcut) you can now directly launch any of the Run or Debug configurations available in your workspace.

run debug quickaccess
For performance reasons, the extra Quick Access entries are only visible if the org.eclipse.debug.ui bundle was already activated by some previous action in the workbench such as editing a launch configuration, or expanding the Run As…​ menus.

Themes and Styling

Improved View Menu Icon

The icon used for the view menu has been improved. It is now crisp on high resolution displays and also looks much better in the dark theme.

Compare the old version at the top and the new version at the bottom:

view menu
High resolution images drawn on Mac

On Mac, images and text are now drawn in high resolution during GC operations. You can see crisp images on high resolution displays in the editor rulers, forms, etc in Eclipse.

Compare the old version at the top and the new version at the bottom:

hidpi mac old behavior
hidpi mac new behavior
Table/Tree background lines shown in dark theme on Mac

In dark theme on Mac, the Table and Trees in Eclipse now show the alternating dark lines in the background when setLinesVisible(true) is set. Earlier they had a gray background even if line visibility was true.

Example of a Tree and Table in Eclipse with alternating dark lines in the background:

dark theme alternating lines

Equinox

When the Equinox OSGi Framework is launched the installed bundles are activated according to their configured start-level. The bundles with lower start-levels are activated first. Bundles within the same start-level are activated sequentially from a single thread.

A new configuration option equinox.start.level.thread.count has been added that enables the framework to start bundles within the same start-level in parallel. The default value is 1 which keeps the previous behavior of activating bundles from a single thread. Setting the value to 0 enables parallel activation using a thread count equal to Runtime.getRuntime().availableProcessors(). Setting the value to a number greater than 1 will use the specified number as the thread count for parallel bundle activation.

The default is 1 because of the risk of possible deadlock when activating bundles in parallel. Extensive testing must be done on the set of bundle installed in the framework before considering enabling this option in a product.

Java Developement Tools (JDT)

Java 12 Support

Change project compliance and JRE to 12

A quick fix Change project compliance and JRE to 12 is provided to change the current project to be compatible with Java 12.

quickfix change compliance 12
Enable preview features

Preview features in Java 12 can be enabled using Preferences > Java > Compiler > Enable preview features option. The problem severity of these preview features can be configured using the Preview features with severity level option.

enable preview
Set Enable preview features

A quick fix Configure problem severity is provided to update the problem severity of preview features in Java 12.

quickfix configure severity 12
Add default case to switch statement

A quick fix Add 'default' case is provided to add default case to a enhanced switch statement in Java 12.

quickfix default switch statement
Add missing case statements to switch statement

A quick fix Add missing case statements is provided for a enhanced switch statement in Java 12.

quickfix missing case switch statement
Add default case to switch expression

A quick fix Add 'default' case is provided to add default case to a switch expression.

quickfix default switch expression
Add missing case statements to switch expression

A quick fix Add missing case statements is provided for switch expressions.

quickfix missing case switch expression
Format whitespaces in 'switch'

As Java 12 introduced some new features into the switch construct, the formatter profile has some new settings for it. The settings allow you to control spaces around the arrow operator (separately for case and default) and around commas in a multi-value case.

The settings can be found in the Profile Editor (Preferences > Java > Code Style > Formatter > Edit…​) under the White space > Control statements > 'switch' subsection.

formatter switch
Split Switch Case Labels

As Java 12 introduced the ability to group multiple switch case labels into a single case expression, a quick assist is provided that allows these grouped labels to be split into separate case statements.

split switch case labels

Java Editor

Show method parameter names on code as code minings

In the Java > Editor > Code Mining preferences, you can now enable the Show parameter names option. This will show the parameter names as code minings in method or constructor calls, for cases where the resolution may not be obvious for a human reader.

For example, the code mining will be shown if the argument name in the method call is not an exact match of the parameter name or if the argument name doesn’t contain the parameter name as a substring.

parameter name codeminings
Show number of implementations of methods as code minings

In the Java > Editor > Code Mining preferences, selecting Show implementations with the Show References (including implementations) for → Methods option now shows implementations of methods.

method implementation codeminings

Clicking on method implementations brings up the Search view that shows all implementations of the method in sub-types.

method implementation codeminings click
Open single implementation/reference in editor from code mining

When the Java > Editor > Code Mining preferences are enabled and a single implementation or reference is shown, moving the cursor over the annotation and using Ctrl+Click will open the editor and display the single implementation or reference.

ctrlclickimpl
Additional quick fixes for service provider constructors

Appropriate quick fixes are offered when a service defined in a module-info.java file has a service provider implementation whose no-arg constructor is not visible, or is non-existent.

service provider create constructor
service provider change constructor visibility
Template to create Switch Labeled Statement and Switch Expressions

The Java Editor now offers new templates for the creation of switch labeled statements and switch expressions. On a switch statement, three new templates: switch labeled statement, switch case expression and switch labeled expression are available as shown below. These new templates are available on Java projects having compliance level of Java 12 or above.

switch labeled statement
switch case expression
switch labeled expression

If switch is being used as an expression, then only switch case expression and switch labeled expression templates are available as shown below:

switch expression templates

Java Views and Dialogs

Enable comment generation in modules and packages

An option is now available to enable/disable the comment generation while creating module-info.java or package-info.java.

module info comment generation check box
package info comment generation checkbox
Improved 'create getter and setter' quick assist

The quick assist for creating getter and setter methods from fields no longer forces you to create both.

getter setter dialog new
Quick fix to open all required closed projects

A quick fix to open all required closed projects is now available in the Problems view.

quickfix open missing projects problem view
quickfix open missing projects
New UI for configuring Module Dependencies

The Java Build Path configuration now has a new tab Module Dependencies, which will gradually replace the options previously hidden behind the Is Modular node on other tabs of this dialog. The new tab provides an intuitive way for configuring all those module-related options for which Java 9 had introduced new command line options like --limit-modules etc.

module dependencies cropped

The dialog focuses on how to build one Java Project, here "org.greetings".

Below this focus module, the left hand pane shows all modules that participate in the build, where decorations A and S mark automatic modules and system modules, respectively. The extent of system modules (from JRE) can be modified with the Add System Module…​ and Remove buttons (corresponds to --add-modules and --limit-modules).

When a module is selected in the left hand pane, the right hand pane allows to configure the following properties for this module:

Read Module:

Select additional modules that should be accessible from the selected module (corresponds to --add-reads)

Expose Package:

Select additional packages to be exposed ("exports" or "opens") from the selected module (corresponds to --add-exports or --add-opens)

Patch with:

Add more packages and classes to the selected module (corresponds to --patch-module)

Java Compiler

Experimental Java index retired

Eclipse 4.7 introduced a new experimental Java index which was disabled by default.

Due to lack of resources to properly support all Java 9+ language changes, this index is not available anymore starting with Eclipse 4.12.

The preference to enable it in Preferences > Java is removed and the old index will be always used.

Preferences > Java > Rebuild Index button can be used to delete the existing index files and free disk space.

Debug

'Run to Line' on Ctrl+Alt+Click in annotation ruler

A new shortcut, Ctrl+Alt+Click, has been added to the annotation ruler that will invoke the 'Run to Line' command and take the program execution to the line of invocation.

run to line
Content assist in Debug Shell

Content assist (Ctrl+Space) support is now available in the Debug Shell.

content assist debug shell
Clear Java Stack Trace Console usage hint on first edit

The Java Stack Trace Console shows a usage hint when opened the first time. This message is now automatically removed when the user starts typing or pasting a stack trace.

jstc initial clear
Lambda variable names shown in Variables view

The Lambda variable names are now shown in the Variables view while debugging projects in the workspace.

lambda variables view

JDT Developers

Support for new Javadoc tags

The following Javadoc tags are now supported by the compiler and auto-complete.

Tags introduced in JDK 8:

@apiNote

@implSpec

@implNote

Tags introduced in JDK 9:

@index

@hidden

@provides

@uses

Tags introduced in JDK 10:

@summary

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.12.0 and Red Hat CodeReady Studio 12.12 out we are already working on the next release for Eclipse 2019-09.

Enjoy!

Jeff Maury

You’ve probably heard about Quarkus, the Supersonic Subatomic Java framework tailored for Kubernetes and containers.

We wrote an article on how to create your first Quarkus project in an Eclipse based IDE (like Red Hat CodeReady Studio).

Looking for older posts ? See the Archived entries.
back to top