This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 59d83ee818 Forgot files in last commit
59d83ee818 is described below
commit 59d83ee818948b6d11529c03296c6d5d71df135e
Author: remm <[email protected]>
AuthorDate: Wed Oct 21 08:43:17 2026 +0200
Forgot files in last commit
---
java/org/apache/juli/FileHandler.java | 7 ++-----
test/org/apache/juli/TestFileHandler.java | 2 +-
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/juli/FileHandler.java
b/java/org/apache/juli/FileHandler.java
index e97fb0e745..b285ad5068 100644
--- a/java/org/apache/juli/FileHandler.java
+++ b/java/org/apache/juli/FileHandler.java
@@ -162,7 +162,7 @@ public class FileHandler extends Handler {
/**
* The as-of date for the currently open log file, or a zero-length string
if there is no open log file.
*/
- private volatile String date = "";
+ private volatile String date = null;
/**
@@ -341,7 +341,7 @@ public class FileHandler extends Handler {
reportError(null, e, ErrorManager.CLOSE_FAILURE);
}
writer = null;
- date = "";
+ date = null;
}
} finally {
writerLock.writeLock().unlock();
@@ -375,9 +375,6 @@ public class FileHandler extends Handler {
*/
private void configure() {
- Timestamp ts = new Timestamp(System.currentTimeMillis());
- date = ts.toString().substring(0, 10);
-
String className = this.getClass().getName(); // allow classes to
override
ClassLoader cl = ClassLoaderLogManager.getClassLoader();
diff --git a/test/org/apache/juli/TestFileHandler.java
b/test/org/apache/juli/TestFileHandler.java
index 99b95ce356..1be851ec45 100644
--- a/test/org/apache/juli/TestFileHandler.java
+++ b/test/org/apache/juli/TestFileHandler.java
@@ -143,7 +143,7 @@ public class TestFileHandler {
// Publishing after the open must use the file that was opened, not
rotate to a new one
fh.publish(new LogRecord(Level.INFO, "hello"));
Assert.assertTrue("The published record was not written to [" +
expected + "]",
- Files.readString(expected.toPath()).contains("hello"));
+ new String(Files.readAllBytes(expected.toPath()),
"UTF-8").contains("hello"));
Assert.assertEquals(1, countFiles(prefix));
// Reopening a closed handler must not create a file with an unset
date either
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]