You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/07/16 18:52:27 UTC
[commons-lang] branch master updated: Sort members
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 143518b64 Sort members
143518b64 is described below
commit 143518b64a6c02f2e89f342e34919fba806b82ef
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 16 14:52:21 2022 -0400
Sort members
---
.../concurrent/MultiBackgroundInitializer.java | 6 +++---
.../apache/commons/lang3/stream/StreamsTest.java | 22 +++++++++++-----------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
index e08552099..7b663be8f 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
@@ -190,11 +190,11 @@ public class MultiBackgroundInitializer
// collect the results
final Map<String, Object> results = new HashMap<>();
final Map<String, ConcurrentException> excepts = new HashMap<>();
- inits.entrySet().forEach(e -> {
+ inits.forEach((k, v) -> {
try {
- results.put(e.getKey(), e.getValue().get());
+ results.put(k, v.get());
} catch (final ConcurrentException cex) {
- excepts.put(e.getKey(), cex);
+ excepts.put(k, cex);
}
});
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 073e9cc71..e85957b3c 100644
--- a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
+++ b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
@@ -168,12 +168,23 @@ public class StreamsTest extends AbstractLangTest {
assertEquals(2, Streams.of(Arrays.asList("A", "B")).collect(Collectors.toList()).size());
}
+ @Test
+ public void testOfIterableNotNull() {
+ assertEquals(2, Streams.of((Iterable<String>) Arrays.asList("A", "B")).collect(Collectors.toList()).size());
+ }
+
@Test
public void testOfCollectionNull() {
final List<String> input = null;
assertEquals(0, Streams.of(input).collect(Collectors.toList()).size());
}
+ @Test
+ public void testOfIterableNull() {
+ final Iterable<String> input = null;
+ assertEquals(0, Streams.of(input).collect(Collectors.toList()).size());
+ }
+
@Test
public void testOfEnumeration() {
final Hashtable<String, Integer> table = new Hashtable<>();
@@ -188,17 +199,6 @@ public class StreamsTest extends AbstractLangTest {
assertEquals(2, collect.size());
}
- @Test
- public void testOfIterableNotNull() {
- assertEquals(2, Streams.of((Iterable<String>) Arrays.asList("A", "B")).collect(Collectors.toList()).size());
- }
-
- @Test
- public void testOfIterableNull() {
- final Iterable<String> input = null;
- assertEquals(0, Streams.of(input).collect(Collectors.toList()).size());
- }
-
@Test
public void testSimpleStreamFilter() {
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");