org.sonar.l10n.java.rules.squid.RightCurlyBraceSameLineAsNextBlockCheck.html Maven / Gradle / Ivy
The newest version!
Shared coding conventions make it possible for a team to collaborate efficiently.
This rule makes it mandatory to place closing curly braces on the same line as the next else
, catch
or finally
keywords.
The following code snippet illustrates this rule:
public void myMethod() {
if(something) {
executeTask();
} else if (somethingElse) { // Compliant
doSomethingElse();
}
else { // Noncompliant
generateError();
}
try {
generateOrder();
} catch (Exception e) { // Compliant
log(e);
}
finally { // Noncompliant
closeConnection();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy