NeatGuyCoding opened a new pull request, #4008: URL: https://github.com/apache/logging-log4j2/pull/4008
Fix writeHeader computation in RollingRandomAccessFileManager The writeHeader boolean was computed after creating the RandomAccessFile, which creates the file if it doesn't exist. This made file.exists() always return true, causing incorrect header write decisions. This change captures the file's pre-existing state before opening the RandomAccessFile by: - Declaring a fileExistedBefore boolean initialized to false - Setting it by checking fileName != null && new File(fileName).exists() before calling new RandomAccessFile(...) - Using !fileExistedBefore instead of !file.exists() in the writeHeader calculation When fileName is null, fileExistedBefore remains false as expected. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
