Skip to content

Commit

Permalink
Removed suppressed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed Oct 3, 2023
1 parent 3f8472b commit 740af74
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.lang.reflect.Array;

@SuppressWarnings({"unused", "unchecked"})
public class ArrayUtils {

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
/**
* A class loader with the ability to load classes from a byte array.
*/
@SuppressWarnings("unused")
public class ByteArrayClassLoader extends ClassLoader {

private final Map<String, byte[]> content = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.List;
import java.util.Random;

@SuppressWarnings("unused")
public class RandomUtils {

private static final Random RND = new Random();
Expand Down
4 changes: 0 additions & 4 deletions commons-main/src/main/java/net/lenni0451/commons/Sneaky.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class Sneaky {
* @param <T> The type of the exception
* @throws T The exception
*/
@SuppressWarnings({"unused", "RedundantThrows"})
public static <T extends Throwable> void fake(final Class<T> exceptionType) throws T {
}

Expand All @@ -21,7 +20,6 @@ public static <T extends Throwable> void fake(final Class<T> exceptionType) thro
* @param <T> The type of the throwable
* @throws T The throwable
*/
@SuppressWarnings("unchecked")
public static <T extends Throwable> void sneak(final Throwable t) throws T {
throw (T) t;
}
Expand All @@ -33,7 +31,6 @@ public static <T extends Throwable> void sneak(final Throwable t) throws T {
* @param <T> The type of the throwable
* @throws T The throwable
*/
@SuppressWarnings("unchecked")
public static <T extends Throwable> void sneak(final SneakyRunnable runnable) throws T {
try {
runnable.run();
Expand All @@ -51,7 +48,6 @@ public static <T extends Throwable> void sneak(final SneakyRunnable runnable) th
* @return The value
* @throws T The throwable
*/
@SuppressWarnings("unchecked")
public static <O, T extends Throwable> O sneak(final SneakySupplier<O> supplier) throws T {
try {
return supplier.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.function.Consumer;
import java.util.function.Supplier;

@SuppressWarnings({"UnusedReturnValue", "unused"})
public class Lists {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

@SuppressWarnings("unused")
public class Maps {

/**
Expand Down Expand Up @@ -59,7 +58,6 @@ public static <K, V> Map<K, V> merge(final Map<K, V> map, final Map<K, V>... oth
* @param <V> The value type
* @return The created map
*/
@SuppressWarnings("unchecked")
public static <T extends Map<K, V>, K, V> T any(final Supplier<T> mapSupplier, final Object... objects) {
if (objects.length % 2 != 0) throw new IllegalArgumentException("Uneven object count");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

@SuppressWarnings("unused")
public class Sets {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/**
* Convert colors between different formats.
*/
@SuppressWarnings("unused")
public class ColorConverter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/**
* A fast zip file using the {@link FileSystem} API.
*/
@SuppressWarnings("unused")
public class FileSystemZip implements AutoCloseable {

private final File file;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

@SuppressWarnings("unused")
public class FileUtils {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*
* @param <T> The type of the list
*/
@SuppressWarnings("unused")
public class SliceCalculator<T> {

private final List<T> list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* Start and manage a Tor proxy instance.<br>
* The proxy has to be provided by the user.
*/
@SuppressWarnings("unused")
public class TorProxy {

private static final Set<TorProxy> shutdownListener = Collections.newSetFromMap(new WeakHashMap<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* A thread scheduler that can execute tasks with a delay or repeat them.<br>
* Internally a {@link ScheduledExecutorService} is used.
*/
@SuppressWarnings({"unused", "UnusedReturnValue"})
public class ThreadScheduler {

private static final AtomicInteger THREAD_ID = new AtomicInteger(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.concurrent.TimeUnit;

@SuppressWarnings({"unused", "UnusedReturnValue"})
public class ThreadUtils {

private static final long SLEEP_PRECISION = TimeUnit.MILLISECONDS.toNanos(2);
Expand All @@ -12,7 +11,6 @@ public class ThreadUtils {
* Start a thread that will sleep forever.<br>
* This increases the precision of {@link Thread#sleep(long)}.
*/
@SuppressWarnings("BusyWait")
public static void startTimerHackThread() {
Thread thread = new Thread(() -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.text.SimpleDateFormat;
import java.util.TimeZone;

@SuppressWarnings("unused")
public class TimeFormatter {

/**
Expand Down

0 comments on commit 740af74

Please sign in to comment.