refactor: run idea's "Code Cleanup"

This commit is contained in:
Chayapak 2024-11-22 16:28:17 +07:00
parent efd837db36
commit a45477ed1b
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA
4 changed files with 5 additions and 6 deletions

View file

@ -7,7 +7,6 @@ import me.chayapak1.chomens_bot.plugins.IRCPlugin;
import me.chayapak1.chomens_bot.plugins.LoggerPlugin;
import me.chayapak1.chomens_bot.util.*;
import net.dv8tion.jda.api.requests.restaction.MessageCreateAction;
import net.kyori.adventure.text.Component;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
@ -20,7 +19,6 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

View file

@ -285,7 +285,7 @@ public class NBSConverter implements Converter {
}
}
private static List<String> sounds = loadJsonStringArray("sounds.json");
private static final List<String> sounds = loadJsonStringArray("sounds.json");
private static List<String> loadJsonStringArray (String name) {
List<String> list = new ArrayList<>();

View file

@ -1,6 +1,7 @@
package me.chayapak1.chomens_bot.song;
import me.chayapak1.chomens_bot.Bot;
import org.jetbrains.annotations.NotNull;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -107,12 +108,12 @@ public class SongPlayerConverter implements Converter {
}
@Override
public int read(byte b[]) throws IOException {
public int read(byte @NotNull [] b) throws IOException {
return read(b, 0, b.length);
}
@Override
public int read(byte b[], int off, int len) throws IOException {
public int read(byte @NotNull [] b, int off, int len) throws IOException {
int i = original.read(b, off, len);
if (i>=0) incrementCounter(i);
return i;

View file

@ -70,9 +70,9 @@ public class JavaOpusEncoder {
public static OpusApplication getApplication(de.maxhenkel.opus4j.OpusEncoder.Application application) {
return switch (application) {
default -> OpusApplication.OPUS_APPLICATION_VOIP;
case AUDIO -> OpusApplication.OPUS_APPLICATION_AUDIO;
case LOW_DELAY -> OpusApplication.OPUS_APPLICATION_RESTRICTED_LOWDELAY;
default -> OpusApplication.OPUS_APPLICATION_VOIP;
};
}
}