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

Colm O hEigeartaigh updated RANGER-1371:
----------------------------------------
    Fix Version/s: 1.0.0

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

Reply via email to