Repository: logging-log4j2
Updated Branches:
  refs/heads/master 33765882b -> 53ad0d7d3


[LOG4J2-1597] Fix FindBugs warnings.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/53ad0d7d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/53ad0d7d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/53ad0d7d

Branch: refs/heads/master
Commit: 53ad0d7d32a8f042220c7be4744e3c0e5819c6a9
Parents: 3376588
Author: Gary Gregory <ggreg...@apache.org>
Authored: Tue Sep 20 12:11:08 2016 -0700
Committer: Gary Gregory <ggreg...@apache.org>
Committed: Tue Sep 20 12:11:08 2016 -0700

----------------------------------------------------------------------
 .../logging/log4j/core/appender/AppenderSet.java       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/53ad0d7d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
index 2f53224..4eed071 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
@@ -48,18 +48,23 @@ public class AppenderSet {
         @Override
         public AppenderSet build() {
             if (configuration == null) {
-                LOGGER.error("Configuration is missing from AppenderSet");
+                LOGGER.error("Configuration is missing from AppenderSet {}", 
this);
+                return null;                
+            }
+            if (node == null) {
+                LOGGER.error("No node in AppenderSet {}", this);
+                return null;
             }
             final List<Node> children = node.getChildren();
-            final Map<String, Node> map = new HashMap<>(node == null ? 0 : 
children.size());
             if (children == null) {
-                LOGGER.error("No child node in the AppenderSet {}", this);
+                LOGGER.error("No children node in AppenderSet {}", this);
                 return null;
             }
+            final Map<String, Node> map = new HashMap<>(children.size());
             for (final Node childNode : children) {
                 final String key = childNode.getAttributes().get("name");
                 if (key == null) {
-                    LOGGER.error("The attribute 'name' is missing from from 
the node {} in the AppenderSet {}",
+                    LOGGER.error("The attribute 'name' is missing from from 
the node {} in AppenderSet {}",
                             childNode, children);
                 } else {
                     map.put(key, childNode);

Reply via email to