Skip to content

Commit

Permalink
factory - fixing int underflow issue when comparing engines or names …
Browse files Browse the repository at this point in the history
…by priority.

This fixes #242
  • Loading branch information
fcamblor committed Aug 22, 2017
1 parent 2c0fbbd commit b4d8650
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions restx-factory/src/main/java/restx/factory/Factory.java
Expand Up @@ -63,11 +63,11 @@ public int compare(ComponentCustomizer o1, ComponentCustomizer o2) {
}
};
private static int compareByPriorityAndName(int p1, Name<?> n1, int p2, Name<?> n2) {
int c = p1 - p2;
if (c == 0) {
int priorityComparison = Integer.compare(p1, p2);
if (priorityComparison == 0) {
return n1.asId().compareTo(n2.asId());
} else {
return c;
return priorityComparison;
}
}
private static final AtomicLong ID = new AtomicLong();
Expand Down

0 comments on commit b4d8650

Please sign in to comment.