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

[jira] [Updated] (RANGER-1377) Improve codestyle, java api usage

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

Zsombor Gegesy updated RANGER-1377:
-----------------------------------
    Fix Version/s: 1.0.0

> Improve codestyle, java api usage
> ---------------------------------
>
>                 Key: RANGER-1377
>                 URL: https://issues.apache.org/jira/browse/RANGER-1377
>             Project: Ranger
>          Issue Type: Improvement
>          Components: Ranger
>    Affects Versions: 0.7.0
>            Reporter: Zsombor Gegesy
>            Assignee: Zsombor Gegesy
>              Labels: code-cleanup
>             Fix For: 1.0.0
>
>
> There are several generally considered best practice writing Java code, it is better to follow them.
> Instead of:
> * var.equals("somestring") use "somestring".equals(var)
> * collection.size() > 0 use !collection.isEmpty()
> * instead of using a for loop to add items to a collection, use 'addAll'
> * str.indexOf("something") >= 0 use str.contains("something")
> * "" + var use String.valueOf(var)
> * stringBuilder.append("a" + b + "c") use stringBuilder.append("a").append(b).append("c")
> * "something "+ a.toString() use "something " + a



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