1 package net.sourceforge.pmd.dfa.report; 2 3 import net.sourceforge.pmd.RuleViolation; 4 5 public class ViolationNode extends AbstractReportNode { 6 7 private RuleViolation ruleViolation; 8 9 public ViolationNode(RuleViolation violation) { 10 this.ruleViolation = violation; 11 } 12 13 public RuleViolation getRuleViolation() { 14 return ruleViolation; 15 } 16 17 public boolean equalsNode(AbstractReportNode arg0) { 18 if (!(arg0 instanceof ViolationNode)) { 19 return false; 20 } 21 22 ViolationNode vn = (ViolationNode) arg0; 23 24 return vn.getRuleViolation().getFilename().equals(this.getRuleViolation().getFilename()) && 25 vn.getRuleViolation().getLine() == this.getRuleViolation().getLine() && 26 vn.getRuleViolation().getVariableName().equals(this.getRuleViolation().getVariableName()); 27 } 28 29 }