felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1402499 - /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
Date Fri, 26 Oct 2012 13:10:54 GMT
Author: fmeschbe
Date: Fri Oct 26 13:10:53 2012
New Revision: 1402499

URL: http://svn.apache.org/viewvc?rev=1402499&view=rev
Log:
FELIX-3737 Prevent overflow if this ranking is Integer.MAX_VALUE and other.ranking is negative

Modified:
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java?rev=1402499&r1=1402498&r2=1402499&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
Fri Oct 26 13:10:53 2012
@@ -91,7 +91,12 @@ public final class FilterHandler
 
     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()



Mime
View raw message