Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2016-01-05 20:43:40 +0000
committerThomas Watson2016-01-05 20:47:27 +0000
commitdf2a054cc06a51e28c328c560193efb2cab6e559 (patch)
tree15043e25b1cc8a0798e3fe54aefacc95af8f5ad5 /bundles/org.eclipse.equinox.http.servlet
parenta64641e4a1336330520ff90096503a4a55ab9cf9 (diff)
downloadrt.equinox.bundles-df2a054cc06a51e28c328c560193efb2cab6e559.tar.gz
rt.equinox.bundles-df2a054cc06a51e28c328c560193efb2cab6e559.tar.xz
rt.equinox.bundles-df2a054cc06a51e28c328c560193efb2cab6e559.zip
Bug 485234 - [http whiteboard] FilterRegistration objects are not
cleaned up properly when unregistered Change-Id: I45139c151a34a254e9347d1ac430026a60158018 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.http.servlet')
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java
index 70f12ee7..27975ca8 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/FilterRegistration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -77,8 +77,11 @@ public class FilterRegistration
if (priorityDifference != 0)
return -priorityDifference;
- return (Math.abs(getD().serviceId) >
- Math.abs(otherFilterRegistration.getD().serviceId)) ? 1 : -1;
+ // Note that we use abs here because the DTO service ID may have been negated for legacy filters.
+ // We always compare with the positive id values and we know the positive values are unique.
+ long thisId = Math.abs(getD().serviceId);
+ long otherId = Math.abs(otherFilterRegistration.getD().serviceId);
+ return (thisId < otherId) ? -1 : ((thisId == otherId) ? 0 : 1);
}
public void destroy() {

Back to the top