Skip to content

Commit

Permalink
New and Noteworthy for 4.30 (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
alshamams committed Nov 22, 2023
1 parent 4715d24 commit 63c702f
Show file tree
Hide file tree
Showing 30 changed files with 328 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Define topics for the What's New -->
<!-- ================================ -->
<toc label="What's New">
<topic href="whatsNew/jdt_whatsnew.html#JUnit" label="JUnit"/>
<topic href="whatsNew/jdt_whatsnew.html#Java21" label="Java 21 Support"/>
<topic href="whatsNew/jdt_whatsnew.html#JavaEditor" label="Java Editor"/>
<topic href="whatsNew/jdt_whatsnew.html#JavaViewsAndDialogs" label="Java Views and Dialogs"/>
<topic href="whatsNew/jdt_whatsnew.html#JDTDev" label="JDT Developers"/>
</toc>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
table.news tr td.content {vertical-align: top;}
ul {padding-left: 13px;}
</style>
<title>What's New in Eclipse 4.29 (JDT)</title>
<title>What's New in Eclipse 4.30 (JDT)</title>
</head>

<body>
<h2>What's New in Eclipse 4.29 (JDT)</h2>
<h2>What's New in Eclipse 4.30 (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.29 release of Eclipse.
for the 4.30 release of Eclipse.
They are grouped into:</p>
<ul> <!-- NOTE: Sync ../topics_WhatsNew.xml with this! -->
<!--li><a href="#Java19">Java 19 Support</a></li-->
<li><a href="#Java21">Java 21 Support</a></li>
<!--li><a href="#JavaCompiler">Java Compiler</a></li-->
<li><a href="#JUnit">JUnit</a></li>
<!--li><a href="#JUnit">JUnit</a></li-->
<li><a href="#JavaEditor">Java Editor</a></li>
<li><a href="#JavaViewsAndDialogs">Java Views and Dialogs</a></li>
<!--li><a href="#JavaViewsAndDialogs">Java Views and Dialogs</a></li-->
<!--li><a href="#JavaFormatter">Java Formatter</a></li-->
<!--li><a href="#Debug">Debug</a></li-->
<!--li><a href="#JDTDev">JDT Developers</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>
Expand All @@ -49,37 +49,34 @@ <h2>What's New in Eclipse 4.29 (JDT)</h2>
</colgroup>
<tbody>

<!-- ******************* Java XX Support ************************************* -->
<!--
<!-- ******************* Java 21 Support ************************************* -->
<tr>
<td id="JavaXX" class="section" colspan="2">
<h2>Java&trade; XX Support </h2>
<td id="Java21" class="section" colspan="2">
<h2>Java&trade; 21 Support </h2>
</td>
</tr>
-->
<!-- ******************* End of Java XX Support ************************************* -->
<tr id="Java_21"> <!-- https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1396 -->
<td class="title">Java 21</td>
<td class="content">
<a href="http://jdk.java.net/21/">Java 21</a> is out and Eclipse JDT supports Java 21 in 4.30.
<p></p>
<p>
The release notably includes the following Java 21 features:
<br/>
<a href="https://openjdk.java.net/jeps/440" target="_blank"> JEP 440: Record Patterns</a>.
<br/>
<a href="https://openjdk.java.net/jeps/441" target="_blank"> JEP 441: Pattern Matching for Switch</a>.
</p>
</td>
</tr>
<!-- ******************* End of Java 21 Support ************************************* -->

<!-- ******************* JUnit ************************************* -->
<tr>
<!--tr>
<td id="JUnit" class="section" colspan="2">
<h2>JUnit</h2>
</td>
</tr>
<tr id="junit-search-progress">
<td class="title"><a href="#junit-search-progress">Show progress when searching test methods in JUnit run/debug configuration</a></td>
<td class="content">
A progress dialog and a progress bar have been added to the <b>Run/Debug configurations</b> of JUnit tests.
<p>If the configuration references a <b>test method</b> then a search takes place, which sometimes requires some time and led previously to a UI freeze.
There is now a progress indication in the form of a progress dialog when first opening the <b>Run/Debug Configurations</b> dialog:</p>
<p><img src="images/junit-search-progress-dialog.png" alt="JUnit search progress dialog"/></p>
<p>Or in the form of a progress bar if the dialog is already opened:</p>
<p><img src="images/junit-search-progress-bar.png" alt="JUnit search progress bar"/></p>
<p>In case the search is canceled by the user, the cancelation will be reported in the notification area of the <b>Run/Debug Configurations</b> dialog,
the text field <b>Test method:</b> will be disabled and and the <b>Run/Debug</b> button will be disabled. The <b>Search...</b> button right next to
<b>Test method:</b> remains enabled and triggers the search again.</p>.
<p><img src="images/junit-search-progress-run-configuration.png" alt="JUnit search progress Run Configuration"/></p>
</td>
</tr>
</tr-->
<!-- ******************* End of JUnit ************************************* -->

<!-- ******************* Java Editor ************************************* -->
Expand All @@ -88,65 +85,116 @@ <h2>JUnit</h2>
<h2>Java Editor </h2>
</td>
</tr>
<tr id="java-constant-hover">
<td class="title"><a href="#java-constant-hover">Java Constant Hover</a></td>
<td class="content">
A new hover has been added to display the values of integer or float constants specified in binary, octal, or hex
format. When hovering over such constants, the value will be shown in decimal format followed by the value in hex.
<p>The hover can be activated in the <b>Java &gt; Editor &gt; Hovers</b> preference page either by
selecting the <b>Combined Hover</b> or by clicking on the <b>Java Constant</b> check box.</p>
<p><img src="images/java-constant-hover-prefs.png" alt="Java Constant Hover in preferences"/></p>
<p>The following shows hovering over an integer constant specified in octal format:</p>
<p><img src="images/java-constant-hover-example.png" alt="Example of Java Constant Hover"/></p>
</td>
<tr id="add-default-case-quick-fix">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/783 -->
<td class="title">Quick Fix to add default case</td>
<td class="content">
You can use the new <b>Quick Fix (Ctrl+1)</b> to add the missing <code>default</code> case to an enhanced switch statement. For example,
<p><img src="images/add_default_case.png" alt="add default case quick fix"/></p>
will result in:
<p><img src="images/add_default_case_result.png" alt="result of add default case quick fix"/></p>
</td>
</tr>
<tr id="remove-default-case-quick-fix">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/850 -->
<td class="title">Quick Fix to remove default case</td>
<td class="content">
You can use the new <b>Quick Fix (Ctrl+1)</b> to remove the <code>default</code> case when it is present with unconditional pattern in a switch. For example,
<p><img src="images/remove_default_case.png" alt="remove default case quick fix"/></p>
will result in:
<p><img src="images/remove_default_case_result.png" alt="result of remove default case quick fix"/></p>
</td>
</tr>
<tr id="insert-break-statement">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/881 -->
<td class="title">Quick Fix to insert break statement</td>
<td class="content">
You can use the new <b>Quick Fix (Ctrl+1)</b> to insert the <code>break</code> statement when there is an illegal fall-through to a pattern in a switch statement.
For example,
<p><img src="images/insert_break.png" alt="insert break statement quick fix"/></p>
will result in:
<p><img src="images/insert_break_result.png" alt="result of insert break statement quick fix"/></p>
</td>
</tr>
<tr id="lambda-cleanup-improvements">
<td class="title"><a href="#lambda-cleanup-improvements">Lambda Cleanup Improvements</a></td>
<td class="content">
A number of improvements have been made to the Java cleanups concerning converting to use lambdas and simplifying existing
lambdas. First of all, the cleanup preference: <b>Convert functional interface instances</b> on the <b>Java Features</b> tab
for Java 8 has added an additional checkbox: <b>Simplify method reference syntax for lambda conversions</b>. This checkbox is
selected by default and instructs the cleanup to use method reference syntax where possible when converting from anonymous
classes. If the checkbox is unselected, method reference syntax will not be used by default (sometimes required to avoid
a runtime <i>NullPointerException</i>) but will only be used if the user has also selected the <b>Simplify lambda expression and
method reference syntax</b> cleanup option found on the <b>Code Style</b> tab. By default, the Quick fix to convert an
anonymous class will also by default now use the method reference syntax where possible.
<p><img src="images/new-lambda-pref.png" alt="New Lambda Cleanup Preference"/></p>
<p>The second improvement to the lambda cleanups and quick fix is that the code now recognizes use of <b>instanceof</b> can
be replaced with a method reference to <b>isInstance</b></p>.
<p>The following code:</p>
<p><img src="images/lambda-example-before.png" alt="Lambda Cleanup Example Before"/></p>
<p>with the lambda cleanup will by default change to:</p>
<p><img src="images/lambda-example-after.png" alt="Lambda Cleanup Example After"/></p>
</td>
<tr id="deprecated-cleanup">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/722 -->
<td class="title">Cleanup and quick fix to replace deprecated method calls</td>
<td class="content">
A new cleanup has been added to the <b>Source &gt; Clean Up &gt; Source Fixing</b> tab page to replace deprecated method calls with inlined content. Choosing this option will inline
the implementation of the deprecated method if and only if:
<ol>
<li>The deprecated method has Javadoc that specifies a @deprecated tag which ends with "use {@link ...}" or "replace by {@link ...}"</li>
<li>The {@link ...} tag refers to a method</li>
<li>The linked method is actually called in the implementation of the deprecated method</li>
<li>Methods and fields accessed in the linked method are visible at the location it will be inlined (e.g. using a package private method is ok to call if in same package)</li>
</ol>
For example, cleaning up the following:
<p><img src="images/deprecated-before.png" alt="deprecated method call to inline"/></p>
will result in inlining the deprecated foo() call in foo2:
<p><img src="images/deprecated-after.png" alt="result of deprecated method call inline"/></p>
<p>The functionality is also available as a quick fix for an individual call to a deprecated method that is marked with warning or error. One can also select a deprecated method call and initiate as a quick assist (select call and click <b>CTRL + 1</b>).</p>
</td>
</tr>
<tr id="constant-renaming">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/749 -->
<td class="title">Quick assist to rename constant fields</td>
<td class="content">
A new quick assist has been added to rename static constant fields to follow a standard syntax using upper-case and underscores rather than camel case.
To use: select the constant and click <b>CTRL+1</b>.
For example,
<p><img src="images/constant-renaming.png" alt="rename constant quick assist"/></p>
will offer to rename the constant "valConstant1" to "VAL_CONSTANT1".
</td>
</tr>

<!-- ******************* End of Java Editor ************************************* -->


<!-- ******************* Java Views and Dialogs ************************************* -->
<tr>
<!--tr>
<td id="JavaViewsAndDialogs" class="section" colspan="2">
<h2>Java Views and Dialogs</h2>
</td>
</tr-->
<!-- ******************* End of Java Views and Dialogs ************************************* -->

<!-- ******************* Java Compiler ************************************* -->
<!--tr>
<td id="JavaCompiler" class="section" colspan="2">
<h2>Java Compiler</h2>
</td>
</tr-->
<!-- ******************* End of Java Compiler ************************************* -->

<!-- ******************* Java Formatter ************************************* -->
<!--tr>
<td id="JavaFormatter" class="section" colspan="2">
<h2>Java Formatter </h2>
</td>
</tr-->
<!-- ******************* End of Java Formatter ************************************* -->

<!-- *********************** Debug ******************************** -->
<!--tr>
<td id="Debug" class="section" colspan="2">
<h2>Debug</h2>
</td>
</tr-->
<!--************************ End of Debug ******************************** -->

<!-- *********************** JDT Developers ******************************** -->
<tr>
<td id="JDTDev" class="section" colspan="2">
<h2>JDT Developers</h2>
</td>
</tr>
<tr id="ignoreWhitespace">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/pull/584 -->
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/commit/8234af07ce40f708b34b4d48b195f0d4e4dc8402 -->
<td class="title">Improved "Ignore Whitespace" in Java Compare</td>
<tr id="jdt-ui-pushdown-jdt-manipulations">
<!-- https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/783 -->
<td class="title">Pushdown of refactors and proposals to jdt.manipulations</td>
<td class="content">
Up to now the "Ignore White Space" context menu action in the Java Compare editor ignored all whitespace, including what may be semantically significant whitespace.
<p><img src="images/show_ws.png" alt="Showing all white space changed"/></p>
For example, a white space difference in a Java string literal is semantically significant while trailing white space is not.
<p>
This has now been inproved so that e.g. white space changes in string literals are also shown while "Ignore White Space" is active.
</p>
<p><img src="images/ignore_ws.png" alt="Hiding insignificant white space"/></p>
A significant amount of code was pushed down from org.eclipse.jdt.ui into org.eclipse.jdt.core.manipulations, specifically most of the proposal and refactor operations. This will allow these operations to be used in a headless environment.
</td>
</tr>
<!-- ******************* End of Java Views and Dialogs ************************************* -->

<tr><td colspan="2"/></tr>
<!-- *********************** End of JDT Developers ******************************** -->
<!--tr><td colspan="2"/></tr-->
</tbody>
</table>
<!-- ****************** END OF N&N TABLE ****************** -->
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 63c702f

Please sign in to comment.