@@ -66,7 +66,7 @@ <h2>Java Editor </h2>
6666 </ td >
6767 </ tr >
6868 < tr id ="new-folding ">
69- < td class ="title "> Enhanced Folding for Control Statements in Eclipse JDT </ td >
69+ < td class ="title "> Enhanced folding for control statements </ td >
7070 < td class ="content ">
7171 This feature enhances the code folding mechanism in Eclipse JDT by enabling folding for control statements like if, while, and for. </ b >
7272 It improves code readability and navigation by allowing developers to collapse and expand structured blocks.
@@ -81,6 +81,73 @@ <h2>Java Editor </h2>
8181 </ td >
8282 </ td >
8383 </ tr >
84+ < tr id ="new-add-permitted-types-quick-fix ">
85+ < td class ="title "> New add permitted types quick-fix</ td >
86+ < td class ="content ">
87+ A new quick-fix has been created for Java 21 and up to add
88+ permitted types as case labels to
89+ a switch statement/expression that specifies a variable
90+ for the expression that has a sealed type
91+ and the switch has no case labels added yet. The quick-fix will
92+ also add < b > null</ b > and < b > default</ b > case labels to make
93+ the switch exhaustive.
94+ < p > In the following example, there is a sealed type: < b > Shape</ b > that
95+ only permits < b > Circle</ b > and < b > Crescent</ b > classes to extend it.</ p >
96+ < img src ="images/sealed-shape.png " alt ="Shape class "/>
97+ < img src ="images/sealed-circle.png " alt ="Circle class "/>
98+ < img src ="images/sealed-crescent.png " alt ="Crescent.class "/>
99+ < p > The following code gets a compiler error and the new
100+ < b > Add permitted type cases</ b > quick-fix is offered:</ p >
101+ < img src ="images/sealed-before.png " alt ="Sealed test before "/>
102+ < p > After selecting this quick-fix, this results in:</ p >
103+ < img src ="images/sealed-after.png " alt ="Sealed test after "\ >
104+ </ td >
105+ </ td >
106+ </ tr >
107+ < tr id ="new-pattern-instanceof-to-switch ">
108+ < td class ="title "> New pattern instanceof to switch cleanup</ td >
109+ < td class ="content ">
110+ A new clean-up and quick-assist has been added for Java 21 and up to
111+ convert if statements using pattern instanceof expressions
112+ into a switch statement or switch expression (if possible).
113+ The transformation only applies if there are three
114+ or more pattern instanceof references to a single variable.
115+ To use the clean-up, go to the < b > Java Feature</ b >
116+ tab of the clean-up configuration dialog under < b > Java 21</ b > and
117+ select < b > Pattern instanceof to Switch</ b > .
118+ < p > For the following example:</ p >
119+ < img src ="images/pattern-instanceof-before.png " alt ="Pattern instanceof before "/>
120+ < p > Applying the clean-up results in:</ p >
121+ < img src ="images/pattern-instanceof-after.png " alt ="Pattern instanceof after "/>
122+ < p > In cases where a switch expression is not possible, a switch
123+ statement will be created instead. The quick-assist is activated
124+ by clicking < b > CTRL+1</ b > while having the cursor pointing within
125+ an if/else if/else block.
126+ </ td >
127+ </ td >
128+ </ tr >
129+ < tr id ="string-concat-to-text-block-enhancement ">
130+ < td class ="title "> String concat to text block clean-up enhancement</ td >
131+ < td class ="content ">
132+ The String concatenation to text block clean-up/quick-assist has been
133+ enhanced with regards to converting a StringBuilder or StringBuffer.
134+ There are situations where the StringBuilder/StringBuffer cannot
135+ be converted directly into a text block (for example, if the StringBuffer
136+ is further appended to or is passed as an argument to a method). In
137+ the past, the code would be left unaltered but now a text block will
138+ be used to initialize the StringBuffer/StringBuilder if not too
139+ small to warrant a text block.
140+ < p > The clean-up is enabled on the < b > Java Feature</ b > tab under
141+ < b > Java 15</ b > by selecting both:
142+ < b > Convert String concatenation to text block</ b > and
143+ < b > Include StringBuffer or StringBuilder concatenations</ b > .
144+ < p > For example, the following code sample:</ p >
145+ < img src ="images/string-concat-to-text-block-before.png " alt ="Text block clean-up before "/>
146+ < p > gets converted to:</ p >
147+ < img src ="images/string-concat-to-text-block-after.png " alt ="Text block clean-up after "/>
148+ </ td >
149+ </ td >
150+ </ tr >
84151 <!-- ******************* End of Java Editor ************************************* -->
85152
86153 <!-- ******************* Java Views and Dialogs ************************************* -->
0 commit comments