Tweak -Xlint warnings

This now catches a few more places we needed -Xlint:-options.
InProcessSocketAddress is technically already in our stable API, so I
maintained its current serialVersionUID.
This commit is contained in:
Eric Anderson 2016-05-24 14:29:52 -07:00
parent e4ea237597
commit 641cb357c6
5 changed files with 20 additions and 3 deletions

View File

@ -45,6 +45,10 @@ dependencies {
libraries.math
}
compileJmhJava {
options.compilerArgs = compileJava.options.compilerArgs
}
configureProtoCompilation()
def vmArgs = [

View File

@ -30,11 +30,15 @@ subprojects {
}
[compileJava, compileTestJava].each() {
it.options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:-options",
"-Xlint:rawtypes"]
it.options.compilerArgs += ["-Xlint:all", "-Xlint:-options"]
it.options.encoding = "UTF-8"
}
compileTestJava {
// serialVersionUID is basically guaranteed to be useless in our tests
options.compilerArgs += ["-Xlint:-serial"]
}
jar.manifest {
attributes('Implementation-Title': name,
'Implementation-Version': version,

View File

@ -135,7 +135,12 @@ sourceSets {
compileTestLiteJava {
// Protobuf-generated Lite produces quite a few warnings.
it.options.compilerArgs.removeAll(["-Xlint:unchecked", "-Xlint:rawtypes"])
options.compilerArgs = compileTestJava.options.compilerArgs +
["-Xlint:-unchecked", "-Xlint:-rawtypes"]
}
compileTestNanoJava {
options.compilerArgs = compileTestJava.options.compilerArgs
}
protobuf {

View File

@ -133,6 +133,8 @@ public abstract class ManagedChannelProvider {
protected abstract ManagedChannelBuilder<?> builderForTarget(String target);
public static final class ProviderNotFoundException extends RuntimeException {
private static final long serialVersionUID = 1;
public ProviderNotFoundException(String msg) {
super(msg);
}

View File

@ -37,6 +37,8 @@ import java.net.SocketAddress;
* Custom SocketAddress class for {@link InProcessTransport}.
*/
public class InProcessSocketAddress extends SocketAddress {
private static final long serialVersionUID = -2803441206326023474L;
private final String name;
public InProcessSocketAddress(String name) {