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 'devstudio'

Happy to announce 4.21.0.AM1 (Developer Milestone 1) build for Eclipse 2021-09.

Downloads available at JBoss Tools 4.21.0 AM1.

What is New?

Full info is at this page. Some highlights are below.

OpenShift

Operator based services

When developing cloud native applications on OpenShift, developer may need to launch services (databases, messaging system,…​) that the application under development may need to connect to. The OpenShift tooling allowed to launch such services but it was based on the service catalog which is not available anymore on OpenShift 4.

The new feature is based on operators which is the devops way of installing and managing software on Kubernetes clusters. So when you want to launch a service for your application, you will have to choose from the list of installed operators on your cluster and then select type of deployment you want.

In the following example, there are two operators installed on our cluster: the Strimzi operator for setting up Kafka clusters on Kubernetes and a Postgresql operator.

For each operator, we can select the type of deployment we want to setup.

operator based services1

After you’ve entered the name of your service, it will appear in the application explorer view:

operator based services2

Hibernate Tools

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

Runtime Provider Updates

The Hibernate 5.5 runtime provider now incorporates Hibernate Core version 5.5.7.Final and Hibernate Tools version 5.5.7.Final.

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

Enjoy!

Jeff Maury

JBoss Tools 4.19.1 and Red Hat CodeReady Studio 12.19.1 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

Improved OpenShift Application explorer

When the OpenShift cluster has no applications or projects, user is required to create them. However, it may not be obvious for the user that the corresponding function is available from a sub menu of the New context menu.

So now, a link will be provided within the tree with an explanation message.

If no projects are available, user will be guided to create one:

application explorer enhanced navigation1

If no applications are available in a project, user will be guided to create a new component:

application explorer enhanced navigation2

Server Tools

Wildfly 24 Server Adapter

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

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.

New Runtime Provider

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

Runtime Provider Updates

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

And more…​

You can find more noteworthy updates in on this page.

What is next?

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

Enjoy!

Jeff Maury

Happy to announce 4.19.1.AM1 (Developer Milestone 1) build for Eclipse 2021-03.

Downloads available at JBoss Tools 4.19.1 AM1.

What is New?

Full info is at this page. Some highlights are below.

OpenShift

Improved OpenShift Application explorer

When the OpenShift cluster has no applications or projects, user is required to create them. However, it may not be obvious for the user that the corresponding function is available from a sub menu of the New context menu.

So now, a link will be provided within the tree with an explanation message.

If no projects are available, user will be guided to create one:

application explorer enhanced navigation1

If no applications are available in a project, user will be guided to create a new component:

application explorer enhanced navigation2

Hibernate Tools

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.32.Final and Hibernate Tools version 5.4.32.Final.

Enjoy!

Jeff Maury

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

Happy to announce 4.19.0.AM1 (Developer Milestone 1) build for Eclipse 2021-03.

Downloads available at JBoss Tools 4.19.0 AM1.

What is New?

Full info is at this page. Some highlights are below.

OpenShift

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.

Hibernate Tools

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.29.Final and Hibernate Tools version 5.4.29a.Final.

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.

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

Happy to announce 4.18.0.AM1 (Developer Milestone 1) build for Eclipse 2020-09.

Downloads available at JBoss Tools 4.18.0 AM1.

What is New?

Full info is at this page. Some highlights are below.

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

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

Hibernate Tools

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.25.Final and Hibernate Tools version 5.4.25.Final.

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

Server Tools

Wildfly 22 Server Adapter

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

CDI Tools

Eclipse Microprofile support

CDI Tools now support Eclipse Microprofile. Eclipse Microprofile related assets are checked against @Inject injections points and are validated according to rules specified in various Eclipse Microprofile specifications.

Forge Tools

Forge Runtime updated to 3.9.8.Final

The included Forge runtime is now 3.9.8.Final.

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

Happy to announce 4.17.0.AM1 (Developer Milestone 1) build for Eclipse 2020-09.

Downloads available at JBoss Tools 4.17.0 AM1.

What is New?

Full info is at this page. Some highlights are below.

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.

Hibernate Tools

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

New Runtime Provider

A new runtime provider has been added for Hibernate 6.0. It incorporates Hibernate Core version 6.0.0.Alpha6 and Hibernate Tools version 6.0.0.Alpha2.

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.

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

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