PipelineOptions getters can produce null even if not annotated Nullable when no Default is specified
Context: BEAM-13537, https://github.com/apache/beam/pull/16625#discussion_r793021931
PipelineOptions getters without Default specified can produce null, but because it happens in generated code, the null checker will not complain about it. Is there some way we can make sure getters without a Default are always Nullable?
Imported from Jira BEAM-13758. Original Jira may contain additional context. Reported by: bhulette.
.take-issue
There seems to be no simple way to ensure that getters without the @Default annotation wouldn't produce null.
From my understanding, the best way to approach this issue would be to manually add either @Required or @Nullable annotations to unannotated getters in existing PipelineOptions implementations to warn potential users or raise exceptions during validation. Annotating getters in custom PipelineOptions implementations would be the responsibility of users.
.take-issue