Tofpu / SpeedBridge2

Floating point values should not be compared with relational operators in comparison methods JAVA-W1032
Anti-pattern
Minor
a year agoa year old
42
43    @Override
44    public int compareTo(final @NotNull Score o) {
45        if (this.score > o.getScore()) {46            return 1;
47        } else if (this.score == o.getScore()) {
48            return 0;
44    public int compareTo(final @NotNull Score o) {
45        if (this.score > o.getScore()) {
46            return 1;
47        } else if (this.score == o.getScore()) {48            return 0;
49        }
50        return -1;