Skip to content

Commit 939637a

Browse files
committed
Enable null checking for SplittablepairWithRestrictionDoFnRunner
1 parent e7707b7 commit 939637a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sdks/java/harness/src/main/java/org/apache/beam/fn/harness/SplittablePairWithRestrictionDoFnRunner.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@
5858
* WindowedValue<InputT>} to {@code WindowedValue<KV<InputT, KV<RestrictionT,
5959
* WatermarkEstimatorStateT>>>}
6060
*/
61-
@SuppressWarnings({
62-
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
63-
})
6461
public class SplittablePairWithRestrictionDoFnRunner<
6562
InputT, RestrictionT, WatermarkEstimatorStateT, OutputT>
6663
implements FnApiStateAccessor.MutatingStateContext<Object, BoundedWindow> {
@@ -309,7 +306,11 @@ public BoundedWindow window() {
309306

310307
@Override
311308
public Object sideInput(String tagId) {
312-
return stateAccessor.get(sideInputMapping.get(tagId), getCurrentWindowOrFail());
309+
PCollectionView<Object> pCollectionView =
310+
(PCollectionView<Object>)
311+
checkStateNotNull(sideInputMapping.get(tagId), "Side input tag not found: %s", tagId);
312+
313+
return stateAccessor.get(pCollectionView, getCurrentWindow());
313314
}
314315
}
315316

0 commit comments

Comments
 (0)