Github user garydgregory commented on a diff in the pull request:

    https://github.com/apache/logging-log4j2/pull/107#discussion_r133084320
  
    --- Diff: 
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java
 ---
    @@ -124,11 +124,12 @@ public static boolean execute(final File source, 
final File destination, final b
                     } catch (final IOException exMove) {
                         LOGGER.error("Unable to move file {} to {}: {} {}", 
source.getAbsolutePath(),
                                 destination.getAbsolutePath(), 
exMove.getClass().getName(), exMove.getMessage());
    -                    final boolean result = source.renameTo(destination);
    +                    boolean result = source.renameTo(destination);
                         if (!result) {
                             try {
                                 
Files.copy(Paths.get(source.getAbsolutePath()), 
Paths.get(destination.getAbsolutePath()),
                                         StandardCopyOption.REPLACE_EXISTING);
    +                            result = true;
    --- End diff --
    
    Shouldn't this "result = true" be done _after_ this method successfully 
deletes the file?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to