logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1582190 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/ log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/ log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ log4j-core/src/ma...
Date Thu, 27 Mar 2014 05:20:55 GMT
Author: ggregory
Date: Thu Mar 27 05:20:54 2014
New Revision: 1582190

URL: http://svn.apache.org/r1582190
Log:
Change API name to be like Java 7: Assert.isNotNull -> requireNonNull, like Java 7 Objects.requireNonNull.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Assert.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketServer.java
    logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/Client.java
    logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
Thu Mar 27 05:20:54 2014
@@ -398,7 +398,7 @@ public class LoggerContext implements or
     }
 
     public void addPropertyChangeListener(final PropertyChangeListener listener) {
-        propertyChangeListeners.add(Assert.isNotNull(listener, "listener"));
+        propertyChangeListeners.add(Assert.requireNonNull(listener, "listener"));
     }
 
     public void removePropertyChangeListener(final PropertyChangeListener listener) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Assert.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Assert.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Assert.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Assert.java
Thu Mar 27 05:20:54 2014
@@ -27,6 +27,9 @@ public final class Assert {
      * Throws a {@code NullPointerException} if the specified parameter is
      * {@code null}, otherwise returns the specified parameter.
      * <p>
+     * On Java 7, just use Objects#requireNonNull()
+     * </p>
+     * <p>
      * Usage:
      *
      * <pre>
@@ -40,7 +43,7 @@ public final class Assert {
      *
      * // now you can do the same in one line:
      * public SomeConstructor(Object param) {
-     *     this.field = Assert.isNotNull(param);
+     *     this.field = Assert.requireNonNull(param);
      * }
      * </pre>
      *
@@ -50,7 +53,7 @@ public final class Assert {
      *            {@code null}
      * @return the specified parameter
      */
-    public static <T> T isNotNull(final T checkMe, final String name) {
+    public static <T> T requireNonNull(final T checkMe, final String name) {
         if (checkMe == null) {
             throw new NullPointerException(name + " is null");
         }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java
Thu Mar 27 05:20:54 2014
@@ -40,8 +40,8 @@ public class AppenderAdmin implements Ap
      */
     public AppenderAdmin(final String contextName, final Appender appender) {
         // super(executor); // no notifications for now
-        this.contextName = Assert.isNotNull(contextName, "contextName");
-        this.appender = Assert.isNotNull(appender, "appender");
+        this.contextName = Assert.requireNonNull(contextName, "contextName");
+        this.appender = Assert.requireNonNull(appender, "appender");
         try {
             final String ctxName = Server.escape(this.contextName);
             final String configName = Server.escape(appender.getName());

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/AsyncAppenderAdmin.java
Thu Mar 27 05:20:54 2014
@@ -39,8 +39,8 @@ public class AsyncAppenderAdmin implemen
      */
     public AsyncAppenderAdmin(final String contextName, final AsyncAppender appender) {
         // super(executor); // no notifications for now
-        this.contextName = Assert.isNotNull(contextName, "contextName");
-        this.asyncAppender = Assert.isNotNull(appender, "async appender");
+        this.contextName = Assert.requireNonNull(contextName, "contextName");
+        this.asyncAppender = Assert.requireNonNull(appender, "async appender");
         try {
             final String ctxName = Server.escape(this.contextName);
             final String configName = Server.escape(appender.getName());

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
Thu Mar 27 05:20:54 2014
@@ -43,7 +43,7 @@ public class ContextSelectorAdmin implem
      */
     public ContextSelectorAdmin(final String contextName, final ContextSelector selector)
{
         super();
-        this.selector = Assert.isNotNull(selector, "ContextSelector");
+        this.selector = Assert.requireNonNull(selector, "ContextSelector");
         try {
             final String mbeanName = String.format(PATTERN, Server.escape(contextName));
             objectName = new ObjectName(mbeanName);

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java
Thu Mar 27 05:20:54 2014
@@ -42,8 +42,8 @@ public class LoggerConfigAdmin implement
      */
     public LoggerConfigAdmin(final String contextName, final LoggerConfig loggerConfig) {
         // super(executor); // no notifications for now
-        this.contextName = Assert.isNotNull(contextName, "contextName");
-        this.loggerConfig = Assert.isNotNull(loggerConfig, "loggerConfig");
+        this.contextName = Assert.requireNonNull(contextName, "contextName");
+        this.loggerConfig = Assert.requireNonNull(loggerConfig, "loggerConfig");
         try {
             final String ctxName = Server.escape(this.contextName);
             final String configName = Server.escape(loggerConfig.getName());

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
Thu Mar 27 05:20:54 2014
@@ -72,7 +72,7 @@ public class LoggerContextAdmin extends 
      */
     public LoggerContextAdmin(final LoggerContext loggerContext, final Executor executor)
{
         super(executor, createNotificationInfo());
-        this.loggerContext = Assert.isNotNull(loggerContext, "loggerContext");
+        this.loggerContext = Assert.requireNonNull(loggerContext, "loggerContext");
         try {
             final String ctxName = Server.escape(loggerContext.getName());
             final String name = String.format(PATTERN, ctxName);
@@ -169,7 +169,7 @@ public class LoggerContextAdmin extends 
     @Override
     public void setConfigText(final String configText, final String charsetName) {
         final String old = customConfigText;
-        customConfigText = Assert.isNotNull(configText, "configText");
+        customConfigText = Assert.requireNonNull(configText, "configText");
         LOGGER.debug("---------");
         LOGGER.debug("Remote request to reconfigure from config text.");
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/RingBufferAdmin.java
Thu Mar 27 05:20:54 2014
@@ -45,7 +45,7 @@ public class RingBufferAdmin implements 
     }
     
     protected RingBufferAdmin(RingBuffer<?> ringBuffer, String mbeanName) {
-        this.ringBuffer = Assert.isNotNull(ringBuffer, "ringbuffer");        
+        this.ringBuffer = Assert.requireNonNull(ringBuffer, "ringbuffer");        
         try {
             objectName = new ObjectName(mbeanName);
         } catch (final Exception e) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketServer.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketServer.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketServer.java
Thu Mar 27 05:20:54 2014
@@ -94,7 +94,7 @@ public abstract class AbstractSocketServ
 
     public AbstractSocketServer(int port, LogEventInput logEventInput) {
         this.logger = LogManager.getLogger(this.getClass().getName() + '.' + port);
-        this.logEventInput = Assert.isNotNull(logEventInput, "LogEventInput");
+        this.logEventInput = Assert.requireNonNull(logEventInput, "LogEventInput");
     }
 
     protected boolean isActive() {

Modified: logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/Client.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/Client.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/Client.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/Client.java
Thu Mar 27 05:20:54 2014
@@ -52,7 +52,7 @@ public class Client {
      * @throws IOException if the connection failed
      */
     public Client(final JMXConnector connector) throws MalformedObjectNameException, IOException
{
-        this.connector = Assert.isNotNull(connector, "JMXConnector");
+        this.connector = Assert.requireNonNull(connector, "JMXConnector");
         this.connector.connect();
         this.connection = connector.getMBeanServerConnection();
         init();

Modified: logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java?rev=1582190&r1=1582189&r2=1582190&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
Thu Mar 27 05:20:54 2014
@@ -76,7 +76,7 @@ public class ClientGUI extends JPanel im
     private JTabbedPane tabbedPaneContexts;
 
     public ClientGUI(final Client client) throws IOException, JMException {
-        this.client = Assert.isNotNull(client, "client");
+        this.client = Assert.requireNonNull(client, "client");
         createWidgets();
         populateWidgets();
 



Mime
View raw message