Permalink
Browse files

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
  • Loading branch information...
1 parent 161602e commit 5c0ac14caffb99457456cd9de82ea25e4318e9cb Felix Meschberger committed Oct 26, 2012
@@ -91,7 +91,12 @@ private void doHandle(HttpServletRequest req, HttpServletResponse res, FilterCha
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()

0 comments on commit 5c0ac14

Please sign in to comment.