blob: 0b74bdf815744d3d6f75cddd658de3e1117e885f [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="copyright" content="Copyright (c) Eclipse contributors and others 2018. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page."/>
<meta http-equiv="Content-Language" content="en-us"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="STYLESHEET" href="../book.css" type="text/css"/>
<style type="text/css">
body {max-width: 900px;}
table.news col.title {width: 30%;}
/*img {max-width: 520px;}*/
table.news {table-layout: fixed; border-collapse: collapse; width: 100%;}
table.news td {border-top: solid thin black; padding: 10px; overflow: visible;}
table.news tr {vertical-align: top;}
table.news tr td.section {font-size: 20px; font-weight: bold;}
table.news tr td.title {vertical-align: top; font-weight: bold;}
table.news tr td.content {vertical-align: top;}
ul {padding-left: 13px;}
</style>
<title>What's New in Eclipse 4.10 (JDT)</title>
</head>
<body>
<h2>What's New in Eclipse 4.10 (JDT)</h2>
<p>Here are descriptions of some of the more interesting or significant changes made to the Java development tools (JDT)
for the 4.10 release of Eclipse.
They are grouped into:</p>
<ul>
<li><a href="#Java11">Java&trade; 11 Support</a></li>
<li><a href="#JavaEditor">Java Editor</a></li>
<li><a href="#JavaViewsAndDialogs">Java Views and Dialogs</a></li>
<li><a href="#JavaFormatter">Java Formatter</a></li>
<li><a href="#JUnit">JUnit</a></li>
<li><a href="#JDTDev">JDT Developers</a></li>
</ul>
<p>See also the <b><a href="../../org.eclipse.platform.doc.user/whatsNew/platform_whatsnew.html">Eclipse Platform What's New</a></b>
document for changes in the Platform.</p>
<p>We also recommend to read the <a href="../tips/jdt_tips.html">Tips and Tricks</a>.</p>
<br/>
<!-- ****************** START OF N&N TABLE****************** -->
<table class="news">
<colgroup>
<col class="title" />
<col />
</colgroup>
<tbody>
<!-- ******************* Java 11 Support ************************************* -->
<tr>
<td id="Java11" class="section" colspan="2">
<h2>Java&trade; 11 Support </h2>
</td>
</tr>
<tr id="java-11"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=531708 -->
<td class="title">Eclipse support for Java&trade; 11</td>
<td class="content">
<a href="https://docs.oracle.com/en/java/javase/11/">Java&trade; 11</a> is here, and JDT supports it completely.
<ul>
<li>The Eclipse compiler for Java (ECJ) implements the new Java 11 <a href="https://docs.oracle.com/en/java/javase/11/language">language enhancements</a>.</li>
<li>For an informal list of examples of Java 11 features, please have a look <a href="https://wiki.eclipse.org/Java11/Examples">here</a>.</li>
</ul>
</td>
</tr>
<tr id="java-11-jre"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=535986 -->
<td class="title">Addition of Java 11 JRE</td>
<td class="content">
A Java 11 JRE is recognized by Eclipse for launching. It can be added from the <b>Window &gt; Preferences &gt; Java &gt; Installed JREs &gt; Add...</b> page.
It can also be added from the <b>Package Explorer</b> using the project's context menu.
<p>
<img src="images/j11.png" alt=""/>
</p>
An option to set compiler compliance to 11 on a Java project is also provided.
</td>
</tr>
<tr id="quickfix-change-compliance-11"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=536176 -->
<td class="title">Quick fix to change project compliance and JRE to 11</td>
<td class="content">
A quick fix <b>Change project compliance and JRE to 11</b> is provided to quickly change the current project to be compatible with Java 11.
<p>
<img src="images/quickfix-change-compliance-11.png" alt=""/>
</p>
</td>
</tr>
<tr id="add-var-lambda-parameter-types"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=535690 -->
<td class="title">Quick assist to add 'var' type to lambda parameters</td>
<td class="content">
A new quick assist has been implemented that allows the user to add 'var' type to lambda parameters.
This quick assist is only available if the project compliance is Java 11 or above.
<p>
<img src="images/quickassist_add_var_lambda_parameter_types.png" alt="" />
</p>
</td>
</tr>
<tr id="replace-lambda-parameter-types-with-var"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=535690 -->
<td class="title">Quick assist to replace lambda parameter types with 'var'</td>
<td class="content">
A new quick assist has been implemented that allows the user to replace lambda parameter types with 'var'.
This quick assist is only available if the project compliance is Java 11 or above.
<p>
<img src="images/quickassist_replace_lambda_parameter_types_with_var.png" alt="" />
</p>
</td>
</tr>
<tr id="replace-var-lambda-parameter-types"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=535690 -->
<td class="title">Quick assist to replace 'var' in lambda parameter types with inferred types</td>
<td class="content">
A new quick assist has been implemented that allows the user to replace 'var' in lambda parameter types with inferred types.
This quick assist is only available if the project compliance is Java 11 or above.
<p>
<img src="images/quickassist_replace_var_in_lambda_parameter_types_with_inferred_types.png" alt="" />
</p>
</td>
</tr>
<!-- ******************* End of Java 11 Support ************************************* -->
<!-- ******************* Java Editor ************************************* -->
<tr>
<td id="JavaEditor" class="section" colspan="2">
<h2>Java Editor </h2>
</td>
</tr>
<tr id="jdt-codemining"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=529127 -->
<td class="title">Code Minings support in Java editor</td>
<td class="content">
<b>Java editor</b> can now show the number of implementations and references for a Java element as decorative text (Code Minings) above the element.
<p>
<img src="images/jdt-codemining-references-implementations.png" alt="" />
</p>
<p>
This feature can be enabled in <b>Preferences &gt; Java &gt; Editor &gt; Code Minings</b>:
</p>
<p>
<img src="images/jdt-codemining-preferences.png" alt="" />
</p>
<p>
The reference count includes the implementation count.
</p>
<p>
Clicking on <b>references</b> launches the search for references:
</p>
<p>
<img src="images/jdt-codemining-references-search.png" alt="" />
</p>
<p>
Clicking on <b>implementations</b> opens the Type Hierarchy view:
</p>
<p>
<img src="images/jdt-codemining-implementors-type.png" alt="" />
</p>
<p>This is implemented using the <a href="https://www.eclipse.org/eclipse/news/4.8/M5/#codemining-extension-point">Code Mining extension-point</a>.</p>
</td>
</tr>
<tr id="remove-lambda-parameter-types"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=535690 -->
<td class="title">Quick assist to remove lambda parameter types</td>
<td class="content">
A new quick assist has been implemented that allows the user to remove lambda parameter types.
<p>
<img src="images/quickassist_remove_lambda_parameter_types.png" alt="" />
</p>
</td>
</tr>
<tr id="localVariable-var-support"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=535671 -->
<td class="title">Extract local variable to var type</td>
<td class="content">
When extracting to a local variable, an option to declare the local variable type as 'var' has been provided.
This option is only available if the project compliance is Java 10 or above.
<p>
When you select this option, the local variable type will be 'var' as shown below:
</p>
<p>
<img src="images/extract_local_variable_var_support.png" alt="" />
</p>
</td>
</tr>
<tr id="new-module-declaration"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=514054 -->
<td class="title">Template to create module declaration</td>
<td class="content">
The <code>module-info.java</code> file now offers a new template for the creation of a module declaration.
<p>
<img src="images/new-module-declaration.png" alt="" />
</p>
</td>
</tr>
<!-- ******************* End of Java Editor ************************************* -->
<!-- ******************* Java Views and Dialogs ************************************* -->
<tr>
<td id="JavaViewsAndDialogs" class="section" colspan="2">
<h2>Java Views and Dialogs</h2>
</td>
</tr>
<tr id="build-path-problems"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=539998 -->
<!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=540119 -->
<td class="title">New build path problem reported</td>
<td class="content">
If a project which only has main source folders depends on a project which only has test source folders, a build path error is now reported.
This can be disabled in <b>Preferences &gt; Java &gt; Compiler &gt; Building</b> or in the corresponding project specific settings.
<p>
<img src="images/mainonly-withtestonly-dep-539998.png" alt="" />
</p>
<p>
A quick fix <b>Configure problem severity</b> that opens this settings page is now offered for configurable build path problems reported in the problems view.
</p>
<p>
<img src="images/buildpath-quickfix-540119.png" alt="" />
</p>
</td>
</tr>
<tr id="ignore-completion-proposal-insertion-triggers"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=348857 -->
<td class="title">Disable completion insertion triggers</td>
<td class="content">
A new option <b>Disable insertion triggers except 'Enter'</b> has been added to the <b>Preferences &gt; Java &gt; Editor &gt; Content-Assist</b> page.
<p>
When this preference is selected, the pre-defined trigger characters to insert a completion proposal will be ignored while typing. Here, the proposal can be inserted by pressing <b>Enter</b>.
</p>
<p>
<img src="images/jdt-disable-completion-insertion-triggers.png" alt="" />
</p>
<p>
Disabling insertion triggers is usually convenient to avoid insertion of undesired proposals when the content assist pop-up is shown too often. For example, when too many characters are used as triggers for auto activation of code assist.
</p>
</td>
</tr>
<tr id="Create-module-info-on-projects-below-9"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=526643 -->
<td class="title">Convert project using Java 8 or below to modular project</td>
<td class="content">
You can now convert a project with compliance set to Java 8 or below to a modular project by selecting the <b>Create module-info.java</b> context menu on the project.
<p>
<img src="images/create_module_info_support_java_8_below_projects_option.png" alt="" />
</p>
<p>When you select the above option on a project using JRE less than Java 9, the below dialog will appear if an appropriate JRE with version greater than or equal to Java 9 is present in the workspace.
The highest available JRE is selected and the compliance setting for the project is also updated accordingly.
</p>
<p>
<img src="images/create_module_info_support_java_8_below_projects_compliance_change.png" alt="" />
</p>
<p>Selecting 'Yes' adds the suggested JRE to build path, removes the old JRE from build path, updates the compiler compliance accordingly and opens the <b>Create module-info.java</b> dialog.</p>
<p>Selecting 'No' leaves the project unchanged.</p>
</td>
</tr>
<!-- ******************* End of Java Views and Dialogs ************************************* -->
<!-- ******************* Java Formatter ************************************* -->
<tr>
<td id="JavaFormatter" class="section" colspan="2">
<h2>Java Formatter </h2>
</td>
</tr>
<tr id="one-line">
<td class="title">Keep braced code on one line</td>
<td class="content">
Previously, the code formatter profile had a set of settings to control whether to put line breaks between empty braces of various kind.
Now they have been replaced with more general settings that can additionally <b>keep fragments of braced code on one line</b> when they contain <b>only one item</b> (for example one statement in a code block) or when they have more items but can still <b>fit in the maximum line width</b>.
The options can also be set to <b>preserve existing state</b> so that the user can decide on each case individually.
<p>
While previously there was only one setting for empty code blocks, now there are separate settings for <b>loops, 'if then' statements and lambdas</b>.
</p>
<p>
A special option to <b>keep 'return' or 'throw' clause on one line in 'if then' statements</b> is still available.
Similarly, there's a new specific setting for <b>simple getters and setters</b>.
</p>
<p>
The settings can be found under <b>New Lines &gt; Keep braced code on one line</b> in the Profile Editor (<b>Preferences &gt; Java &gt; Code Style &gt; Formatter &gt; Edit...</b>).
</p>
<p>
<img src="images/formatter-oneline.png" alt="" />
</p>
</td>
</tr>
<!-- ******************* End of Java Formatter ************************************* -->
<!-- ******************* JUnit ************************************* -->
<tr>
<td id="JUnit" class="section" colspan="2">
<h2>JUnit</h2>
</td>
</tr>
<tr id="junit-5.3.1"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=536354 -->
<td class="title">JUnit 5.3.1</td>
<td class="content">
<a href="https://junit.org/junit5/docs/current/release-notes/index.html#release-notes-5.3.1">JUnit 5.3.1</a> is here and Eclipse has been updated to use it.
</td>
</tr>
<tr id="quick-assist-junit-test-case"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=525632 -->
<td class="title">Quick assist to create JUnit test case</td>
<td class="content">
You can now open the <b>New JUnit Test Case</b> wizard quickly by invoking <b>Quick Assist (Ctrl+1)</b> on a type declaration:
<p>
<img src="images/quick_assist_junit_test_case.png" alt="" />
</p>
</td>
</tr>
<!-- ******************* End of JUnit ************************************* -->
<!-- *********************** JDT Developers ******************************** -->
<tr>
<td id="JDTDev" class="section" colspan="2">
<h2>JDT Developers</h2>
</td>
</tr>
<tr id="null-scheduling-rule"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=531554 -->
<td class="title">Make JDT builder use null as scheduling rule</td>
<td class="content">
By configuring the <b>org.eclipse.jdt.core/useNullSchedulingRule</b> preference to true, the JDT builder will use <code>null</code>
as the scheduling rule instead of the workspace root. The preference can be changed using the Preferences APIs, or by editing
the <code>plugin_customization.ini</code> file of your application.
<p> This prevents the Java builder from locking the whole workspace. The user can continue to work in parallel and other builders
can also run in parallel, which results in faster builds and faster UI feedback.</p>
<p>As of 4.10, this is considered as an experimental feature and is introduced mainly for testing purposes.</p>
</td>
</tr>
<!-- *********************** End of JDT Developers ******************************** -->
</tbody>
</table>
<!-- ****************** END OF N&N TABLE ****************** -->
</body>
</html>