Author: fmeschbe
Date: Mon Apr  6 11:09:36 2009
New Revision: 762277

URL: http://svn.apache.org/viewvc?rev=762277&view=rev
Log:
Deprecate getProperty(Object, double) and add toDouble(Object, double) to align
with the rest of the toTYPE methods taking the object and the default value.

Modified:
    
incubator/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java

Modified: 
incubator/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java?rev=762277&r1=762276&r2=762277&view=diff
==============================================================================
--- 
incubator/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
 (original)
+++ 
incubator/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
 Mon Apr  6 11:09:36 2009
@@ -110,8 +110,22 @@
      * <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 toDouble instead
      */
     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) {
         propValue = toObject(propValue);
         if (propValue instanceof Double) {
             return (Double) propValue;


Reply via email to