• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pmd / pmd / 380

29 Jan 2026 03:55PM UTC coverage: 78.964%. Remained the same
380

push

github

adangel
[doc] ADR 3: Clarify javadoc tags (#6392)

18537 of 24358 branches covered (76.1%)

Branch coverage included in aggregate %.

40391 of 50268 relevant lines covered (80.35%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/pmd-core/src/main/java/net/sourceforge/pmd/reporting/ParametricRuleViolation.java
1
/*
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5
package net.sourceforge.pmd.reporting;
6

7
import java.util.Collections;
8
import java.util.Map;
9

10
import net.sourceforge.pmd.lang.document.FileLocation;
11
import net.sourceforge.pmd.lang.rule.Rule;
12
import net.sourceforge.pmd.util.AssertionUtil;
13

14
/**
15
 * @internalApi None of this is published API, and compatibility can be broken anytime! Use this only at your own risk.
16
 * Clients should exclusively use {@link RuleViolation}.
17
 */
18
class ParametricRuleViolation implements RuleViolation {
19
    protected final Rule rule;
20
    protected final String description;
21

22
    private final FileLocation location;
23

24
    private final Map<String, String> additionalInfo;
25

26
    ParametricRuleViolation(Rule theRule, Reportable node, String message) {
27
        this(theRule, node.getReportLocation(), message, Collections.emptyMap());
1✔
28
    }
1✔
29

30
    ParametricRuleViolation(Rule theRule, FileLocation location, String message, Map<String, String> additionalInfo) {
1✔
31
        this.rule = AssertionUtil.requireParamNotNull("rule", theRule);
1✔
32
        this.description = AssertionUtil.requireParamNotNull("message", message);
1✔
33
        this.location = location;
1✔
34

35
        if (!additionalInfo.isEmpty()) {
1✔
36
            this.additionalInfo = Collections.unmodifiableMap(additionalInfo);
1✔
37
        } else {
38
            this.additionalInfo = Collections.emptyMap();
1✔
39
        }
40
    }
1✔
41

42
    @Override
43
    public Map<String, String> getAdditionalInfo() {
44
        return additionalInfo;
1✔
45
    }
46

47
    @Override
48
    public Rule getRule() {
49
        return rule;
1✔
50
    }
51

52
    @Override
53
    public String getDescription() {
54
        return description;
1✔
55
    }
56

57
    @Override
58
    public FileLocation getLocation() {
59
        return location;
1✔
60
    }
61

62
    @Override
63
    public String toString() {
64
        return getLocation().startPosToStringWithFile() + ':' + getRule() + ':' + getDescription();
×
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc