logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501495 - /logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
Date Tue, 09 Jul 2013 19:46:58 GMT
Author: ggregory
Date: Tue Jul  9 19:46:57 2013
New Revision: 1501495

URL: http://svn.apache.org/r1501495
Log:
Simplify with Integers.parseInt().

Modified:
    logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java?rev=1501495&r1=1501494&r2=1501495&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
(original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
Tue Jul  9 19:46:57 2013
@@ -29,6 +29,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 import org.apache.logging.log4j.core.helpers.Booleans;
+import org.apache.logging.log4j.core.helpers.Integers;
 import org.apache.logging.log4j.core.layout.RFC5424Layout;
 
 /**
@@ -207,11 +208,11 @@ public final class FlumeAppender<T exten
            managerType = ManagerType.AVRO;
         }
 
-        final int batchCount = batchSize == null ? 1 : Integer.parseInt(batchSize);
-        final int connectTimeout = connectionTimeout == null ? 0 : Integer.parseInt(connectionTimeout);
-        final int reqTimeout = requestTimeout == null ? 0 : Integer.parseInt(requestTimeout);
-        final int retries = agentRetries == null ? 0 : Integer.parseInt(agentRetries);
-        final int delay = maxDelay == null ? DEFAULT_MAX_DELAY : Integer.parseInt(maxDelay);
+        final int batchCount = Integers.parseInt(batchSize, 1);
+        final int connectTimeout = Integers.parseInt(connectionTimeout, 0);
+        final int reqTimeout = Integers.parseInt(requestTimeout, 0);
+        final int retries = Integers.parseInt(agentRetries, 0);
+        final int delay = Integers.parseInt(maxDelay, DEFAULT_MAX_DELAY );
 
         if (layout == null) {
             @SuppressWarnings({ "unchecked", "UnnecessaryLocalVariable" })



Mime
View raw message