Skip to content

Commit 9ea8612

Browse files
authored
Merge pull request #37902 from stankiewicz/error_prone_voidUsed
[ErrorProne] remove voidUsed check
2 parents 1ae923e + fae0219 commit 9ea8612

4 files changed

Lines changed: 3 additions & 5 deletions

File tree

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,6 @@ class BeamModulePlugin implements Plugin<Project> {
15801580
"StringCaseLocaleUsage",
15811581
// DoFn methods are executed reflectively at pipeline runtime
15821582
"UnusedMethod",
1583-
// Void is a valid element type of DoFn elements
1584-
"VoidUsed",
15851583
]
15861584
disabledChecks.each {
15871585
options.errorprone.errorproneArgs.add("-Xep:${it}:OFF")

runners/flink/src/test/java/org/apache/beam/runners/flink/streaming/GroupByWithNullValuesTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public void processElement(ProcessContext pc) {
7373
.apply(
7474
ParDo.of(
7575
new DoFn<KV<String, Iterable<Void>>, Integer>() {
76+
@SuppressWarnings("VoidUsed")
7677
@ProcessElement
7778
public void processElement(ProcessContext pc) {
7879
int count = 0;

runners/flink/src/test/java/org/apache/beam/runners/flink/translation/wrappers/streaming/FlinkKeyUtilsTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ public void testEncodeDecode() {
4444

4545
@Test
4646
public void testNullKey() {
47-
Void key = null;
4847
VoidCoder coder = VoidCoder.of();
4948

50-
ByteBuffer byteBuffer = FlinkKeyUtils.encodeKey(key, coder);
49+
ByteBuffer byteBuffer = FlinkKeyUtils.encodeKey(null, coder);
5150
assertThat(FlinkKeyUtils.decodeKey(byteBuffer, coder), is(nullValue()));
5251
}
5352

sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2615,7 +2615,7 @@ public DataSource apply(Void input) {
26152615
return instances.computeIfAbsent(
26162616
config.config,
26172617
ignored -> {
2618-
DataSource basicSource = config.apply(input);
2618+
DataSource basicSource = config.apply(null);
26192619
DataSourceConnectionFactory connectionFactory =
26202620
new DataSourceConnectionFactory(basicSource);
26212621
@SuppressWarnings("nullness") // apache.commons.dbcp2 not annotated

0 commit comments

Comments
 (0)