Skip to content
Permalink
Browse files
Remove unnecessary Casting
  • Loading branch information
arturobernalg authored and kinow committed Oct 9, 2021
1 parent 5b0f22a commit 01413dc53b15f966e6f497520f93fb1c5c077664
Showing 4 changed files with 7 additions and 4 deletions.
@@ -458,6 +458,9 @@
<contributor>
<name>Stefano Cordio</name>
</contributor>
<contributor>
<name>Arturo Bernal</name>
</contributor>
</contributors>

<dependencies>
@@ -100,7 +100,7 @@ public static <E> Comparator<E> chainedComparator(final Comparator<E>... compara
@SuppressWarnings("unchecked")
public static <E> Comparator<E> chainedComparator(final Collection<Comparator<E>> comparators) {
return chainedComparator(
(Comparator<E>[]) comparators.toArray(EMPTY_COMPARATOR_ARRAY)
comparators.toArray(EMPTY_COMPARATOR_ARRAY)
);
}

@@ -119,7 +119,7 @@ private SwitchClosure(final boolean clone, final Predicate<? super E>[] predicat
final Closure<? super E>[] closures, final Closure<? super E> defaultClosure) {
iPredicates = clone ? FunctorUtils.copy(predicates) : predicates;
iClosures = clone ? FunctorUtils.copy(closures) : closures;
iDefault = (Closure<? super E>) (defaultClosure == null ? NOPClosure.<E>nopClosure() : defaultClosure);
iDefault = defaultClosure == null ? NOPClosure.<E>nopClosure() : defaultClosure;
}

/**
@@ -130,8 +130,8 @@ private SwitchTransformer(final boolean clone, final Predicate<? super I>[] pred
final Transformer<? super I, ? extends O> defaultTransformer) {
iPredicates = clone ? FunctorUtils.copy(predicates) : predicates;
iTransformers = clone ? FunctorUtils.copy(transformers) : transformers;
iDefault = (Transformer<? super I, ? extends O>) (defaultTransformer == null ?
ConstantTransformer.<I, O>nullTransformer() : defaultTransformer);
iDefault = defaultTransformer == null ?
ConstantTransformer.<I, O>nullTransformer() : defaultTransformer;
}

/**

0 comments on commit 01413dc

Please sign in to comment.