diff options
author | BJ Hargrave | 2006-11-28 16:15:14 +0000 |
---|---|---|
committer | BJ Hargrave | 2006-11-28 16:15:14 +0000 |
commit | 4ad29182cf4ade92bc803786b813e922adc13f1b (patch) | |
tree | 8c7f52a3b84195954725762d1144ec1869047764 /bundles | |
parent | 91285f4f4f1d4b60281d39b8a1e2811bd3b3f0f0 (diff) | |
download | rt.equinox.framework-4ad29182cf4ade92bc803786b813e922adc13f1b.tar.gz rt.equinox.framework-4ad29182cf4ade92bc803786b813e922adc13f1b.tar.xz rt.equinox.framework-4ad29182cf4ade92bc803786b813e922adc13f1b.zip |
In OSGi bug 391, the use of Vector in filter expressions was replaced by the more general Collection
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilterImpl.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilterImpl.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilterImpl.java index 286665644..2e4f5e06c 100644 --- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilterImpl.java +++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/FilterImpl.java @@ -16,8 +16,9 @@ import java.lang.reflect.InvocationTargetException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; +import java.util.Collection; import java.util.Dictionary; -import java.util.Vector; +import java.util.Iterator; import org.eclipse.osgi.framework.debug.Debug; import org.eclipse.osgi.framework.util.Headers; @@ -534,8 +535,8 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{ } } - if (value1 instanceof Vector) { - return compare_Vector(operation, (Vector) value1, value2); + if (value1 instanceof Collection) { + return compare_Collection(operation, (Collection) value1, value2); } if (value1 instanceof Integer) { @@ -577,11 +578,11 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{ return compare_Unknown(operation, value1, value2); // RFC 59 } - protected boolean compare_Vector(int operation, Vector vector, Object value2) { - int size = vector.size(); + protected boolean compare_Collection(int operation, Collection collection, Object value2) { + Iterator iterator = collection.iterator(); - for (int i = 0; i < size; i++) { - if (compare(operation, vector.elementAt(i), value2)) { + while (iterator.hasNext()) { + if (compare(operation, iterator.next(), value2)) { return true; } } |