This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 73e0dfc No need to embedded if test.
73e0dfc is described below
commit 73e0dfc49445976c681f30e6e849c5f3d101fd7e
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Feb 25 18:46:33 2021 -0500
No need to embedded if test.
---
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | 8 +++-----
src/test/java/org/apache/commons/lang3/StreamsTest.java | 6 ++----
src/test/java/org/apache/commons/lang3/stream/StreamsTest.java | 6 ++----
3 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
index 4f00a4c..f34214a 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
@@ -564,11 +564,9 @@ public class TypeUtils {
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;
diff --git a/src/test/java/org/apache/commons/lang3/StreamsTest.java
b/src/test/java/org/apache/commons/lang3/StreamsTest.java
index df13160..ce9bbb5 100644
--- a/src/test/java/org/apache/commons/lang3/StreamsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StreamsTest.java
@@ -145,10 +145,8 @@ public class StreamsTest {
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;
};
diff --git a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
index 218fa33..5910cb7 100644
--- a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
+++ b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
@@ -55,10 +55,8 @@ public class StreamsTest {
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;
};