ER-017-E Do not assign new value to a parameter. For comprehensibility, formal parameters should be final

Severity2
Enabledyes
Waivable
Violation
private int incInt(int intToInc) {
	// ... some calculations ...
    intToInc+=INC_VAL;		
	// ... some calculations ...
	return intToInc;
}
Fix
private int incInt(final int intToInc) {
	// ... some calculations ...
	return intToInc + INC_VAL;
}


Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.