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 627a699 Use Stream.of().
627a699 is described below
commit 627a699bd0525fc1018887748c5d6b71047c1d62
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Jul 1 14:55:58 2021 -0400
Use Stream.of().
---
src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | 7 ++++---
.../apache/commons/lang3/time/FastDatePrinterTimeZonesTest.java | 3 +--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
index 9140007..6c0c10d 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
@@ -35,6 +35,7 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.ClassUtils;
@@ -745,13 +746,13 @@ public class MethodUtils {
Validate.notNull(cls, "cls");
Validate.notEmpty(methodName, "methodName");
- final List<Method> methods = Arrays.stream(cls.getDeclaredMethods())
+ final List<Method> methods = Stream.of(cls.getDeclaredMethods())
.filter(method -> method.getName().equals(methodName))
.collect(toList());
ClassUtils.getAllSuperclasses(cls).stream()
.map(Class::getDeclaredMethods)
- .flatMap(Arrays::stream)
+ .flatMap(Stream::of)
.filter(method -> method.getName().equals(methodName))
.forEach(methods::add);
@@ -782,7 +783,7 @@ public class MethodUtils {
throw new IllegalStateException(
String.format("Found multiple candidates for method %s on
class %s : %s",
- methodName +
Arrays.stream(parameterTypes).map(String::valueOf).collect(Collectors.joining(",",
"(", ")")),
+ methodName +
Stream.of(parameterTypes).map(String::valueOf).collect(Collectors.joining(",",
"(", ")")),
cls.getName(),
bestCandidates.stream().map(Method::toString).collect(Collectors.joining(",",
"[", "]")))
);
diff --git
a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTimeZonesTest.java
b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTimeZonesTest.java
index 2900229..27bc290 100644
---
a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTimeZonesTest.java
+++
b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTimeZonesTest.java
@@ -19,7 +19,6 @@ package org.apache.commons.lang3.time;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.text.SimpleDateFormat;
-import java.util.Arrays;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.stream.Stream;
@@ -32,7 +31,7 @@ public class FastDatePrinterTimeZonesTest {
private static final String PATTERN = "h:mma z";
public static Stream<TimeZone> data() {
- return
Arrays.stream(TimeZone.getAvailableIDs()).map(TimeZone::getTimeZone);
+ return
Stream.of(TimeZone.getAvailableIDs()).map(TimeZone::getTimeZone);
}
@ParameterizedTest