Skip to content

Commit

Permalink
Suppressing some errorprone checks with flags
Browse files Browse the repository at this point in the history
  • Loading branch information
schcamille committed Feb 3, 2025
1 parent 362cdbe commit ff6ab1b
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2862,8 +2862,6 @@ private com.google.spanner.v1.StructType buildStructType(StructReader struct) {
}

/** Convert a struct to a proto(value list) for constructing result rows and struct values. */
// Suppressed for initial Error Prone rollout.
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct) {
com.google.spanner.executor.v1.ValueList.Builder structBuilder =
com.google.spanner.executor.v1.ValueList.newBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ public void testGetExecuteBatchDmlRequestBuilderWithPriority() {
assertEquals(Priority.PRIORITY_LOW, request.getRequestOptions().getPriority());
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("JUnit4TestNotRun")
@Test
public void executeSqlRequestBuilderWithRequestOptions() {
ExecuteSqlRequest request =
context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public void basics() {
assertThat(bid.toString()).isEqualTo(name);
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("CheckReturnValue")
@Test
public void badName() {
IllegalArgumentException e =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ public void testCreatesNumChannels() {
assertEquals(numChannels, batchCreateSessionLocalIps.size());
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("CheckReturnValue")
@Test
public void testUsesAllChannels() throws InterruptedException {
final int multiplier = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,6 @@ public void instanceListDatabaseOperations()
assertThat(instance.listDatabaseOperations().iterateAll()).hasSize(6);
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("CheckReturnValue")
@Test
public void instanceListDatabaseOperationsWithMetadata() throws Exception {
Instance instance =
Expand Down Expand Up @@ -716,8 +714,6 @@ public void instanceListBackupOperations()
assertThat(instance.listBackupOperations().iterateAll()).hasSize(2);
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("CheckReturnValue")
@Test
public void instanceListBackupOperationsWithProgress() throws InvalidProtocolBufferException {
Instance instance =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ public void testMetricsSingleUseQuery() {
assertThat(getAggregatedValue(attemptCountMetricData, expectedAttributes)).isEqualTo(1);
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("CheckReturnValue")
@Test
public void testMetricsWithGaxRetryUnaryRpc() {
Stopwatch stopwatch = Stopwatch.createStarted();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public class RandomResultSetGenerator {
.build(),
};

// Suppressed for initial Error Prone rollout.
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
private static ResultSetMetadata generateMetadata() {
StructType.Builder rowTypeBuilder = StructType.newBuilder();
for (int col = 0; col < TYPES.length; col++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ public void teardown() throws Exception {
}

/** Measures the time needed to execute a burst of read requests. */
// Suppressed for initial Error Prone rollout.
@SuppressWarnings("ReturnValueIgnored")
@Benchmark
public void burstRead(final BenchmarkState server) throws Exception {
int totalQueries = server.maxSessions * 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,6 @@ public void emptyStruct() {
assertProtoEquals(t.toProto(), "code: STRUCT struct_type {}");
}

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

// Suppressed for initial Error Prone rollout.
@SuppressWarnings("CheckReturnValue")
@Test
public void structFieldIndexAmbiguous() {
Type t = Type.struct(StructField.of("f1", Type.int64()), StructField.of("f1", Type.string()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ private static void appendProtoTypes(List<Type> types, Dialect dialect) {
}
}

// Suppressed for initial Error Prone rollout.
@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"})
public static ResultSetMetadata generateAllTypesMetadata(Type[] types) {
StructType.Builder rowTypeBuilder = StructType.newBuilder();
for (int col = 0; col < types.length; col++) {
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@
<fork>true</fork>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-Xplugin:ErrorProne -Xep:CheckReturnValue:OFF \
-Xep:ProtoBuilderReturnValueIgnored:OFF -Xep:ReturnValueIgnored:OFF</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
Expand Down

0 comments on commit ff6ab1b

Please sign in to comment.