[ 
https://issues.apache.org/jira/browse/BEAM-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15596729#comment-15596729
 ] 

ASF GitHub Bot commented on BEAM-790:
-------------------------------------

GitHub user peihe opened a pull request:

    https://github.com/apache/incubator-beam/pull/1159

    [BEAM-790] Validate PipelineOptions Default annotation.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/peihe/incubator-beam validate-default-2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-beam/pull/1159.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1159
    
----
commit 0e3d98128759148e789176c2f953b26878099014
Author: Pei He <[email protected]>
Date:   2016-10-21T01:07:35Z

    [BEAM-790] Validate PipelineOptions Default annotation.

----


> 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)

Reply via email to