logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1563164 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
Date Fri, 31 Jan 2014 16:24:26 GMT
Author: ggregory
Date: Fri Jan 31 16:24:26 2014
New Revision: 1563164

URL: http://svn.apache.org/r1563164
Log:
Let the Locale ivar be final.

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java?rev=1563164&r1=1563163&r2=1563164&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
Fri Jan 31 16:24:26 2014
@@ -41,7 +41,7 @@ public class LocalizedMessage implements
 
     private transient ResourceBundle bundle;
 
-    private Locale locale;
+    private final Locale locale;
 
     private transient StatusLogger logger = StatusLogger.getLogger();
 
@@ -74,7 +74,9 @@ public class LocalizedMessage implements
         this.messagePattern = key;
         this.argArray = arguments;
         this.throwable = null;
-        setup(bundleId, null, locale);
+        this.bundleId = bundleId;
+        this.bundle = null;
+        this.locale = locale;
     }
 
     public LocalizedMessage(final ResourceBundle bundle, final Locale locale, final String
key,
@@ -82,7 +84,9 @@ public class LocalizedMessage implements
         this.messagePattern = key;
         this.argArray = arguments;
         this.throwable = null;
-        setup(null, bundle, locale);
+        this.bundleId = null;
+        this.bundle = bundle;
+        this.locale = locale;
     }
 
     public LocalizedMessage(final Locale locale, final String key, final Object[] arguments)
{
@@ -157,12 +161,6 @@ public class LocalizedMessage implements
         return this.loggerName;
     }
 
-    private void setup(final String bundleId, final ResourceBundle bundle, final Locale locale)
{
-        this.bundleId = bundleId;
-        this.bundle = bundle;
-        this.locale = locale;
-    }
-
     /**
      * Returns the formatted message after looking up the format in the resource bundle.
      * @return The formatted message String.



Mime
View raw message