mirror of https://github.com/grpc/grpc-java.git
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:
parent
e4ea237597
commit
641cb357c6
|
|
@ -45,6 +45,10 @@ dependencies {
|
||||||
libraries.math
|
libraries.math
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileJmhJava {
|
||||||
|
options.compilerArgs = compileJava.options.compilerArgs
|
||||||
|
}
|
||||||
|
|
||||||
configureProtoCompilation()
|
configureProtoCompilation()
|
||||||
|
|
||||||
def vmArgs = [
|
def vmArgs = [
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,15 @@ subprojects {
|
||||||
}
|
}
|
||||||
|
|
||||||
[compileJava, compileTestJava].each() {
|
[compileJava, compileTestJava].each() {
|
||||||
it.options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:-options",
|
it.options.compilerArgs += ["-Xlint:all", "-Xlint:-options"]
|
||||||
"-Xlint:rawtypes"]
|
|
||||||
it.options.encoding = "UTF-8"
|
it.options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileTestJava {
|
||||||
|
// serialVersionUID is basically guaranteed to be useless in our tests
|
||||||
|
options.compilerArgs += ["-Xlint:-serial"]
|
||||||
|
}
|
||||||
|
|
||||||
jar.manifest {
|
jar.manifest {
|
||||||
attributes('Implementation-Title': name,
|
attributes('Implementation-Title': name,
|
||||||
'Implementation-Version': version,
|
'Implementation-Version': version,
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,12 @@ sourceSets {
|
||||||
|
|
||||||
compileTestLiteJava {
|
compileTestLiteJava {
|
||||||
// Protobuf-generated Lite produces quite a few warnings.
|
// 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 {
|
protobuf {
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,8 @@ public abstract class ManagedChannelProvider {
|
||||||
protected abstract ManagedChannelBuilder<?> builderForTarget(String target);
|
protected abstract ManagedChannelBuilder<?> builderForTarget(String target);
|
||||||
|
|
||||||
public static final class ProviderNotFoundException extends RuntimeException {
|
public static final class ProviderNotFoundException extends RuntimeException {
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
public ProviderNotFoundException(String msg) {
|
public ProviderNotFoundException(String msg) {
|
||||||
super(msg);
|
super(msg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ import java.net.SocketAddress;
|
||||||
* Custom SocketAddress class for {@link InProcessTransport}.
|
* Custom SocketAddress class for {@link InProcessTransport}.
|
||||||
*/
|
*/
|
||||||
public class InProcessSocketAddress extends SocketAddress {
|
public class InProcessSocketAddress extends SocketAddress {
|
||||||
|
private static final long serialVersionUID = -2803441206326023474L;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public InProcessSocketAddress(String name) {
|
public InProcessSocketAddress(String name) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue