Skip to content

Commit b1c77b7

Browse files
committed
Annotate FluentIterable.from(FluentIterable) with @DonotCall
RELNOTES=Annotate FluentIterable.from(FluentIterable) with @DonotCall ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=295783622
1 parent 4941afc commit b1c77b7

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void testFrom() {
7676
Lists.newArrayList(FluentIterable.from(ImmutableList.of(1, 2, 3, 4))));
7777
}
7878

79-
@SuppressWarnings("deprecation") // test of deprecated method
79+
@SuppressWarnings({"deprecation", "DoNotCall"}) // test of deprecated method
8080
public void testFrom_alreadyFluentIterable() {
8181
FluentIterable<Integer> iterable = FluentIterable.from(asList(1));
8282
assertSame(iterable, FluentIterable.from(iterable));

android/guava/src/com/google/common/collect/FluentIterable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.common.base.Optional;
2525
import com.google.common.base.Predicate;
2626
import com.google.errorprone.annotations.CanIgnoreReturnValue;
27+
import com.google.errorprone.annotations.DoNotCall;
2728
import java.util.Arrays;
2829
import java.util.Collection;
2930
import java.util.Comparator;
@@ -173,6 +174,7 @@ public static <E> FluentIterable<E> from(E[] elements) {
173174
* FluentIterable}
174175
*/
175176
@Deprecated
177+
@DoNotCall("instances of FluentIterable don't need to be converetd to a FluentIterable")
176178
public static <E> FluentIterable<E> from(FluentIterable<E> iterable) {
177179
return checkNotNull(iterable);
178180
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void testFrom() {
8080
Lists.newArrayList(FluentIterable.from(ImmutableList.of(1, 2, 3, 4))));
8181
}
8282

83-
@SuppressWarnings("deprecation") // test of deprecated method
83+
@SuppressWarnings({"deprecation", "DoNotCall"}) // test of deprecated method
8484
public void testFrom_alreadyFluentIterable() {
8585
FluentIterable<Integer> iterable = FluentIterable.from(asList(1));
8686
assertSame(iterable, FluentIterable.from(iterable));

guava/src/com/google/common/collect/FluentIterable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.common.base.Optional;
2525
import com.google.common.base.Predicate;
2626
import com.google.errorprone.annotations.CanIgnoreReturnValue;
27+
import com.google.errorprone.annotations.DoNotCall;
2728
import java.util.Arrays;
2829
import java.util.Collection;
2930
import java.util.Comparator;
@@ -170,6 +171,7 @@ public static <E> FluentIterable<E> from(E[] elements) {
170171
* FluentIterable}
171172
*/
172173
@Deprecated
174+
@DoNotCall("instances of FluentIterable don't need to be converetd to a FluentIterable")
173175
public static <E> FluentIterable<E> from(FluentIterable<E> iterable) {
174176
return checkNotNull(iterable);
175177
}

0 commit comments

Comments
 (0)