rspec/rules/S117/java/rule.adoc
Alban Auzeill 2c306d110e Fix code block ambiguity with old header style
Ensure blank line before list and clean the one leading space
2020-06-30 17:16:12 +02:00

40 lines
585 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
With the default regular expression <code>^[a-z][a-zA-Z0-9]*$</code>:
----
public void doSomething(int my_param) {
int LOCAL;
...
}
----
== Compliant Solution
----
public void doSomething(int myParam) {
int local;
...
}
----
== Exceptions
Loop counters are ignored by this rule.
----
for (int i_1 = 0; i_1 < limit; i_1++) { // Compliant
// ...
}
----
as well as one-character <code>catch</code> variables:
----
try {
//...
} catch (Exception e) { // Compliant
}
----