logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1516489 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java
Date Thu, 22 Aug 2013 15:39:25 GMT
Author: ggregory
Date: Thu Aug 22 15:39:25 2013
New Revision: 1516489

URL: http://svn.apache.org/r1516489
Log:
Avoid boxing and unboxing by using the right conversion API.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java?rev=1516489&r1=1516488&r2=1516489&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java
Thu Aug 22 15:39:25 2013
@@ -134,7 +134,7 @@ public final class OptionConverter {
         if (value != null) {
             final String s = value.trim();
             try {
-                return Integer.valueOf(s);
+                return Integer.parseInt(s);
             } catch (final NumberFormatException e) {
                 LOGGER.error("[" + s + "] is not in proper int form.");
                 e.printStackTrace();
@@ -170,7 +170,7 @@ public final class OptionConverter {
         }
         if (str != null) {
             try {
-                return Long.valueOf(str) * multiplier;
+                return Long.parseLong(str) * multiplier;
             } catch (final NumberFormatException e) {
                 LOGGER.error("[" + str + "] is not in proper int form.");
                 LOGGER.error("[" + value + "] not in expected format.", e);



Mime
View raw message