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