Skip to content

Commit

Permalink
Annotate FluentIterable.from(FluentIterable) with @DonotCall
Browse files Browse the repository at this point in the history
RELNOTES=Annotate FluentIterable.from(FluentIterable) with @DonotCall

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=295783622
  • Loading branch information
kluever committed Feb 19, 2020
1 parent 4941afc commit b1c77b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Expand Up @@ -76,7 +76,7 @@ public void testFrom() {
Lists.newArrayList(FluentIterable.from(ImmutableList.of(1, 2, 3, 4))));
}

@SuppressWarnings("deprecation") // test of deprecated method
@SuppressWarnings({"deprecation", "DoNotCall"}) // test of deprecated method
public void testFrom_alreadyFluentIterable() {
FluentIterable<Integer> iterable = FluentIterable.from(asList(1));
assertSame(iterable, FluentIterable.from(iterable));
Expand Down
Expand Up @@ -24,6 +24,7 @@
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.DoNotCall;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
Expand Down Expand Up @@ -173,6 +174,7 @@ public static <E> FluentIterable<E> from(E[] elements) {
* FluentIterable}
*/
@Deprecated
@DoNotCall("instances of FluentIterable don't need to be converetd to a FluentIterable")
public static <E> FluentIterable<E> from(FluentIterable<E> iterable) {
return checkNotNull(iterable);
}
Expand Down
Expand Up @@ -80,7 +80,7 @@ public void testFrom() {
Lists.newArrayList(FluentIterable.from(ImmutableList.of(1, 2, 3, 4))));
}

@SuppressWarnings("deprecation") // test of deprecated method
@SuppressWarnings({"deprecation", "DoNotCall"}) // test of deprecated method
public void testFrom_alreadyFluentIterable() {
FluentIterable<Integer> iterable = FluentIterable.from(asList(1));
assertSame(iterable, FluentIterable.from(iterable));
Expand Down
2 changes: 2 additions & 0 deletions guava/src/com/google/common/collect/FluentIterable.java
Expand Up @@ -24,6 +24,7 @@
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.DoNotCall;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
Expand Down Expand Up @@ -170,6 +171,7 @@ public static <E> FluentIterable<E> from(E[] elements) {
* FluentIterable}
*/
@Deprecated
@DoNotCall("instances of FluentIterable don't need to be converetd to a FluentIterable")
public static <E> FluentIterable<E> from(FluentIterable<E> iterable) {
return checkNotNull(iterable);
}
Expand Down

0 comments on commit b1c77b7

Please sign in to comment.