Back to all rules
What this rule checks
Uses a bitwise operator (&, |, ^, <<, >>, >>>)
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void setup() {
  size(400, 400);
}

void draw() {
  color c = get(mouseX, mouseY);
  float r = red(c);  // red() reads the red channel
  background(r, 0, 0);
}
FAIL — this code triggers the rule
void setup() {
  size(400, 400);
}

void draw() {
  color c = get(mouseX, mouseY);
  int r = (c >> 16) & 0xFF;  // bit shifting and masking
  background(r, 0, 0);
}
Overview
Category Out of Scope
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasBitwiseOperatorRule
Message template Bitwise operator used.