You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2017/07/26 01:34:23 UTC
logging-log4j2 git commit: Refactor duplicate call.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 9073618c9 -> 1de6a8885
Refactor duplicate call.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1de6a888
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1de6a888
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1de6a888
Branch: refs/heads/master
Commit: 1de6a88858b63924554ac8e59270cc3ddccdd925
Parents: 9073618
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jul 25 18:34:20 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jul 25 18:34:20 2017 -0700
----------------------------------------------------------------------
.../log4j/core/appender/rolling/DefaultRolloverStrategy.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1de6a888/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
index 480c3f7..dbaf546 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
@@ -549,8 +549,9 @@ public class DefaultRolloverStrategy extends AbstractRolloverStrategy {
tempCompressedFilePattern.formatFileName(strSubstitutor, buf, fileIndex);
final String tmpCompressedName = buf.toString();
final File tmpCompressedNameFile = new File(tmpCompressedName);
- if (tmpCompressedNameFile.getParentFile() != null) {
- tmpCompressedNameFile.getParentFile().mkdirs();
+ File parentFile = tmpCompressedNameFile.getParentFile();
+ if (parentFile != null) {
+ parentFile.mkdirs();
}
compressAction = new CompositeAction(
Arrays.asList(fileExtension.createCompressAction(renameTo, tmpCompressedName,