This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.commons.osgi-2.0.4-incubator in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-osgi.git
commit 362853f8deddb925e6f7c0832cecd73798274b88 Author: Felix Meschberger <[email protected]> AuthorDate: Mon Jan 19 10:57:03 2009 +0000 SLING-833 Accept Collection values and do not require Vector values git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/commons/osgi@735656 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java b/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java index e5e6b86..e19ff24 100644 --- a/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java +++ b/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java @@ -19,11 +19,11 @@ package org.apache.sling.commons.osgi; import java.util.ArrayList; +import java.util.Collection; import java.util.Dictionary; import java.util.Hashtable; import java.util.List; import java.util.Map; -import java.util.Vector; import org.osgi.framework.Bundle; import org.osgi.framework.ServiceReference; @@ -140,9 +140,9 @@ public class OsgiUtil { } else if (propValue.getClass().isArray()) { Object[] prop = (Object[]) propValue; return prop.length > 0 ? prop[0] : null; - } else if (propValue instanceof Vector) { - Vector<?> prop = (Vector<?>) propValue; - return prop.isEmpty() ? null : prop.get(0); + } else if (propValue instanceof Collection) { + Collection<?> prop = (Collection<?>) propValue; + return prop.isEmpty() ? null : prop.iterator().next(); } else { return propValue; } @@ -195,9 +195,9 @@ public class OsgiUtil { } return values.toArray(new String[values.size()]); - } else if (propValue instanceof Vector) { + } else if (propValue instanceof Collection) { // vector - Vector<?> valueVector = (Vector<?>) propValue; + Collection<?> valueVector = (Collection<?>) propValue; List<String> values = new ArrayList<String>(valueVector.size()); for (Object value : valueVector) { if (value != null) { -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
