Skip to content

Commit

Permalink
Recognize that FluentIterable has undefined equals(), too.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=261734122
  • Loading branch information
cpovirk authored and netdpb committed Aug 13, 2019
1 parent 518c59d commit 386bca7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ && isSameType(getType(receiver), state.getSymtab().stringType, state)) {
return Optional.empty();
}
},
ITERABLE("Iterable", "java.lang.Iterable") {
ITERABLE("Iterable", "java.lang.Iterable", "com.google.common.collect.FluentIterable") {
@Override
Optional<SuggestedFix> generateFix(Tree receiver, Tree argument, VisitorState state) {
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ public void positiveAssertEquals() {
.addSourceLines(
"Test.java",
"import java.util.List;",
"import com.google.common.collect.FluentIterable;",
"import com.google.common.collect.Iterables;",
"import static org.junit.Assert.assertEquals;",
"import static org.junit.Assert.assertNotEquals;",
"class Test {",
" void test(List myList, List otherList) {",
" // BUG: Diagnostic contains: Iterable does not have",
" assertEquals(FluentIterable.of(1), FluentIterable.of(1));",
" // BUG: Diagnostic contains: Iterable does not have",
" assertEquals(Iterables.skip(myList, 1), Iterables.skip(myList, 2));",
" // BUG: Diagnostic contains: Iterable does not have",
" assertNotEquals(Iterables.skip(myList, 1), Iterables.skip(myList, 2));",
Expand Down

0 comments on commit 386bca7

Please sign in to comment.