jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1663110 - /jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
Date Sun, 01 Mar 2015 14:11:29 GMT
Author: pmouawad
Date: Sun Mar  1 14:11:29 2015
New Revision: 1663110

URL: http://svn.apache.org/r1663110
Log:
Avoid useless boxing

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1663110&r1=1663109&r2=1663110&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Sun Mar  1 14:11:29 2015
@@ -797,8 +797,7 @@ public class JMeterUtils implements Unit
     public static int getPropDefault(String propName, int defaultVal) {
         int ans;
         try {
-            ans = (Integer.valueOf(appProperties.getProperty(propName, Integer.toString(defaultVal)).trim()))
-                    .intValue();
+            ans = Integer.parseInt(appProperties.getProperty(propName, Integer.toString(defaultVal)).trim());
         } catch (Exception e) {
             log.warn("Unexpected value set for int property:'"+propName+"', defaulting to:"+defaultVal);
             ans = defaultVal;
@@ -824,7 +823,7 @@ public class JMeterUtils implements Unit
             } else if (strVal.equalsIgnoreCase("false") || strVal.equalsIgnoreCase("f"))
{ // $NON-NLS-1$  // $NON-NLS-2$
                 ans = false;
             } else {
-                ans = ((Integer.valueOf(strVal)).intValue() == 1);
+                ans = Integer.parseInt(strVal) == 1;
             }
         } catch (Exception e) {
             log.warn("Unexpected value set for boolean property:'"+propName+"', defaulting
to:"+defaultVal);
@@ -845,7 +844,7 @@ public class JMeterUtils implements Unit
     public static long getPropDefault(String propName, long defaultVal) {
         long ans;
         try {
-            ans = (Long.valueOf(appProperties.getProperty(propName, Long.toString(defaultVal)).trim())).longValue();
+            ans = Long.parseLong(appProperties.getProperty(propName, Long.toString(defaultVal)).trim());
         } catch (Exception e) {
             log.warn("Unexpected value set for long property:'"+propName+"', defaulting to:"+defaultVal);
             ans = defaultVal;



Mime
View raw message