use of com.google.errorprone.scanner.ErrorProneScanner in project error-prone by google.
the class CollectionIncompatibleTypeTest method testCastFixes.
@Test
public void testCastFixes() {
CompilationTestHelper compilationHelperWithCastFix = CompilationTestHelper.newInstance(ScannerSupplier.fromScanner(new ErrorProneScanner(new CollectionIncompatibleType(FixType.CAST))), getClass());
compilationHelperWithCastFix.addSourceLines("Test.java", "import java.util.Collection;", "public class Test {", " public void doIt(Collection<String> c1, Collection<Integer> c2) {", " // BUG: Diagnostic contains: c1.contains((Object) 1);", " c1.contains(1);", " // BUG: Diagnostic contains: c1.containsAll((Collection<?>) c2);", " c1.containsAll(c2);", " }", "}").doTest();
}
Aggregations