Skip to content

Commit a3560ca

Browse files
committed
fix IDE warnings
1 parent e37292d commit a3560ca

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/main/java/org/owasp/html/CssSchema.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ Property forKey(String propertyName) {
841841
DEFINITIONS = builder.build();
842842
}
843843

844-
private static <T> ImmutableSet<T> union(ImmutableSet<T>... subsets) {
844+
private static <T> ImmutableSet<T> union(
845+
@SuppressWarnings("unchecked") ImmutableSet<T>... subsets) {
845846
ImmutableSet.Builder<T> all = ImmutableSet.builder();
846847
for (ImmutableSet<T> subset : subsets) {
847848
all.addAll(subset);

src/main/java/org/owasp/html/Trie.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private Trie(
7878
this.value = elements.get(pos).getValue();
7979
if (pos + 1 == end) { // base case
8080
this.childMap = ZERO_CHARS;
81-
this.children = ZERO_TRIES;
81+
this.children = ((Trie<T>[]) ZERO_TRIES);
8282
return;
8383
} else {
8484
++pos;
@@ -156,7 +156,7 @@ private static <U> List<Map.Entry<String, U>> sortedUniqEntries(
156156
}
157157

158158
private static final char[] ZERO_CHARS = new char[0];
159-
private static final Trie[] ZERO_TRIES = new Trie[0];
159+
private static final Trie<?>[] ZERO_TRIES = new Trie<?>[0];
160160

161161
/**
162162
* Append all strings s such that {@code this.lookup(s).isTerminal()} to the

src/test/java/org/owasp/html/SanitizersTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,11 @@ private static class Permutations<T> implements Iterable<List<T>> {
453453
/** Permutation size. */
454454
final int k;
455455

456-
Permutations(T... elements) {
456+
Permutations(@SuppressWarnings("unchecked") T... elements) {
457457
this(elements.length, elements);
458458
}
459459

460-
Permutations(int k, T... elements) {
460+
Permutations(int k, @SuppressWarnings("unchecked") T... elements) {
461461
this.k = k;
462462
this.elements = ImmutableList.copyOf(elements);
463463
}

0 commit comments

Comments
 (0)