@@ -153,15 +153,14 @@ private static List<Replacement> toReplacements(String source, String replacemen
153153 return replacements ;
154154 }
155155
156- @ SuppressWarnings ("for-rollout:StatementSwitchToExpressionSwitch" )
157156 private SnippetWrapper snippetWrapper (SnippetKind kind , String source , int initialIndent ) {
158157 /*
159158 * Synthesize a dummy class around the code snippet provided by Eclipse. The
160159 * dummy class is correctly formatted -- the blocks use correct indentation,
161160 * etc.
162161 */
163162 switch (kind ) {
164- case COMPILATION_UNIT : {
163+ case COMPILATION_UNIT -> {
165164 SnippetWrapper wrapper = new SnippetWrapper ();
166165 for (int i = 1 ; i <= initialIndent ; i ++) {
167166 wrapper .append ("class Dummy {\n " ).append (createIndentationString (i ));
@@ -170,7 +169,7 @@ private SnippetWrapper snippetWrapper(SnippetKind kind, String source, int initi
170169 wrapper .closeBraces (initialIndent );
171170 return wrapper ;
172171 }
173- case CLASS_BODY_DECLARATIONS : {
172+ case CLASS_BODY_DECLARATIONS -> {
174173 SnippetWrapper wrapper = new SnippetWrapper ();
175174 for (int i = 1 ; i <= initialIndent ; i ++) {
176175 wrapper .append ("class Dummy {\n " ).append (createIndentationString (i ));
@@ -179,7 +178,7 @@ private SnippetWrapper snippetWrapper(SnippetKind kind, String source, int initi
179178 wrapper .closeBraces (initialIndent );
180179 return wrapper ;
181180 }
182- case STATEMENTS : {
181+ case STATEMENTS -> {
183182 SnippetWrapper wrapper = new SnippetWrapper ();
184183 wrapper .append ("class Dummy {\n " ).append (createIndentationString (1 ));
185184 for (int i = 2 ; i <= initialIndent ; i ++) {
@@ -189,7 +188,7 @@ private SnippetWrapper snippetWrapper(SnippetKind kind, String source, int initi
189188 wrapper .closeBraces (initialIndent );
190189 return wrapper ;
191190 }
192- case EXPRESSION : {
191+ case EXPRESSION -> {
193192 SnippetWrapper wrapper = new SnippetWrapper ();
194193 wrapper .append ("class Dummy {\n " ).append (createIndentationString (1 ));
195194 for (int i = 2 ; i <= initialIndent ; i ++) {
@@ -201,8 +200,7 @@ private SnippetWrapper snippetWrapper(SnippetKind kind, String source, int initi
201200 wrapper .closeBraces (initialIndent );
202201 return wrapper ;
203202 }
204- default :
205- throw new IllegalArgumentException ("Unknown snippet kind: " + kind );
203+ default -> throw new IllegalArgumentException ("Unknown snippet kind: " + kind );
206204 }
207205 }
208206}
0 commit comments