You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:25:21 UTC

[sling-org-apache-sling-commons-osgi] 07/11: SLING-4553 - Avoid unneeded unboxing in PropertiesUtil

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.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-osgi.git

commit 08f3dd46b8b6ba0f2b55969cda079f992b472d4e
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Mar 30 09:12:20 2015 +0000

    SLING-4553 - Avoid unneeded unboxing in PropertiesUtil
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/osgi@1670019 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java b/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
index 5335ef5..9f73d96 100644
--- a/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
+++ b/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
@@ -46,7 +46,7 @@ public class PropertiesUtil {
         if (propValue instanceof Boolean) {
             return (Boolean) propValue;
         } else if (propValue != null) {
-            return Boolean.valueOf(String.valueOf(propValue));
+            return Boolean.parseBoolean(String.valueOf(propValue));
         }
 
         return defaultValue;
@@ -77,7 +77,7 @@ public class PropertiesUtil {
             return (Long) propValue;
         } else if (propValue != null) {
             try {
-                return Long.valueOf(String.valueOf(propValue));
+                return Long.parseLong(String.valueOf(propValue));
             } catch (NumberFormatException nfe) {
                 // don't care, fall through to default value
             }
@@ -100,7 +100,7 @@ public class PropertiesUtil {
             return (Integer) propValue;
         } else if (propValue != null) {
             try {
-                return Integer.valueOf(String.valueOf(propValue));
+                return Integer.parseInt(String.valueOf(propValue));
             } catch (NumberFormatException nfe) {
                 // don't care, fall through to default value
             }
@@ -123,7 +123,7 @@ public class PropertiesUtil {
             return (Double) propValue;
         } else if (propValue != null) {
             try {
-                return Double.valueOf(String.valueOf(propValue));
+                return Double.parseDouble(String.valueOf(propValue));
             } catch (NumberFormatException nfe) {
                 // don't care, fall through to default value
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.