Skip to content

Commit 2f31c7d

Browse files
committed
Fix raw type warning for LinkedList in HashSet implementation
1 parent 5368db6 commit 2f31c7d

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/com/thealgorithms/datastructures/hashset

1 file changed

+2
-2
lines changed

src/main/java/com/thealgorithms/datastructures/hashset/HashSet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class HashSet {
2727

2828
@SuppressWarnings("unchecked")
2929
public HashSet() {
30-
buckets = new LinkedList[INITIAL_CAPACITY];
30+
buckets = (LinkedList<Integer>[]) new LinkedList[INITIAL_CAPACITY];
3131
for (int i = 0; i < INITIAL_CAPACITY; i++) {
32-
buckets[i] = new LinkedList<>();
32+
buckets[i] = new LinkedList<Integer>();
3333
}
3434
size = 0;
3535
}

0 commit comments

Comments
 (0)