No need to embedded if test.

This commit is contained in:
Gary Gregory 2021-02-25 18:46:33 -05:00
parent 9e0b31180d
commit 73e0dfc494
3 changed files with 7 additions and 13 deletions

View File

@ -564,11 +564,9 @@ private static int[] findRecursiveTypes(final ParameterizedType parameterizedTyp
parameterizedType.getActualTypeArguments().length);
int[] indexesToRemove = {};
for (int i = 0; i < filteredArgumentTypes.length; i++) {
if (filteredArgumentTypes[i] instanceof TypeVariable<?>) {
if (containsVariableTypeSameParametrizedTypeBound(((TypeVariable<?>) filteredArgumentTypes[i]),
parameterizedType)) {
indexesToRemove = ArrayUtils.add(indexesToRemove, i);
}
if ((filteredArgumentTypes[i] instanceof TypeVariable<?>) && containsVariableTypeSameParametrizedTypeBound(
((TypeVariable<?>) filteredArgumentTypes[i]), parameterizedType)) {
indexesToRemove = ArrayUtils.add(indexesToRemove, i);
}
}
return indexesToRemove;

View File

@ -145,10 +145,8 @@ private void assertEvenNumbers(final List<Integer> output) {
protected <T extends Throwable> FailablePredicate<Integer, T> asIntPredicate(final T pThrowable) {
return i -> {
if (i.intValue() == 5) {
if (pThrowable != null) {
throw pThrowable;
}
if (i.intValue() == 5 && pThrowable != null) {
throw pThrowable;
}
return i%2==0;
};

View File

@ -55,10 +55,8 @@ protected <T extends Throwable> FailableConsumer<String, T> asIntConsumer(final
protected <T extends Throwable> FailablePredicate<Integer, T> asIntPredicate(final T pThrowable) {
return i -> {
if (i.intValue() == 5) {
if (pThrowable != null) {
throw pThrowable;
}
if (i.intValue() == 5 && pThrowable != null) {
throw pThrowable;
}
return i % 2 == 0;
};