You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Pei He (JIRA)" <ji...@apache.org> on 2016/10/20 23:59:59 UTC
[jira] [Created] (BEAM-790) Validate PipelineOptions Default
annotation
Pei He created BEAM-790:
---------------------------
Summary: Validate PipelineOptions Default annotation
Key: BEAM-790
URL: https://issues.apache.org/jira/browse/BEAM-790
Project: Beam
Issue Type: Improvement
Components: sdk-java-core
Reporter: Pei He
Assignee: Pei He
It shouldn't allow @Override with @Default annotation, for example the following is broken:
interface A {
@Default.Integer(1)
Integer getFoo();
void setFoo();
}
interface B extends A {
@Default.Integer(-1)
@Override
Integer getFoo();
}
It is broken, because PipelineOptions default values are lazily evaluated. And, it will depends on which one of the two following operations happen first:
options.as(A.class) and options.as(B.class)
If users want to change the default value, users should do setFoo(...) explicitly.
It shouldn't allow adding Default annotation as well.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)