Back to all rules
What this rule checks
Writes to an array element, e.g. scores[i] = 10 or balls[i] = new Ball() (composed post-Zita from Marker-only rule 7 / ArrayUserModifyRule)
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
float[] xs = {50, 150, 250};

void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  xs[0] = mouseX;
  ellipse(xs[0], 200, 20, 20);
}
FAIL — this code triggers the rule
float[] xs = {50, 150, 250};

void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  ellipse(xs[0], 200, 20, 20);  // elements are read, never assigned
}
Overview
Category Topic Arrays
Level Basic
Type Custom Zita
Priority 1 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Message template No array element is written to.