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 2022/01/13 13:30:48 UTC
[logging-log4j2] branch master updated: Use better internal names.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new a28e36a Use better internal names.
a28e36a is described below
commit a28e36aa3fa27889319a66dfe0632ea11240339d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Jan 13 08:29:28 2022 -0500
Use better internal names.
- Specify the scale in parameter name: 'long delay' becomes 'long
delayMillis'.
- Don't initialize instance variables to their default values.
- public and protected names remain unchanged.
---
.../org/apache/log4j/helpers/FileWatchdog.java | 26 ++++++++++++----------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/FileWatchdog.java b/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/FileWatchdog.java
index ec3b3b7..b601416d 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/FileWatchdog.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/helpers/FileWatchdog.java
@@ -44,14 +44,14 @@ public abstract class FileWatchdog extends Thread {
protected long delay = DEFAULT_DELAY;
File file;
- long lastModif = 0;
- boolean warnedAlready = false;
- boolean interrupted = false;
+ long lastModified;
+ boolean warnedAlready;
+ boolean interrupted;
- protected FileWatchdog(final String filename) {
+ protected FileWatchdog(final String fileName) {
super("FileWatchdog");
- this.filename = filename;
- file = new File(filename);
+ this.filename = fileName;
+ this.file = new File(fileName);
setDaemon(true);
checkAndConfigure();
}
@@ -67,9 +67,9 @@ public abstract class FileWatchdog extends Thread {
}
if (fileExists) {
- final long l = file.lastModified(); // this can also throw a SecurityException
- if (l > lastModif) { // however, if we reached this point this
- lastModif = l; // is very unlikely.
+ final long fileLastMod = file.lastModified(); // this can also throw a SecurityException
+ if (fileLastMod > lastModified) { // however, if we reached this point this
+ lastModified = fileLastMod; // is very unlikely.
doOnChange();
warnedAlready = false;
}
@@ -96,9 +96,11 @@ public abstract class FileWatchdog extends Thread {
}
/**
- * Sets the delay to observe between each check of the file changes.
+ * Sets the delay in milliseconds to observe between each check of the file changes.
+ *
+ * @param delayMillis the delay in milliseconds
*/
- public void setDelay(final long delay) {
- this.delay = delay;
+ public void setDelay(final long delayMillis) {
+ this.delay = delayMillis;
}
}