All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.RightCurlyBraceDifferentLineAsNextBlockCheck.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 a closing curly brace and the next else, catch or finally keyword 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();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy