Sharing some coding conventions is a key point to make it possible for a team to efficiently collaborate.
This rule make it mandatory to place closing curly braces and next else
, catch
or finally
keywords on two different lines.
The following code snippet illustrates this rule:
public void myMethod() { if(something) { executeTask(); } else if (somethingElse) { // Non-Compliant doSomethingElse(); } else { // Compliant generateError(); } try { generateOrder(); } catch (Exception e) { // Non-Compliant log(e); } finally { // Compliant closeConnection(); } }