You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Andrey Zagrebin (Jira)" <ji...@apache.org> on 2019/08/28 10:06:00 UTC
[jira] [Closed] (FLINK-13812) Code style for the usage of Java
Optional
[ https://issues.apache.org/jira/browse/FLINK-13812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrey Zagrebin closed FLINK-13812.
-----------------------------------
Resolution: Done
> 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: 20m
> 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|#L95]])
> * Do not use Optional for class fields
--
This message was sent by Atlassian Jira
(v8.3.2#803003)