Author: mattsicker
Date: Thu Aug 28 04:28:25 2014
New Revision: 1621034

URL: http://svn.apache.org/r1621034
Log:
Simplify null check. The string is never nul.

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

Modified: 
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
URL: 
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java?rev=1621034&r1=1621033&r2=1621034&view=diff
==============================================================================
--- 
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
 (original)
+++ 
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
 Thu Aug 28 04:28:25 2014
@@ -178,13 +178,11 @@ public final class OptionConverter {
             multiplier = ONE_K * ONE_K * ONE_K;
             str = str.substring(0, index);
         }
-        if (str != null) {
-            try {
-                return Long.parseLong(str) * multiplier;
-            } catch (final NumberFormatException e) {
-                LOGGER.error("[{}] is not in proper int form.", str);
-                LOGGER.error("[{}] not in expected format.", value, e);
-            }
+        try {
+            return Long.parseLong(str) * multiplier;
+        } catch (final NumberFormatException e) {
+            LOGGER.error("[{}] is not in proper int form.", str);
+            LOGGER.error("[{}] not in expected format.", value, e);
         }
         return defaultValue;
     }


Reply via email to