01: package net.sourceforge.pmd.dfa.report;
02:
03: import net.sourceforge.pmd.IRuleViolation;
04:
05: public class ViolationNode extends AbstractReportNode {
06:
07: private IRuleViolation ruleViolation;
08:
09: public ViolationNode(IRuleViolation violation) {
10: this .ruleViolation = violation;
11: }
12:
13: public IRuleViolation getRuleViolation() {
14: return ruleViolation;
15: }
16:
17: public boolean equalsNode(AbstractReportNode arg0) {
18: if (!(arg0 instanceof ViolationNode)) {
19: return false;
20: }
21:
22: IRuleViolation rv = ((ViolationNode) arg0).getRuleViolation();
23:
24: return rv.getFilename()
25: .equals(getRuleViolation().getFilename())
26: && rv.getBeginLine() == getRuleViolation()
27: .getBeginLine()
28: && rv.getVariableName().equals(
29: getRuleViolation().getVariableName());
30: }
31:
32: }
|