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 960e563058e18d85806bd77080a91acd1103ce7c Author: Felix Meschberger <[email protected]> AuthorDate: Mon Jan 19 11:34:08 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@735664 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/sling/commons/osgi/OsgiUtil.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 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 e19ff24..697738c 100644 --- a/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java +++ b/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java @@ -128,10 +128,10 @@ public class OsgiUtil { /** * Returns the named service reference property as a single value. If the - * property is neither an array nor a <code>java.util.Vector</code> the + * property is neither an array nor a <code>java.util.Collection</code> the * property is returned unmodified. If the property is a non-empty array, * the first array element is returned. If the property is a non-empty - * <code>java.util.Vector</code>, the first vector element is returned. + * <code>java.util.Collection</code>, the first collection element is returned. * Otherwise <code>null</code> is returned. */ public static Object toObject(Object propValue) { @@ -152,8 +152,8 @@ public class OsgiUtil { * Returns the named service reference property as an array of Strings. If * the property is a scalar value its string value is returned as a single * element array. If the property is an array, the elements are converted to - * String objects and returned as an array. If the property is a vector, the - * vector elements are converted to String objects and returned as an array. + * String objects and returned as an array. If the property is a collection, the + * collection elements are converted to String objects and returned as an array. * Otherwise (if the property does not exist) <code>null</code> is * returned. */ @@ -165,8 +165,8 @@ public class OsgiUtil { * Returns the named service reference property as an array of Strings. If * the property is a scalar value its string value is returned as a single * element array. If the property is an array, the elements are converted to - * String objects and returned as an array. If the property is a vector, the - * vector elements are converted to String objects and returned as an array. + * String objects and returned as an array. If the property is a collection, the + * collection elements are converted to String objects and returned as an array. * Otherwise (if the property does not exist) a provided default value is * returned. * @since 2.0.4 @@ -196,15 +196,15 @@ public class OsgiUtil { return values.toArray(new String[values.size()]); } else if (propValue instanceof Collection) { - // vector - Collection<?> valueVector = (Collection<?>) propValue; - List<String> values = new ArrayList<String>(valueVector.size()); - for (Object value : valueVector) { + // collection + Collection<?> valueCollection = (Collection<?>) propValue; + List<String> valueList = new ArrayList<String>(valueCollection.size()); + for (Object value : valueCollection) { if (value != null) { - values.add(value.toString()); + valueList.add(value.toString()); } } - return values.toArray(new String[values.size()]); + return valueList.toArray(new String[valueList.size()]); } return defaultArray; -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
