You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myriad.apache.org by "Javi Roman (JIRA)" <ji...@apache.org> on 2019/02/26 17:54:03 UTC
[jira] [Closed] (MYRIAD-198) Remove optionals when sane defaults
are available
[ https://issues.apache.org/jira/browse/MYRIAD-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Javi Roman closed MYRIAD-198.
-----------------------------
> Remove optionals when sane defaults are available
> -------------------------------------------------
>
> Key: MYRIAD-198
> URL: https://issues.apache.org/jira/browse/MYRIAD-198
> Project: Myriad
> Issue Type: Bug
> Components: Executor, Scheduler
> Affects Versions: Myriad 0.2.0
> Reporter: DarinJ
> Assignee: John Yost
> Priority: Minor
> Labels: easyfix, newbie
> Fix For: Myriad 0.3.0
>
>
> Currently we overuse Optionals in the config and then use an or method in various factories later. In many cases having the configuration return a default when the parameter was specified would create cleaner code. For instance:
> {quote}
> Optional<Boolean> getCgroups() {
> Optional.fromNullable(cgroups);
> }
> {quote}
> vs
> {quote}
> Boolean getCgroups() {
> return cgroups != null ? cgroups : false;
> }
> {quote}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)