[
https://issues.apache.org/jira/browse/RANGER-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875711#comment-15875711
]
Colm O hEigeartaigh commented on RANGER-1377:
---------------------------------------------
Could you break up the security admin patch a bit, it's hard to review such a
massive patch. For example:
a) var.equals("somestring") use "somestring".equals(var)
b) collection.size() > 0 use !collection.isEmpty()
c) Everything else.
> 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
>
> Attachments:
> 0001-RANGER-1377-code-cleanup-in-agents-common-module.patch,
> 0001-RANGER-1377-code-cleanup-in-security-admin-module.patch
>
>
> 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)