mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
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:
committed by
Jesse Wilson
parent
b6ebe53ffb
commit
05b0a46961
@@ -1,9 +1,13 @@
|
|||||||
language: java
|
language: java
|
||||||
|
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk7
|
|
||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- oracle-java8-installer # Updates JDK 8 to the latest available.
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- .buildscript/deploy_snapshot.sh
|
- .buildscript/deploy_snapshot.sh
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ public final class Types {
|
|||||||
}
|
}
|
||||||
for (Annotation annotation : annotations) {
|
for (Annotation annotation : annotations) {
|
||||||
if (jsonQualifier.equals(annotation.annotationType())) {
|
if (jsonQualifier.equals(annotation.annotationType())) {
|
||||||
Set<Annotation> delegateAnnotations = new LinkedHashSet<>(annotations);
|
Set<? extends Annotation> delegateAnnotations = new LinkedHashSet<>(annotations);
|
||||||
delegateAnnotations.remove(annotation);
|
delegateAnnotations.remove(annotation);
|
||||||
return Collections.unmodifiableSet(delegateAnnotations);
|
return Collections.unmodifiableSet(delegateAnnotations);
|
||||||
}
|
}
|
||||||
|
@@ -209,6 +209,7 @@ public final class TypesTest {
|
|||||||
.containsExactly(String.class, Integer.class);
|
.containsExactly(String.class, Integer.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("GetClassOnAnnotation") // Explicitly checking for proxy implementation.
|
||||||
@Test public void createJsonQualifierImplementation() throws Exception {
|
@Test public void createJsonQualifierImplementation() throws Exception {
|
||||||
TestQualifier actual = Types.createJsonQualifierImplementation(TestQualifier.class);
|
TestQualifier actual = Types.createJsonQualifierImplementation(TestQualifier.class);
|
||||||
TestQualifier expected =
|
TestQualifier expected =
|
||||||
|
16
pom.xml
16
pom.xml
@@ -80,11 +80,25 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.0</version>
|
<version>3.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<compilerId>javac-with-errorprone</compilerId>
|
||||||
|
<forceJavacCompilerUse>true</forceJavacCompilerUse>
|
||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-compiler-javac-errorprone</artifactId>
|
||||||
|
<version>2.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.0.15</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
|
Reference in New Issue
Block a user