logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1394945 - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/message/ src/changes/
Date Sat, 06 Oct 2012 06:38:48 GMT
Author: rgoers
Date: Sat Oct  6 06:38:48 2012
New Revision: 1394945

URL: http://svn.apache.org/viewvc?rev=1394945&view=rev
Log:
Make ParameterizedMessage, ThreadDumpMessage and StrnigFormattedMessage immutable

Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java?rev=1394945&r1=1394944&r2=1394945&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
Sat Oct  6 06:38:48 2012
@@ -47,14 +47,6 @@ public class LocalizedMessage extends Pa
 
     private String loggerName = null;
 
-    /**
-     * The basic constructor.
-     */
-    public LocalizedMessage() {
-        super();
-        setup(null, null, null);
-    }
-
     public LocalizedMessage(String messagePattern, String[] stringArgs, Throwable throwable)
{
         super(messagePattern, stringArgs, throwable);
         setup(null, null, null);

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java?rev=1394945&r1=1394944&r2=1394945&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
Sat Oct  6 06:38:48 2012
@@ -76,13 +76,6 @@ public class ParameterizedMessage implem
     private transient Throwable throwable;
 
     /**
-     * Create the ParameterizedMessage.
-     */
-    public ParameterizedMessage() {
-        this(null, null, null);
-    }
-
-    /**
      * Create the parameterizedMessage.
      * @param messagePattern The message "format" string. This will be a String containing
"{}" placeholders
      * where parameters should be substituted.
@@ -188,15 +181,6 @@ public class ParameterizedMessage implem
     }
 
     /**
-     * Set the message pattern.
-     * @param messagePattern The message pattern.
-     */
-    public void setMessageFormat(String messagePattern) {
-        this.messagePattern = messagePattern;
-        this.formattedMessage = null;
-    }
-
-    /**
      * Returns the message parameters.
      * @return the message parameters.
      */
@@ -208,32 +192,6 @@ public class ParameterizedMessage implem
     }
 
     /**
-     * Sets the parameters for the message.
-     * @param parameters The parameters.
-     */
-    public void setParameters(String[] parameters) {
-        this.stringArgs = parameters;
-        this.formattedMessage = null;
-    }
-
-    /**
-     * Sets the parameters for the message.
-     * @param parameters The parameters.
-     */
-    public void setParameters(Object[] parameters) {
-        parseArguments(parameters);
-        this.formattedMessage = null;
-    }
-
-    /**
-     * Set the Throwable for the message.
-     * @param throwable The Throwable.
-     */
-    public void setThrowable(Throwable throwable) {
-        this.throwable = throwable;
-    }
-
-    /**
      * Returns the Throwable that was given as the last argument, if any.
      * It will not survive serialization. The Throwable exists as part of the message
      * primarily so that it can be extracted from the end of the list of parameters

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java?rev=1394945&r1=1394944&r2=1394945&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/StringFormattedMessage.java
Sat Oct  6 06:38:48 2012
@@ -42,14 +42,6 @@ public class StringFormattedMessage impl
     private String[] stringArgs;
     private transient String formattedMessage;
 
-    /**
-     * Create the StringFormattedMessage.
-     */
-    public StringFormattedMessage() {
-        this(null, null, null);
-    }
-
-
     public StringFormattedMessage(String messagePattern, Object... arguments) {
         this.messagePattern = messagePattern;
         this.argArray = arguments;
@@ -75,15 +67,6 @@ public class StringFormattedMessage impl
     }
 
     /**
-     * Set the message pattern.
-     * @param messagePattern The message pattern.
-     */
-    public void setMessageFormat(String messagePattern) {
-        this.messagePattern = messagePattern;
-        this.formattedMessage = null;
-    }
-
-    /**
      * Returns the message parameters.
      * @return the message parameters.
      */
@@ -94,15 +77,6 @@ public class StringFormattedMessage impl
         return stringArgs;
     }
 
-    /**
-     * Sets the parameters for the message.
-     * @param parameters The parameters.
-     */
-    public void setParameters(Object[] parameters) {
-        this.argArray = parameters;
-        this.formattedMessage = null;
-    }
-
     protected String formatMessage(String msgPattern, Object... args) {
         try {
             return String.format(msgPattern, args);

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java?rev=1394945&r1=1394944&r2=1394945&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
Sat Oct  6 06:38:48 2012
@@ -54,14 +54,6 @@ public class ThreadDumpMessage implement
     }
 
     /**
-     * Generate a ThreadDumpMessage with no title.
-     */
-    public ThreadDumpMessage() {
-        this(null);
-
-    }
-
-    /**
      * Generate a ThreadDumpMessage with a title.
      * @param title The title.
      */

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1394945&r1=1394944&r2=1394945&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Sat Oct  6 06:38:48 2012
@@ -23,6 +23,10 @@
 
   <body>
     <release version="2.0-beta2" date="TBD" description="Bug fixes and enhancements">
+      <action dev="rgoers" type="update">
+        Made ParameterizedMessage, StringFormattedMessage and ThreadDumpMessage immutable.
LocalizedMessage is
+        immutable except that it will be updated with the logger name when it is added to
the LogEvent.
+      </action>
       <action dev="rgoers" type="fix">
         DefaultConfiguration was not starting the Console Appender.
       </action>



Mime
View raw message