You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2009/09/25 17:19:57 UTC
svn commit: r818879 -
/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
Author: cziegeler
Date: Fri Sep 25 15:19:57 2009
New Revision: 818879
URL: http://svn.apache.org/viewvc?rev=818879&view=rev
Log:
Use generics.
Modified:
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java?rev=818879&r1=818878&r2=818879&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java Fri Sep 25 15:19:57 2009
@@ -110,20 +110,20 @@
* <code>defaultValue</code> if no such reference property exists or if
* the property is not an <code>Double</code> and cannot be converted to
* an <code>Double</code> from the property's string value.
- *
+ *
* @deprecated since 2.0.4, use {@link #toDouble(Object, double)} instead
*/
@Deprecated
public static double getProperty(Object propValue, double defaultValue) {
return toDouble(propValue, defaultValue);
}
-
+
/**
* Returns the named service reference property as a double or the
* <code>defaultValue</code> if no such reference property exists or if
* the property is not an <code>Double</code> and cannot be converted to
* an <code>Double</code> from the property's string value.
- *
+ *
* @since 2.0.4
*/
public static double toDouble(Object propValue, double defaultValue) {
@@ -155,7 +155,7 @@
} else if (propValue.getClass().isArray()) {
Object[] prop = (Object[]) propValue;
return prop.length > 0 ? prop[0] : null;
- } else if (propValue instanceof Collection) {
+ } else if (propValue instanceof Collection<?>) {
Collection<?> prop = (Collection<?>) propValue;
return prop.isEmpty() ? null : prop.iterator().next();
} else {
@@ -210,7 +210,7 @@
}
return values.toArray(new String[values.size()]);
- } else if (propValue instanceof Collection) {
+ } else if (propValue instanceof Collection<?>) {
// collection
Collection<?> valueCollection = (Collection<?>) propValue;
List<String> valueList = new ArrayList<String>(valueCollection.size());