CODSTA.CRS
Place constants on the right side of comparisons
Description
This rule flags code that does not place constants on the right side of comparisons.
Example
package CODSTA;
public class CRS {
public void testMethod (int something) {
if (5 == something) {} // violation.
}
}
Repair
Place constants in right side of comparisons.
public void testMethod (int something) {
if (something == 5) {}
}
|