Add error-prone compiler. (#259)

* Fix error-prone warning

* Add error-prone compiler.

* Suppress warning about calling getClass() on annotation.
This commit is contained in:
Jake Wharton
2017-02-14 22:28:24 -05:00
committed by Jesse Wilson
parent b6ebe53ffb
commit 05b0a46961
4 changed files with 22 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ public final class Types {
}
for (Annotation annotation : annotations) {
if (jsonQualifier.equals(annotation.annotationType())) {
Set<Annotation> delegateAnnotations = new LinkedHashSet<>(annotations);
Set<? extends Annotation> delegateAnnotations = new LinkedHashSet<>(annotations);
delegateAnnotations.remove(annotation);
return Collections.unmodifiableSet(delegateAnnotations);
}

View File

@@ -209,6 +209,7 @@ public final class TypesTest {
.containsExactly(String.class, Integer.class);
}
@SuppressWarnings("GetClassOnAnnotation") // Explicitly checking for proxy implementation.
@Test public void createJsonQualifierImplementation() throws Exception {
TestQualifier actual = Types.createJsonQualifierImplementation(TestQualifier.class);
TestQualifier expected =