[ 
https://issues.apache.org/jira/browse/FLINK-13812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Zagrebin updated FLINK-13812:
------------------------------------
    Description: 
* Use @Nullable annotation where you do not use Optional for the nullable values
 * If you can prove that Optional usage would lead to a performance degradation 
in critical code then fallback to @Nullable
 * Always use Optional to return nullable values in the API/public methods 
except the case of a proven performance concern
 * Do not use Optional as a function argument, instead either overload the 
method or use the Builder pattern for the set of function arguments
 * Note: an Optional argument can be allowed in a *private* helper method if 
you believe that it simplifies the code, example is in [1]


 * Do not use Optional for class fields

> Code style for the usage of Java Optional
> -----------------------------------------
>
>                 Key: FLINK-13812
>                 URL: https://issues.apache.org/jira/browse/FLINK-13812
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Documentation, Project Website
>            Reporter: Andrey Zagrebin
>            Assignee: Andrey Zagrebin
>            Priority: Major
>              Labels: codestyle, pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> * Use @Nullable annotation where you do not use Optional for the nullable 
> values
>  * If you can prove that Optional usage would lead to a performance 
> degradation in critical code then fallback to @Nullable
>  * Always use Optional to return nullable values in the API/public methods 
> except the case of a proven performance concern
>  * Do not use Optional as a function argument, instead either overload the 
> method or use the Builder pattern for the set of function arguments
>  * Note: an Optional argument can be allowed in a *private* helper method if 
> you believe that it simplifies the code, example is in [1]
>  * Do not use Optional for class fields



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to