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 |
3233
| public ViolationNode(RuleViolation violation) {
|
10 |
3233
| this.ruleViolation = violation;
|
11 |
| } |
12 |
| |
13 |
293298
| public RuleViolation getRuleViolation() {
|
14 |
293298
| return ruleViolation;
|
15 |
| } |
16 |
| |
17 |
73324
| public boolean equalsNode(AbstractReportNode arg0) {
|
18 |
73324
| if (!(arg0 instanceof ViolationNode)) {
|
19 |
0
| return false;
|
20 |
| } |
21 |
| |
22 |
73324
| ViolationNode vn = (ViolationNode) arg0;
|
23 |
| |
24 |
73324
| 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 |
| } |