Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit c0a48e0

Browse files
shamohGerrit Code Review
authored andcommitted
Merge "Fixed a couple of FindBugs warnings."
2 parents 4f48cf8 + c08b349 commit c0a48e0

File tree

1 file changed

+5
-5
lines changed
  • core-common/src/main/java/org/glassfish/jersey/message/internal

1 file changed

+5
-5
lines changed

core-common/src/main/java/org/glassfish/jersey/message/internal/Quality.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ public final class Quality {
6060

6161
@Override
6262
public int compare(Qualified o1, Qualified o2) {
63-
final int q1 = o1.getQuality();
64-
final int q2 = o2.getQuality();
65-
return -Integer.compare(q1, q2);
63+
// reverse comparison to achieve the "higher first" behavior.
64+
return Integer.compare(o2.getQuality(), o1.getQuality());
6665
}
6766
};
6867

@@ -74,8 +73,9 @@ public int compare(Qualified o1, Qualified o2) {
7473
public static final Comparator<Integer> QUALITY_VALUE_COMPARATOR = new Comparator<Integer>() {
7574

7675
@Override
77-
public int compare(Integer o1, Integer o2) {
78-
return -Integer.compare(o1, o2);
76+
public int compare(Integer q1, Integer q2) {
77+
// reverse comparison to achieve the "higher first" behavior.
78+
return Integer.compare(q2, q1);
7979
}
8080
};
8181

0 commit comments

Comments
 (0)