You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2015/11/23 07:21:56 UTC
logging-log4j2 git commit: Findbugs and checkstyle fixes
Repository: logging-log4j2
Updated Branches:
refs/heads/master 948ee9960 -> 6e4ff7349
Findbugs and checkstyle fixes
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6e4ff734
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6e4ff734
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6e4ff734
Branch: refs/heads/master
Commit: 6e4ff7349565cbddb79dc664157850ab0a2e7f8a
Parents: 948ee99
Author: Ralph Goers <rg...@apache.org>
Authored: Sun Nov 22 23:21:44 2015 -0700
Committer: Ralph Goers <rg...@apache.org>
Committed: Sun Nov 22 23:21:44 2015 -0700
----------------------------------------------------------------------
.../apache/logging/log4j/core/script/ScriptFile.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6e4ff734/log4j-core/src/main/java/org/apache/logging/log4j/core/script/ScriptFile.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/script/ScriptFile.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/script/ScriptFile.java
index 743017c..f2fe085 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/script/ScriptFile.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/script/ScriptFile.java
@@ -43,7 +43,7 @@ import org.apache.logging.log4j.status.StatusLogger;
@Plugin(name = "ScriptFile", category = Node.CATEGORY, printObject = true)
public class ScriptFile extends AbstractScript {
- private static final Logger logger = StatusLogger.getLogger();
+ private static final Logger LOGGER = StatusLogger.getLogger();
private final Path filePath;
private final boolean isWatched;
@@ -66,13 +66,13 @@ public class ScriptFile extends AbstractScript {
public static ScriptFile createScript(
// @formatter:off
@PluginAttribute("name") String name,
- @PluginAttribute("language") String language,
+ @PluginAttribute("language") String language,
@PluginAttribute("path") final String filePathOrUri,
@PluginAttribute("isWatched") final Boolean isWatched,
@PluginAttribute("charset") final Charset charset) {
// @formatter:on
if (filePathOrUri == null) {
- logger.error("No script path provided for ScriptFile");
+ LOGGER.error("No script path provided for ScriptFile");
return null;
}
if (name == null) {
@@ -90,7 +90,7 @@ public class ScriptFile extends AbstractScript {
}
}
if (language == null) {
- logger.info("No script language supplied, defaulting to {}", DEFAULT_LANGUAGE);
+ LOGGER.info("No script language supplied, defaulting to {}", DEFAULT_LANGUAGE);
language = DEFAULT_LANGUAGE;
}
@@ -100,13 +100,13 @@ public class ScriptFile extends AbstractScript {
file != null ? new FileInputStream(file) : uri.toURL().openStream(), actualCharset)) {
scriptText = IOUtils.toString(reader);
} catch (IOException e) {
- logger.error("{}: language={}, path={}, actualCharset={}", e.getClass().getSimpleName(),
+ LOGGER.error("{}: language={}, path={}, actualCharset={}", e.getClass().getSimpleName(),
language, filePathOrUri, actualCharset);
return null;
}
Path path = file != null ? Paths.get(file.toURI()) : Paths.get(uri);
if (path == null) {
- logger.error("Unable to convert {} to a Path", uri.toString());
+ LOGGER.error("Unable to convert {} to a Path", uri.toString());
return null;
}
return new ScriptFile(name, path, language, isWatched == null ? Boolean.FALSE : isWatched, scriptText);
@@ -115,7 +115,7 @@ public class ScriptFile extends AbstractScript {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- if (!(getName().equals(filePath))) {
+ if (!(getName().equals(filePath.toString()))) {
sb.append("name=").append(getName()).append(", ");
}
sb.append("path=").append(filePath);