Improve various small code quality issues
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-01-16 03:53:51 +01:00
parent d315b3f38a
commit 546637c188
11 changed files with 46 additions and 44 deletions

View File

@@ -70,7 +70,9 @@ public class FormatUtil
if(hours == 0)
{
if(minutes == 0)
{} else { // i know this if has an empty body but i feel like this reads better
{
// empty code block because it makes the code easier to read
} else {
uptimeStringBuilder.append(minutes).append("m ");
}
} else {

View File

@@ -5,8 +5,8 @@ import java.time.format.DateTimeFormatter;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@Deprecated
public class Logger
@Deprecated(since = "0.5.16", forRemoval = true)
public class Logger<T>
{
// objects that we need to have for a properly formatted message
@@ -17,7 +17,7 @@ public class Logger
// when initializing a new logger, save variables in that instance
public Logger(Class logClass)
public Logger(Class<T> logClass)
{
className = logClass.getSimpleName();
}

View File

@@ -10,7 +10,7 @@ import java.util.List;
public class SerializationUtil
{
public static String serializeBase64(List dataList) {
public static <T> String serializeBase64(List<T> dataList) {
try (ByteArrayOutputStream bo = new ByteArrayOutputStream();
ObjectOutputStream so = new ObjectOutputStream(bo)) {
@@ -23,7 +23,7 @@ public class SerializationUtil
}
}
public static LinkedList deserializeBase64(String dataStr) {
public static <T> LinkedList<T> deserializeBase64(String dataStr) {
byte[] b = Base64.getDecoder().decode(dataStr);
ByteArrayInputStream bi = new ByteArrayInputStream(b);