01: package net.sourceforge.pmd.dfa;
02:
03: import net.sourceforge.pmd.Rule;
04: import net.sourceforge.pmd.RuleContext;
05: import net.sourceforge.pmd.RuleViolation;
06: import net.sourceforge.pmd.ast.SimpleNode;
07:
08: /**
09: * The RuleViolation is extended by the VariableName. The VariableName
10: * is required for showing what variable produces the UR DD or DU anomaly.
11: *
12: * @author Sven Jacob
13: *
14: */
15: public class DaaRuleViolation extends RuleViolation {
16: private String variableName;
17: private int beginLine;
18: private int endLine;
19: private String type;
20:
21: public DaaRuleViolation(Rule rule, RuleContext ctx,
22: SimpleNode node, String type, String msg, String var,
23: int beginLine, int endLine) {
24: super (rule, ctx, node, msg);
25: this .variableName = var;
26: this .beginLine = beginLine;
27: this .endLine = endLine;
28: this .type = type;
29: }
30:
31: public String getVariableName() {
32: return variableName;
33: }
34:
35: public int getBeginLine() {
36: return beginLine;
37: }
38:
39: public int getEndLine() {
40: return endLine;
41: }
42:
43: public String getType() {
44: return type;
45: }
46: }
|