Permalink
Browse files

factory - fixing int underflow issue when comparing engines or names …

…by priority.

This fixes #242
  • Loading branch information...
fcamblor committed Aug 22, 2017
1 parent 2c0fbbd commit b4d8650bab56377e8414d941f2f7f3cb036dd6ab
Showing with 3 additions and 3 deletions.
  1. +3 −3 restx-factory/src/main/java/restx/factory/Factory.java
@@ -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();

0 comments on commit b4d8650

Please sign in to comment.