Skip to content

Commit

Permalink
FELIX-3737 Prevent overflow if this ranking is Integer.MAX_VALUE and …
Browse files Browse the repository at this point in the history
…other.ranking is negative

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1402499 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Felix Meschberger committed Oct 26, 2012
1 parent 161602e commit 5c0ac14
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -91,7 +91,12 @@ private void doHandle(HttpServletRequest req, HttpServletResponse res, FilterCha


public int compareTo(FilterHandler other) 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() public int getRanking()
Expand Down

0 comments on commit 5c0ac14

Please sign in to comment.