refactor: make some constant things that are List immutable by using List.of()

This commit is contained in:
ChomeNS
2025-04-23 16:15:17 +07:00
parent c90840265a
commit b1925edf00
7 changed files with 64 additions and 82 deletions

View File

@@ -10,21 +10,18 @@ import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
// Author: _ChipMC_ & hhhzzzsss but modified
public class SongLoaderThread extends Thread {
// should the converters be here?
public static final List<Converter> converters = new ArrayList<>();
static {
converters.add(new MidiConverter());
converters.add(new NBSConverter());
converters.add(new TextFileConverter());
converters.add(new SongPlayerConverter());
}
public static final List<Converter> converters = List.of(
new MidiConverter(),
new NBSConverter(),
new TextFileConverter(),
new SongPlayerConverter()
);
public final String fileName;