logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1566496 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Date Mon, 10 Feb 2014 02:59:28 GMT
Author: ggregory
Date: Mon Feb 10 02:59:28 2014
New Revision: 1566496

URL: http://svn.apache.org/r1566496
Log:
Do not use magic numbers.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java?rev=1566496&r1=1566495&r2=1566496&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Mon Feb 10 02:59:28 2014
@@ -417,10 +417,10 @@ public class DefaultRolloverStrategy imp
         Action compressAction = null;
 
         if (renameTo.endsWith(EXT_GZIP)) {
-            renameTo = renameTo.substring(0, renameTo.length() - 3);
+            renameTo = renameTo.substring(0, renameTo.length() - EXT_GZIP.length());
             compressAction = new GZCompressAction(new File(renameTo), new File(compressedName),
true);
         } else if (renameTo.endsWith(EXT_ZIP)) {
-            renameTo = renameTo.substring(0, renameTo.length() - 4);
+            renameTo = renameTo.substring(0, renameTo.length() - EXT_ZIP.length());
             compressAction = new ZipCompressAction(new File(renameTo), new File(compressedName),
true, 
                     compressionLevel);
         }



Mime
View raw message