You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2017/02/10 14:17:41 UTC

[jira] [Resolved] (RANGER-1371) No need to write field initializers for default values, and types where the diamond operator could suffice

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

Colm O hEigeartaigh resolved RANGER-1371.
-----------------------------------------
    Resolution: Fixed

> No need to write field initializers for default values, and types where the diamond operator could suffice
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: RANGER-1371
>                 URL: https://issues.apache.org/jira/browse/RANGER-1371
>             Project: Ranger
>          Issue Type: Improvement
>          Components: Ranger
>            Reporter: Zsombor Gegesy
>            Assignee: Zsombor Gegesy
>              Labels: code-cleanup
>             Fix For: 1.0.0
>
>         Attachments: 0001-RANGER-1371-Remove-unneded-field-initializers-and-un.patch
>
>
> Lot's of places the fields are initialized to their default values, which is unnecessary verbose:
> {code}
> long value = 0L;
> String str = null;
> {code}
> which is equivalent with:
> {code}
> long value;
> String str;
> {code}
> And similarly the type specification can be omitted, as the compiler can calculate it automatically, so instead of 
> {code}
> List<RangerPolicyConditionDef> conditions = new ArrayList<RangerServiceDef.RangerPolicyConditionDef>();
> {code}
> it is suffice to write:
> {code}
> List<RangerPolicyConditionDef> conditions = new ArrayList<>();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)