You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/05/25 06:21:39 UTC
svn commit: r1597383 -
/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
Author: mattsicker
Date: Sun May 25 04:21:38 2014
New Revision: 1597383
URL: http://svn.apache.org/r1597383
Log:
Use Assert.requireNonNull.
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java?rev=1597383&r1=1597382&r2=1597383&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java Sun May 25 04:21:38 2014
@@ -40,6 +40,7 @@ import org.apache.logging.log4j.core.con
import org.apache.logging.log4j.core.config.plugins.PluginNode;
import org.apache.logging.log4j.core.config.plugins.PluginValue;
import org.apache.logging.log4j.core.config.plugins.SensitivePluginAttribute;
+import org.apache.logging.log4j.core.util.Assert;
import org.apache.logging.log4j.core.util.NameUtil;
import org.apache.logging.log4j.status.StatusLogger;
@@ -147,15 +148,9 @@ public class PluginBuilder<T> {
}
private void init() {
- if (factory == null) {
- throw new IllegalStateException("No factory method was found.");
- }
- if (configuration == null) {
- throw new IllegalStateException("No Configuration object was set.");
- }
- if (node == null) {
- throw new IllegalStateException("No Node object was set.");
- }
+ Assert.requireNonNull(factory, "No factory method was found.");
+ Assert.requireNonNull(configuration, "No Configuration object was set.");
+ Assert.requireNonNull(node, "No Node object was set.");
annotations = factory.getParameterAnnotations();
types = factory.getParameterTypes();
}