This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch release-2.x in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/release-2.x by this push: new dc24f9f Use better internal names. dc24f9f is described below commit dc24f9f9fda06777770a53c086e1fc1d41126096 Author: Gary Gregory <garydgreg...@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; } }