2121
2222package com .igormaznitsa .jcp .context ;
2323
24- import static java .util .Arrays .asList ;
2524import static java .util .Collections .singletonList ;
26- import static java .util .Collections .unmodifiableList ;
2725
2826import com .igormaznitsa .jcp .containers .FileInfoContainer ;
2927import com .igormaznitsa .jcp .containers .TextFileDataContainer ;
@@ -68,7 +66,7 @@ public class PreprocessorContext {
6866 Collections .singletonList ("." + File .separatorChar );
6967 public static final String DEFAULT_DEST_DIRECTORY = ".." + File .separatorChar + "preprocessed" ;
7068 public static final List <String > DEFAULT_PROCESSING_EXTENSIONS =
71- unmodifiableList ( asList ( "java" , "txt" , "htm" , "html" ) );
69+ List . of ( "java" , "txt" , "htm" , "html" );
7270 public static final List <String > DEFAULT_EXCLUDED_EXTENSIONS = singletonList ("xml" );
7371 public static final Charset DEFAULT_CHARSET = StandardCharsets .UTF_8 ;
7472
@@ -233,9 +231,7 @@ private static String makeStackView(
233231 final StringBuilder builder = new StringBuilder ();
234232 int tab = 5 ;
235233
236- for (int s = 0 ; s < tab ; s ++) {
237- builder .append (' ' );
238- }
234+ builder .append (" " .repeat (tab ));
239235
240236 builder .append ('{' );
241237 if (cloned ) {
@@ -251,9 +247,7 @@ private static String makeStackView(
251247 for (int i = list .size () - 1 ; i >= 0 ; i --) {
252248 final TextFileDataContainer cur = list .get (i );
253249 builder .append ('\n' );
254- for (int s = 0 ; s < tab ; s ++) {
255- builder .append (' ' );
256- }
250+ builder .append (" " .repeat (Math .max (0 , tab )));
257251 builder .append ("└>" );
258252 builder .append (fileIndex ++).append (". " );
259253 builder .append (cur .getFile ().getName ()).append (':' ).append (cur .getLastReadStringIndex () + 1 );
@@ -281,8 +275,7 @@ private static Charset decodeCharset(final String charsetName) {
281275 * @since 7.0.3
282276 */
283277 public Set <File > findAllInputFiles () {
284- final Set <File > result = new HashSet <>();
285- result .addAll (this .configFiles );
278+ final Set <File > result = new HashSet <>(this .configFiles );
286279 this .preprocessedResources .forEach (x -> {
287280 result .addAll (x .getIncludedSources ());
288281 if (x .getSourceFile () != null &&
0 commit comments