You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/01/11 20:20:02 UTC
[GitHub] [beam] kennknowles commented on a change in pull request #13719: [BEAM-10402] Trigger#subTriggers might return null
kennknowles commented on a change in pull request #13719:
URL: https://github.com/apache/beam/pull/13719#discussion_r555313479
##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Trigger.java
##########
@@ -87,7 +88,7 @@ protected Trigger() {
}
public List<Trigger> subTriggers() {
- return subTriggers;
+ return MoreObjects.firstNonNull(subTriggers, Collections.emptyList());
Review comment:
I think also we could enable nullness checking on the subclasses and discover that the field should never be null. Anyhow this fix makes the API null-safe so looks good even though I think it can go further.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org