Skip to content

Commit 5eb24bf

Browse files
committed
Suppressing some errorprone checks with flags
1 parent 3f5f1ae commit 5eb24bf

File tree

11 files changed

+3
-25
lines changed

11 files changed

+3
-25
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
@@ -2862,8 +2862,6 @@ private com.google.spanner.v1.StructType buildStructType(StructReader struct) {
28622862
}
28632863

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

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ public void testGetExecuteBatchDmlRequestBuilderWithPriority() {
266266
assertEquals(Priority.PRIORITY_LOW, request.getRequestOptions().getPriority());
267267
}
268268

269-
// Suppressed for initial Error Prone rollout.
270-
@SuppressWarnings("JUnit4TestNotRun")
269+
@Test
271270
public void executeSqlRequestBuilderWithRequestOptions() {
272271
ExecuteSqlRequest request =
273272
context

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
@@ -632,8 +632,6 @@ public void instanceListDatabaseOperations()
632632
assertThat(instance.listDatabaseOperations().iterateAll()).hasSize(6);
633633
}
634634

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

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

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

-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ public void testMetricsSingleUseQuery() {
196196
assertThat(getAggregatedValue(attemptCountMetricData, expectedAttributes)).isEqualTo(1);
197197
}
198198

199-
// Suppressed for initial Error Prone rollout.
200-
@SuppressWarnings("CheckReturnValue")
201199
@Test
202200
public void testMetricsWithGaxRetryUnaryRpc() {
203201
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
@@ -78,8 +78,6 @@ public class RandomResultSetGenerator {
7878
.build(),
7979
};
8080

81-
// Suppressed for initial Error Prone rollout.
82-
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
8381
private static ResultSetMetadata generateMetadata() {
8482
StructType.Builder rowTypeBuilder = StructType.newBuilder();
8583
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
@@ -501,8 +501,6 @@ public void emptyStruct() {
501501
assertProtoEquals(t.toProto(), "code: STRUCT struct_type {}");
502502
}
503503

504-
// Suppressed for initial Error Prone rollout.
505-
@SuppressWarnings("CheckReturnValue")
506504
@Test
507505
public void structFieldIndexNotFound() {
508506
Type t = Type.struct(StructField.of("f1", Type.int64()));
@@ -511,8 +509,6 @@ public void structFieldIndexNotFound() {
511509
assertThat(e.getMessage().contains("Field not found: f2"));
512510
}
513511

514-
// Suppressed for initial Error Prone rollout.
515-
@SuppressWarnings("CheckReturnValue")
516512
@Test
517513
public void structFieldIndexAmbiguous() {
518514
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
@@ -179,8 +179,6 @@ private static void appendProtoTypes(List<Type> types, Dialect dialect) {
179179
}
180180
}
181181

182-
// Suppressed for initial Error Prone rollout.
183-
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
184182
public static ResultSetMetadata generateAllTypesMetadata(Type[] types) {
185183
StructType.Builder rowTypeBuilder = StructType.newBuilder();
186184
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)