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

hazendaz / displaytag / 1753

12 Feb 2026 03:17AM UTC coverage: 77.321% (-0.01%) from 77.334%
1753

push

github

web-flow
Merge pull request #1102 from hazendaz/renovate/javax-support-logback-monorepo

Update dependency ch.qos.logback:logback-classic to v1.5.29 (javax-support)

1438 of 2003 branches covered (71.79%)

Branch coverage included in aggregate %.

4034 of 5074 relevant lines covered (79.5%)

0.8 hits per line

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

50.0
/displaytag/src/main/java/org/displaytag/test/NumberComparator.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2002-2026 Fabrizio Giustina, the Displaytag team
6
 */
7
package org.displaytag.test;
8

9
import java.util.Comparator;
10

11
import org.apache.commons.beanutils2.ConvertUtils;
12

13
/**
14
 * Sorts 2 numbers, converted from objects using beanutils Converters.
15
 */
16
public class NumberComparator implements Comparator<Object> {
1✔
17

18
    /**
19
     * Compare.
20
     *
21
     * @param obj1
22
     *            the obj 1
23
     * @param obj2
24
     *            the obj 2
25
     *
26
     * @return the int
27
     *
28
     * @see Comparator#compare(Object, Object)
29
     */
30
    @Override
31
    public int compare(final Object obj1, final Object obj2) {
32
        double dbl1 = 0;
1✔
33
        if (obj1 instanceof Number) {
1!
34
            dbl1 = ((Number) obj1).doubleValue();
1✔
35
        } else if (obj1 != null) {
×
36
            dbl1 = ((Number) ConvertUtils.convert(obj1.toString(), Number.class)).doubleValue();
×
37
        }
38

39
        double dbl2 = 0;
1✔
40
        if (obj2 instanceof Number) {
1!
41
            dbl2 = ((Number) obj2).doubleValue();
1✔
42
        } else if (obj1 != null) {
×
43
            dbl2 = ((Number) ConvertUtils.convert(obj2.toString(), Number.class)).doubleValue();
×
44
        }
45

46
        return Double.valueOf(dbl1).compareTo(Double.valueOf(dbl2));
1✔
47
    }
48
}
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