Skip to content

Commit 641cb35

Browse files
committed
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.
1 parent e4ea237 commit 641cb35

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

benchmarks/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ dependencies {
4545
libraries.math
4646
}
4747

48+
compileJmhJava {
49+
options.compilerArgs = compileJava.options.compilerArgs
50+
}
51+
4852
configureProtoCompilation()
4953

5054
def vmArgs = [

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ subprojects {
3030
}
3131

3232
[compileJava, compileTestJava].each() {
33-
it.options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:-options",
34-
"-Xlint:rawtypes"]
33+
it.options.compilerArgs += ["-Xlint:all", "-Xlint:-options"]
3534
it.options.encoding = "UTF-8"
3635
}
3736

37+
compileTestJava {
38+
// serialVersionUID is basically guaranteed to be useless in our tests
39+
options.compilerArgs += ["-Xlint:-serial"]
40+
}
41+
3842
jar.manifest {
3943
attributes('Implementation-Title': name,
4044
'Implementation-Version': version,

compiler/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ sourceSets {
135135

136136
compileTestLiteJava {
137137
// Protobuf-generated Lite produces quite a few warnings.
138-
it.options.compilerArgs.removeAll(["-Xlint:unchecked", "-Xlint:rawtypes"])
138+
options.compilerArgs = compileTestJava.options.compilerArgs +
139+
["-Xlint:-unchecked", "-Xlint:-rawtypes"]
140+
}
141+
142+
compileTestNanoJava {
143+
options.compilerArgs = compileTestJava.options.compilerArgs
139144
}
140145

141146
protobuf {

core/src/main/java/io/grpc/ManagedChannelProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ protected static boolean isAndroid() {
133133
protected abstract ManagedChannelBuilder<?> builderForTarget(String target);
134134

135135
public static final class ProviderNotFoundException extends RuntimeException {
136+
private static final long serialVersionUID = 1;
137+
136138
public ProviderNotFoundException(String msg) {
137139
super(msg);
138140
}

core/src/main/java/io/grpc/inprocess/InProcessSocketAddress.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
* Custom SocketAddress class for {@link InProcessTransport}.
3838
*/
3939
public class InProcessSocketAddress extends SocketAddress {
40+
private static final long serialVersionUID = -2803441206326023474L;
41+
4042
private final String name;
4143

4244
public InProcessSocketAddress(String name) {

0 commit comments

Comments
 (0)