Skip to content

Commit 85d08ec

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Use Iterables.transform again (except for one method that apparently wants Lists.transform).
This undoes some accidental changes from cl/687466612. RELNOTES=n/a PiperOrigin-RevId: 691507206
1 parent 167113a commit 85d08ec

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

android/guava-tests/test/com/google/common/collect/IterablesTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
import static com.google.common.collect.Iterables.mergeSorted;
2828
import static com.google.common.collect.Iterables.removeIf;
2929
import static com.google.common.collect.Iterables.skip;
30-
import static com.google.common.collect.Iterables.transform;
3130
import static com.google.common.collect.Iterables.tryFind;
3231
import static com.google.common.collect.Lists.newArrayList;
33-
import static com.google.common.collect.Lists.transform;
3432
import static com.google.common.collect.ReflectionFreeAssertThrows.assertThrows;
3533
import static com.google.common.collect.Sets.newHashSet;
3634
import static com.google.common.collect.Sets.newLinkedHashSet;
@@ -287,7 +285,7 @@ public void testFilterByType_iterator() throws Exception {
287285
public void testTransform_iterator() {
288286
List<String> input = asList("1", "2", "3");
289287
Iterable<Integer> result =
290-
transform(
288+
Iterables.transform(
291289
input,
292290
new Function<String, Integer>() {
293291
@Override
@@ -306,7 +304,7 @@ public Integer apply(String from) {
306304
public void testPoorlyBehavedTransform() {
307305
List<String> input = asList("1", "not a number", "3");
308306
Iterable<Integer> result =
309-
transform(
307+
Iterables.transform(
310308
input,
311309
new Function<String, Integer>() {
312310
@Override
@@ -324,7 +322,7 @@ public Integer apply(String from) {
324322
public void testNullFriendlyTransform() {
325323
List<@Nullable Integer> input = asList(1, 2, null, 3);
326324
Iterable<String> result =
327-
transform(
325+
Iterables.transform(
328326
input,
329327
new Function<@Nullable Integer, String>() {
330328
@Override
@@ -1020,7 +1018,7 @@ public boolean apply(String s) {
10201018
public void testRemoveIf_transformedList() {
10211019
List<String> list = newArrayList("1", "2", "3", "4", "5");
10221020
List<Integer> transformed =
1023-
transform(
1021+
Lists.transform(
10241022
list,
10251023
new Function<String, Integer>() {
10261024
@Override

guava-tests/test/com/google/common/collect/IterablesTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
import static com.google.common.collect.Iterables.mergeSorted;
2828
import static com.google.common.collect.Iterables.removeIf;
2929
import static com.google.common.collect.Iterables.skip;
30-
import static com.google.common.collect.Iterables.transform;
3130
import static com.google.common.collect.Iterables.tryFind;
3231
import static com.google.common.collect.Lists.newArrayList;
33-
import static com.google.common.collect.Lists.transform;
3432
import static com.google.common.collect.ReflectionFreeAssertThrows.assertThrows;
3533
import static com.google.common.collect.Sets.newHashSet;
3634
import static com.google.common.collect.Sets.newLinkedHashSet;
@@ -299,7 +297,7 @@ public void testFilterByType_forEach() throws Exception {
299297
public void testTransform_iterator() {
300298
List<String> input = asList("1", "2", "3");
301299
Iterable<Integer> result =
302-
transform(
300+
Iterables.transform(
303301
input,
304302
new Function<String, Integer>() {
305303
@Override
@@ -318,7 +316,7 @@ public Integer apply(String from) {
318316
public void testTransform_forEach() {
319317
List<Integer> input = asList(1, 2, 3, 4);
320318
Iterable<String> result =
321-
transform(
319+
Iterables.transform(
322320
input,
323321
new Function<Integer, String>() {
324322
@Override
@@ -335,7 +333,7 @@ public String apply(Integer from) {
335333
public void testPoorlyBehavedTransform() {
336334
List<String> input = asList("1", "not a number", "3");
337335
Iterable<Integer> result =
338-
transform(
336+
Iterables.transform(
339337
input,
340338
new Function<String, Integer>() {
341339
@Override
@@ -353,7 +351,7 @@ public Integer apply(String from) {
353351
public void testNullFriendlyTransform() {
354352
List<@Nullable Integer> input = asList(1, 2, null, 3);
355353
Iterable<String> result =
356-
transform(
354+
Iterables.transform(
357355
input,
358356
new Function<@Nullable Integer, String>() {
359357
@Override
@@ -1057,7 +1055,7 @@ public boolean apply(String s) {
10571055
public void testRemoveIf_transformedList() {
10581056
List<String> list = newArrayList("1", "2", "3", "4", "5");
10591057
List<Integer> transformed =
1060-
transform(
1058+
Lists.transform(
10611059
list,
10621060
new Function<String, Integer>() {
10631061
@Override

0 commit comments

Comments
 (0)