Skip to content

Commit

Permalink
Add a regression test for b/188314422
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 374800951
  • Loading branch information
cushon authored and Error Prone Team committed May 20, 2021
1 parent 4fa4727 commit 2241386
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1287,4 +1287,37 @@ public void exemptedMethods() {
"}")
.doTest();
}

@Ignore("b/188314422")
@Test
public void unusedReassignment() {
new Exception();
refactoringHelper
.addInputLines(
"Test.java",
"import java.util.ArrayList;",
"import java.util.Collection;",
"import java.util.List;",
"import static java.util.stream.Collectors.toList;",
"public class Test {",
" public void f(List<List<String>> lists) {",
" List<String> result =",
" lists.stream().collect(ArrayList::new, Collection::addAll,"
+ " Collection::addAll);",
" result = lists.stream().collect(ArrayList::new, ArrayList::addAll,"
+ " ArrayList::addAll);",
" }",
"}")
.addOutputLines(
"Test.java",
"import java.util.ArrayList;",
"import java.util.Collection;",
"import java.util.List;",
"import static java.util.stream.Collectors.toList;",
"public class Test {",
" public void f(List<List<String>> lists) {",
" }",
"}")
.doTest();
}
}

0 comments on commit 2241386

Please sign in to comment.