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

pmd / pmd / 43

20 Jun 2025 06:39PM UTC coverage: 78.375% (-0.002%) from 78.377%
43

push

github

adangel
Fix #1639 #5832: Use filtered comment text for UnnecessaryImport (#5833)

Merged pull request #5833 from adangel:java/issue-5832-unnecessaryimport

17714 of 23438 branches covered (75.58%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

109 existing lines in 17 files now uncovered.

38908 of 48807 relevant lines covered (79.72%)

0.81 hits per line

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

7.14
/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/PmdDocumentSorter.java
1
/*
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5

6
package net.sourceforge.pmd.lang.rule.xpath.internal;
7

8
import java.util.Comparator;
9

10
import net.sourceforge.pmd.lang.ast.Node;
11

12
/**
13
 * Sorts nodes by document order.
14
 */
15
// renamed because it conflicts with a Saxon node
16
final class PmdDocumentSorter implements Comparator<Node> {
17

18
    public static final PmdDocumentSorter INSTANCE = new PmdDocumentSorter();
1✔
19

20
    private PmdDocumentSorter() {
21

22
    }
23

24
    @Override
25
    public int compare(Node node1, Node node2) {
UNCOV
26
        if (node1 == node2) {
×
27
            return 0;
×
28
        } else if (node1 == null) {
×
29
            return -1;
×
30
        } else if (node2 == null) {
×
31
            return 1;
×
32
        }
33

UNCOV
34
        return node1.compareLocation(node2);
×
35
    }
36
}
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