Skip to content

Commit

Permalink
fix IDE warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesamuel committed Jun 10, 2019
1 parent e37292d commit a3560ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/owasp/html/CssSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,8 @@ Property forKey(String propertyName) {
DEFINITIONS = builder.build();
}

private static <T> ImmutableSet<T> union(ImmutableSet<T>... subsets) {
private static <T> ImmutableSet<T> union(
@SuppressWarnings("unchecked") ImmutableSet<T>... subsets) {
ImmutableSet.Builder<T> all = ImmutableSet.builder();
for (ImmutableSet<T> subset : subsets) {
all.addAll(subset);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/owasp/html/Trie.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private Trie(
this.value = elements.get(pos).getValue();
if (pos + 1 == end) { // base case
this.childMap = ZERO_CHARS;
this.children = ZERO_TRIES;
this.children = ((Trie<T>[]) ZERO_TRIES);
return;
} else {
++pos;
Expand Down Expand Up @@ -156,7 +156,7 @@ private static <U> List<Map.Entry<String, U>> sortedUniqEntries(
}

private static final char[] ZERO_CHARS = new char[0];
private static final Trie[] ZERO_TRIES = new Trie[0];
private static final Trie<?>[] ZERO_TRIES = new Trie<?>[0];

/**
* Append all strings s such that {@code this.lookup(s).isTerminal()} to the
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/owasp/html/SanitizersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,11 @@ private static class Permutations<T> implements Iterable<List<T>> {
/** Permutation size. */
final int k;

Permutations(T... elements) {
Permutations(@SuppressWarnings("unchecked") T... elements) {
this(elements.length, elements);
}

Permutations(int k, T... elements) {
Permutations(int k, @SuppressWarnings("unchecked") T... elements) {
this.k = k;
this.elements = ImmutableList.copyOf(elements);
}
Expand Down

0 comments on commit a3560ca

Please sign in to comment.