OPT.AAS
Use abbreviated assignment operators
Description
This rule flags code that should use the abbreviated assignment operator, but does not.
In order to write programs more rapidly, you should use the abbreviated assignment operator because doing so causes some compilers run faster.
Example
package OPT;
public class AAS {
void method () {
int i = 3;
String s = "fu";
i = i - 3; //should use "-="
s = s + "bar"; //should use "+="
}
}
Repair
Use the abbreviated assignment operators.
|