Skip to content

Commit 3355d2a

Browse files
committed
Suppressing some errorprone checks with flags
1 parent bfc2b4e commit 3355d2a

File tree

10 files changed

+2
-23
lines changed

10 files changed

+2
-23
lines changed

google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java

-2
Original file line numberDiff line numberDiff line change
@@ -2863,8 +2863,6 @@ private com.google.spanner.v1.StructType buildStructType(StructReader struct) {
28632863
}
28642864

28652865
/** Convert a struct to a proto(value list) for constructing result rows and struct values. */
2866-
// Suppressed for initial Error Prone rollout.
2867-
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
28682866
private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct) {
28692867
com.google.spanner.executor.v1.ValueList.Builder structBuilder =
28702868
com.google.spanner.executor.v1.ValueList.newBuilder();

google-cloud-spanner/src/test/java/com/google/cloud/spanner/BackupIdTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public void basics() {
4040
assertThat(bid.toString()).isEqualTo(name);
4141
}
4242

43-
// Suppressed for initial Error Prone rollout.
44-
@SuppressWarnings("CheckReturnValue")
4543
@Test
4644
public void badName() {
4745
IllegalArgumentException e =

google-cloud-spanner/src/test/java/com/google/cloud/spanner/ChannelUsageTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ public void testCreatesNumChannels() {
228228
assertEquals(numChannels, batchCreateSessionLocalIps.size());
229229
}
230230

231-
// Suppressed for initial Error Prone rollout.
232-
@SuppressWarnings("CheckReturnValue")
233231
@Test
234232
public void testUsesAllChannels() throws InterruptedException {
235233
final int multiplier = 2;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminClientTest.java

-4
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,6 @@ public void instanceListDatabaseOperations()
631631
assertThat(instance.listDatabaseOperations().iterateAll()).hasSize(6);
632632
}
633633

634-
// Suppressed for initial Error Prone rollout.
635-
@SuppressWarnings("CheckReturnValue")
636634
@Test
637635
public void instanceListDatabaseOperationsWithMetadata() throws Exception {
638636
Instance instance =
@@ -715,8 +713,6 @@ public void instanceListBackupOperations()
715713
assertThat(instance.listBackupOperations().iterateAll()).hasSize(2);
716714
}
717715

718-
// Suppressed for initial Error Prone rollout.
719-
@SuppressWarnings("CheckReturnValue")
720716
@Test
721717
public void instanceListBackupOperationsWithProgress() throws InvalidProtocolBufferException {
722718
Instance instance =

google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ public void testMetricsSingleUseQueryWithAfeEnabled() throws Exception {
279279
}
280280
}
281281

282-
// Suppressed for initial Error Prone rollout.
283-
@SuppressWarnings("CheckReturnValue")
284282
@Test
285283
public void testMetricsWithGaxRetryUnaryRpc() {
286284
Stopwatch stopwatch = Stopwatch.createStarted();

google-cloud-spanner/src/test/java/com/google/cloud/spanner/RandomResultSetGenerator.java

-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ public class RandomResultSetGenerator {
8686
.build(),
8787
};
8888

89-
// Suppressed for initial Error Prone rollout.
90-
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
9189
private static ResultSetMetadata generateMetadata() {
9290
StructType.Builder rowTypeBuilder = StructType.newBuilder();
9391
for (int col = 0; col < TYPES.length; col++) {

google-cloud-spanner/src/test/java/com/google/cloud/spanner/SelectRandomBenchmark.java

-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ public void teardown() throws Exception {
113113
}
114114

115115
/** Measures the time needed to execute a burst of read requests. */
116-
// Suppressed for initial Error Prone rollout.
117-
@SuppressWarnings("ReturnValueIgnored")
118116
@Benchmark
119117
public void burstRead(final BenchmarkState server) throws Exception {
120118
int totalQueries = server.maxSessions * 8;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java

-4
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,6 @@ public void emptyStruct() {
541541
assertProtoEquals(t.toProto(), "code: STRUCT struct_type {}");
542542
}
543543

544-
// Suppressed for initial Error Prone rollout.
545-
@SuppressWarnings("CheckReturnValue")
546544
@Test
547545
public void structFieldIndexNotFound() {
548546
Type t = Type.struct(StructField.of("f1", Type.int64()));
@@ -551,8 +549,6 @@ public void structFieldIndexNotFound() {
551549
assertThat(e.getMessage().contains("Field not found: f2"));
552550
}
553551

554-
// Suppressed for initial Error Prone rollout.
555-
@SuppressWarnings("CheckReturnValue")
556552
@Test
557553
public void structFieldIndexAmbiguous() {
558554
Type t = Type.struct(StructField.of("f1", Type.int64()), StructField.of("f1", Type.string()));

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java

-2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ private static void appendProtoTypes(List<Type> types, Dialect dialect) {
185185
}
186186
}
187187

188-
// Suppressed for initial Error Prone rollout.
189-
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
190188
public static ResultSetMetadata generateAllTypesMetadata(Type[] types) {
191189
StructType.Builder rowTypeBuilder = StructType.newBuilder();
192190
for (int col = 0; col < types.length; col++) {

pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@
151151
<fork>true</fork>
152152
<compilerArgs>
153153
<arg>-XDcompilePolicy=simple</arg>
154-
<arg>-Xplugin:ErrorProne</arg>
154+
<arg>-Xplugin:ErrorProne -Xep:CheckReturnValue:OFF \
155+
-Xep:ProtoBuilderReturnValueIgnored:OFF -Xep:ReturnValueIgnored:OFF</arg>
155156
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
156157
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
157158
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>

0 commit comments

Comments
 (0)