commit | 5c0ac14caffb99457456cd9de82ea25e4318e9cb | [log] [tgz] |
---|---|---|
author | Felix Meschberger <fmeschbe@apache.org> | Fri Oct 26 13:10:53 2012 +0000 |
committer | Felix Meschberger <fmeschbe@apache.org> | Fri Oct 26 13:10:53 2012 +0000 |
tree | 105e18293042a1aa457e62b17e6ebc585bb48469 | |
parent | 161602e6aac62cd98c2e927c93965f3c650be05d [diff] |
FELIX-3737 Prevent overflow if this ranking is Integer.MAX_VALUE and other.ranking is negative git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1402499 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java index 33bee18..f28bc31 100644 --- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java +++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
@@ -91,7 +91,12 @@ public int compareTo(FilterHandler other) { - return other.ranking - this.ranking; + if (other.ranking == this.ranking) + { + return 0; + } + + return (other.ranking > this.ranking) ? 1 : -1; } public int getRanking()