mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 00:54:32 +08:00
chore: suppress unchecked
in selected classes (#6262)
This commit is contained in:
1
pom.xml
1
pom.xml
@ -76,7 +76,6 @@
|
||||
<compilerArgs>
|
||||
<arg>-Xlint:all</arg>
|
||||
<arg>-Xlint:-auxiliaryclass</arg>
|
||||
<arg>-Xlint:-unchecked</arg>
|
||||
<arg>-Werror</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
*
|
||||
* @author <a href="https://github.com/siddhant2002">Siddhant Swarup Mallick</a>
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class AllPathsFromSourceToTarget {
|
||||
|
||||
// No. of vertices in graph
|
||||
|
@ -10,6 +10,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
*
|
||||
* @param <Item> The type of elements stored in the circular buffer.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class CircularBuffer<Item> {
|
||||
private final Item[] buffer;
|
||||
private final CircularPointer putPointer;
|
||||
|
@ -19,7 +19,7 @@ import java.util.PriorityQueue;
|
||||
*
|
||||
* <p><strong>Time Complexity:</strong> O(E log V), where E is the number of edges and V is the number of vertices.</p>
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class Kruskal {
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@ import java.util.stream.IntStream;
|
||||
* For more information, see <a href="https://en.wikipedia.org/wiki/Graph_coloring">Graph Coloring</a>.
|
||||
* </p>
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public final class WelshPowell {
|
||||
private static final int BLANK_COLOR = -1; // Constant representing an uncolored state
|
||||
|
||||
|
@ -23,7 +23,7 @@ import java.util.LinkedList;
|
||||
* @param <K> the type of keys maintained by this hash map
|
||||
* @param <V> the type of mapped values
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class GenericHashMapUsingArray<K, V> {
|
||||
|
||||
private int size; // Total number of key-value pairs
|
||||
|
@ -10,7 +10,7 @@ import java.util.Objects;
|
||||
*
|
||||
* @param <T> the type of elements in this list
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class CursorLinkedList<T> {
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ import java.util.stream.IntStream;
|
||||
* @param <E> type of elements
|
||||
* @see <a href="https://en.wikipedia.org/wiki/Skip_list">Wiki. Skip list</a>
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class SkipList<E extends Comparable<E>> {
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,7 @@ import java.util.Stack;
|
||||
*
|
||||
* @param <T> The type of elements held in this queue.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class QueueByTwoStacks<T> {
|
||||
|
||||
private final Stack<T> enqueueStk;
|
||||
|
@ -2,7 +2,7 @@ package com.thealgorithms.dynamicprogramming;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
final class LongestArithmeticSubsequence {
|
||||
private LongestArithmeticSubsequence() {
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
/**
|
||||
* @author dimgrichr
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class CRCAlgorithm {
|
||||
|
||||
private int correctMess;
|
||||
|
@ -15,7 +15,7 @@ import com.thealgorithms.devutils.searches.SearchAlgorithm;
|
||||
* Note: This algorithm requires that the input array be sorted.
|
||||
* </p>
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class FibonacciSearch implements SearchAlgorithm {
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ import static com.thealgorithms.sorts.SortUtils.less;
|
||||
* <p>
|
||||
* For more details @see <a href="https://en.wikipedia.org/wiki/Timsort">TimSort Algorithm</a>
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
class TimSort implements SortAlgorithm {
|
||||
private static final int SUB_ARRAY_SIZE = 32;
|
||||
private Comparable[] aux;
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class KruskalTest {
|
||||
|
||||
private Kruskal kruskal;
|
||||
|
@ -8,7 +8,7 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public class NumberOfDigitsTest {
|
||||
|
||||
@ParameterizedTest
|
||||
|
Reference in New Issue
Block a user