Java development tools
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:
Please note that these are preview language features 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:
Examples: Pressing the shortcut gives:You can also encompass a selected text in text block as below: On pressing the shortcut, you get this: |
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.
For the given code:
After cleanup, you get this:
|
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:
|
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. |
Postfix completion proposal category |
Postfix completion allows certain kinds of language constructs to be applied to the previously entered text.
For example: Entering |
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 |
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).
|
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). |
Blank lines between Javadoc tags |
The code formatter can now divide Javadoc tags into groups (by type, for example @param , @throws , @return ) 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.
|
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.
This option is relevant when debugging an application that has 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 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: 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 |