Back to all rules
What this rule checks
A method is called with at least one argument on an object of a user-defined class (e.g. ball.moveBy(10))
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
class Ball {
  int x, y;
  Ball(int x0, int y0){ x=x0; y=y0; }
  void moveBy(int dx){ x = x + dx; }
}
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  Ball b = new Ball(10,20);
  b.moveBy(10);
}
FAIL — this code triggers the rule
class Ball {
  int x, y;
  Ball(int x0, int y0){ x=x0; y=y0; }
  void move(){ x = x + 1; }
}
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  Ball b = new Ball(10,20);
  b.move();
}
Overview
Category Topic Classes
Level Advanced
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasObjectMethodCallWithArgRule
Message template No method is called with an argument on an object of a user-defined class.