Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.7.0
-
Patch
Description
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