Back to all rules
What this rule checks
Function parameters not reassigned
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void move(int speed) {
  int newX = x + speed;
}
FAIL — this code triggers the rule
void move(int speed) {
  speed = speed * 2; // don't change the parameter
}
Overview
Category Topic Functions
Level Intermediate
Type Built-in PMD
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
PMD reference category/java/bestpractices.xml/AvoidReassigningParameters