logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [10/17] - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/ api/src/main/java/org/apache/logging/log4j/message/ api/src/main/java/org/apache/logging/log4j/simple/ api/src/main/java/org/apache/logging/log4j...
Date Mon, 10 Dec 2012 19:37:03 GMT
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java Mon Dec 10 19:36:06 2012
@@ -53,44 +53,44 @@ public class DatagramOutputStream extend
      * @param host The host to connect to.
      * @param port The port on the host.
      */
-    public DatagramOutputStream(String host, int port) {
+    public DatagramOutputStream(final String host, final int port) {
         this.port = port;
         try {
             address = InetAddress.getByName(host);
-        } catch (UnknownHostException ex) {
-            String msg = "Could not find host " + host;
+        } catch (final UnknownHostException ex) {
+            final String msg = "Could not find host " + host;
             LOGGER.error(msg, ex);
             throw new AppenderRuntimeException(msg, ex);
         }
 
         try {
             ds = new DatagramSocket();
-        } catch (SocketException ex) {
-            String msg = "Could not instantiate DatagramSocket to " + host;
+        } catch (final SocketException ex) {
+            final String msg = "Could not instantiate DatagramSocket to " + host;
             LOGGER.error(msg, ex);
             throw new AppenderRuntimeException(msg, ex);
         }
     }
 
     @Override
-    public synchronized void write(byte[] bytes, int offset, int length) throws IOException {
+    public synchronized void write(final byte[] bytes, final int offset, final int length) throws IOException {
         copy(bytes, offset, length);
     }
 
     @Override
-    public synchronized void write(int i) throws IOException {
+    public synchronized void write(final int i) throws IOException {
         copy(new byte[] {(byte) (i >>> SHIFT_3), (byte) (i >>> SHIFT_2), (byte) (i >>> SHIFT_1), (byte) i}, 0, 4);
     }
 
     @Override
-    public synchronized void write(byte[] bytes) throws IOException {
+    public synchronized void write(final byte[] bytes) throws IOException {
         copy(bytes, 0, bytes.length);
     }
 
     @Override
     public synchronized void flush() throws IOException {
         if (this.ds != null && this.address != null) {
-            DatagramPacket packet = new DatagramPacket(data, data.length, address, port);
+            final DatagramPacket packet = new DatagramPacket(data, data.length, address, port);
             ds.send(packet);
         }
         data = null;
@@ -107,9 +107,9 @@ public class DatagramOutputStream extend
         }
     }
 
-    private void copy(byte[] bytes, int offset, int length) {
-        int index = data == null ? 0 : data.length;
-        byte[] copy = new byte[length + index];
+    private void copy(final byte[] bytes, final int offset, final int length) {
+        final int index = data == null ? 0 : data.length;
+        final byte[] copy = new byte[length + index];
         if (data != null) {
             System.arraycopy(data, 0, copy, 0, index);
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java Mon Dec 10 19:36:06 2012
@@ -34,7 +34,7 @@ public class DatagramSocketManager exten
      * @param host The host to connect to.
      * @param port The port on the host.
      */
-    protected DatagramSocketManager(OutputStream os, String name, String host, int port) {
+    protected DatagramSocketManager(final OutputStream os, final String name, final String host, final int port) {
         super(name, os, null, host, port);
     }
 
@@ -44,7 +44,7 @@ public class DatagramSocketManager exten
      * @param port The port on the host.
      * @return A DatagramSocketManager.
      */
-    public static DatagramSocketManager getSocketManager(String host, int port) {
+    public static DatagramSocketManager getSocketManager(final String host, final int port) {
         if (host == null || host.length() == 0) {
             throw new IllegalArgumentException("A host name is required");
         }
@@ -59,10 +59,10 @@ public class DatagramSocketManager exten
      * Data for the factory.
      */
     private static class FactoryData {
-        private String host;
-        private int port;
+        private final String host;
+        private final int port;
 
-        public FactoryData(String host, int port) {
+        public FactoryData(final String host, final int port) {
             this.host = host;
             this.port = port;
         }
@@ -73,8 +73,8 @@ public class DatagramSocketManager exten
      */
     private static class DatagramSocketManagerFactory implements ManagerFactory<DatagramSocketManager, FactoryData> {
 
-        public DatagramSocketManager createManager(String name, FactoryData data) {
-            OutputStream os = new DatagramOutputStream(data.host, data.port);
+        public DatagramSocketManager createManager(final String name, final FactoryData data) {
+            final OutputStream os = new DatagramOutputStream(data.host, data.port);
             return new DatagramSocketManager(os, name, data.host, data.port);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Facility.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Facility.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Facility.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Facility.java Mon Dec 10 19:36:06 2012
@@ -105,7 +105,7 @@ public enum Facility {
      * @param name The Facility enum name, case-insensitive. If null, returns, null
      * @return a Facility enum value or null if name is null
      */
-    public static Facility toFacility(String name) {
+    public static Facility toFacility(final String name) {
         return toFacility(name, null);
     }
 
@@ -116,13 +116,13 @@ public enum Facility {
      * @param defaultFacility the Facility to return if name is null
      * @return a Facility enum value or null if name is null
      */
-    public static Facility toFacility(String name, Facility defaultFacility) {
+    public static Facility toFacility(final String name, final Facility defaultFacility) {
         return EnglishEnums.valueOf(Facility.class, name, defaultFacility);
     }
 
     private final int code;
 
-    private Facility(int code) {
+    private Facility(final int code) {
         this.code = code;
     }
 
@@ -139,7 +139,7 @@ public enum Facility {
      * @param name The name to check.
      * @return true if the name matches this enumeration, ignoring case.
      */
-    public boolean isEqual(String name) {
+    public boolean isEqual(final String name) {
         return this.name().equalsIgnoreCase(name);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java Mon Dec 10 19:36:06 2012
@@ -53,8 +53,8 @@ public class JMSQueueManager extends Abs
      * @param password The credentials for the user.
      * @param info The Queue connection info.
      */
-    protected JMSQueueManager(String name, Context context, String factoryBindingName, String queueBindingName,
-                              String userName, String password, QueueInfo info) {
+    protected JMSQueueManager(final String name, final Context context, final String factoryBindingName, final String queueBindingName,
+                              final String userName, final String password, final QueueInfo info) {
         super(name);
         this.context = context;
         this.factoryBindingName = factoryBindingName;
@@ -78,10 +78,10 @@ public class JMSQueueManager extends Abs
      * @param password The password to use to create the Queue Connection.
      * @return The JMSQueueManager.
      */
-    public static JMSQueueManager getJMSQueueManager(String factoryName, String providerURL, String urlPkgPrefixes,
-                                                     String securityPrincipalName, String securityCredentials,
-                                                     String factoryBindingName, String queueBindingName,
-                                                     String userName, String password) {
+    public static JMSQueueManager getJMSQueueManager(final String factoryName, final String providerURL, final String urlPkgPrefixes,
+                                                     final String securityPrincipalName, final String securityCredentials,
+                                                     final String factoryBindingName, final String queueBindingName,
+                                                     final String userName, final String password) {
 
         if (factoryBindingName == null) {
             LOGGER.error("No factory name provided for JMSQueueManager");
@@ -92,13 +92,13 @@ public class JMSQueueManager extends Abs
             return null;
         }
 
-        String name = "JMSQueue:" + factoryBindingName + '.' + queueBindingName;
+        final String name = "JMSQueue:" + factoryBindingName + '.' + queueBindingName;
         return getManager(name, factory, new FactoryData(factoryName, providerURL, urlPkgPrefixes,
             securityPrincipalName, securityCredentials, factoryBindingName, queueBindingName, userName, password));
     }
 
     @Override
-    public synchronized void send(Serializable object) throws Exception {
+    public synchronized void send(final Serializable object) throws Exception {
         if (info == null) {
             info = connect(context, factoryBindingName, queueBindingName, userName, password, false);
         }
@@ -112,7 +112,7 @@ public class JMSQueueManager extends Abs
                 info.session.close();
                 info.conn.close();
             }
-        } catch (JMSException ex) {
+        } catch (final JMSException ex) {
             LOGGER.error("Error closing " + getName(), ex);
         } finally {
             info = null;
@@ -123,19 +123,19 @@ public class JMSQueueManager extends Abs
      * Data for the factory.
      */
     private static class FactoryData {
-        private String factoryName;
-        private String providerURL;
-        private String urlPkgPrefixes;
-        private String securityPrincipalName;
-        private String securityCredentials;
-        private String factoryBindingName;
-        private String queueBindingName;
-        private String userName;
-        private String password;
-
-        public FactoryData(String factoryName, String providerURL, String urlPkgPrefixes, String securityPrincipalName,
-                           String securityCredentials, String factoryBindingName, String queueBindingName,
-                           String userName, String password) {
+        private final String factoryName;
+        private final String providerURL;
+        private final String urlPkgPrefixes;
+        private final String securityPrincipalName;
+        private final String securityCredentials;
+        private final String factoryBindingName;
+        private final String queueBindingName;
+        private final String userName;
+        private final String password;
+
+        public FactoryData(final String factoryName, final String providerURL, final String urlPkgPrefixes, final String securityPrincipalName,
+                           final String securityCredentials, final String factoryBindingName, final String queueBindingName,
+                           final String userName, final String password) {
             this.factoryName = factoryName;
             this.providerURL = providerURL;
             this.urlPkgPrefixes = urlPkgPrefixes;
@@ -148,27 +148,27 @@ public class JMSQueueManager extends Abs
         }
     }
 
-    private static QueueInfo connect(Context context, String factoryBindingName, String queueBindingName,
-                                     String userName, String password, boolean suppress) throws Exception {
+    private static QueueInfo connect(final Context context, final String factoryBindingName, final String queueBindingName,
+                                     final String userName, final String password, final boolean suppress) throws Exception {
         try {
-            QueueConnectionFactory factory = (QueueConnectionFactory) lookup(context, factoryBindingName);
+            final QueueConnectionFactory factory = (QueueConnectionFactory) lookup(context, factoryBindingName);
             QueueConnection conn;
             if (userName != null) {
                 conn = factory.createQueueConnection(userName, password);
             } else {
                 conn = factory.createQueueConnection();
             }
-            QueueSession sess = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-            Queue queue = (Queue) lookup(context, queueBindingName);
-            QueueSender sender = sess.createSender(queue);
+            final QueueSession sess = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+            final Queue queue = (Queue) lookup(context, queueBindingName);
+            final QueueSender sender = sess.createSender(queue);
             conn.start();
             return new QueueInfo(conn, sess, sender);
-        } catch (NamingException ex) {
+        } catch (final NamingException ex) {
             LOGGER.warn("Unable to locate connection factory " + factoryBindingName, ex);
             if (!suppress) {
                 throw ex;
             }
-        } catch (JMSException ex) {
+        } catch (final JMSException ex) {
             LOGGER.warn("Unable to create connection to queue " + queueBindingName, ex);
             if (!suppress) {
                 throw ex;
@@ -182,7 +182,7 @@ public class JMSQueueManager extends Abs
         private final QueueSession session;
         private final QueueSender sender;
 
-        public QueueInfo(QueueConnection conn, QueueSession session, QueueSender sender) {
+        public QueueInfo(final QueueConnection conn, final QueueSession session, final QueueSender sender) {
             this.conn = conn;
             this.session = session;
             this.sender = sender;
@@ -194,17 +194,17 @@ public class JMSQueueManager extends Abs
      */
     private static class JMSQueueManagerFactory implements ManagerFactory<JMSQueueManager, FactoryData> {
 
-        public JMSQueueManager createManager(String name, FactoryData data) {
+        public JMSQueueManager createManager(final String name, final FactoryData data) {
             try {
-                Context ctx = createContext(data.factoryName, data.providerURL, data.urlPkgPrefixes,
+                final Context ctx = createContext(data.factoryName, data.providerURL, data.urlPkgPrefixes,
                                             data.securityPrincipalName, data.securityCredentials);
-                QueueInfo info = connect(ctx, data.factoryBindingName, data.queueBindingName, data.userName,
+                final QueueInfo info = connect(ctx, data.factoryBindingName, data.queueBindingName, data.userName,
                     data.password, true);
                 return new JMSQueueManager(name, ctx, data.factoryBindingName, data.queueBindingName,
                     data.userName, data.password, info);
-            } catch (NamingException ex) {
+            } catch (final NamingException ex) {
                 LOGGER.error("Unable to locate resource", ex);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.error("Unable to connect", ex);
             }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueReceiver.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueReceiver.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueReceiver.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueReceiver.java Mon Dec 10 19:36:06 2012
@@ -42,23 +42,23 @@ public class JMSQueueReceiver extends Ab
      * @param username The userid to connect to the queue.
      * @param password The password to connect to the queue.
      */
-    public JMSQueueReceiver(String qcfBindingName, String queueBindingName, String username, String password) {
+    public JMSQueueReceiver(final String qcfBindingName, final String queueBindingName, final String username, final String password) {
 
         try {
-            Context ctx = new InitialContext();
+            final Context ctx = new InitialContext();
             QueueConnectionFactory queueConnectionFactory;
             queueConnectionFactory = (QueueConnectionFactory) lookup(ctx, qcfBindingName);
-            QueueConnection queueConnection = queueConnectionFactory.createQueueConnection(username, password);
+            final QueueConnection queueConnection = queueConnectionFactory.createQueueConnection(username, password);
             queueConnection.start();
-            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-            Queue queue = (Queue) ctx.lookup(queueBindingName);
-            QueueReceiver queueReceiver = queueSession.createReceiver(queue);
+            final QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+            final Queue queue = (Queue) ctx.lookup(queueBindingName);
+            final QueueReceiver queueReceiver = queueSession.createReceiver(queue);
             queueReceiver.setMessageListener(this);
-        } catch (JMSException e) {
+        } catch (final JMSException e) {
             logger.error("Could not read JMS message.", e);
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             logger.error("Could not read JMS message.", e);
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             logger.error("Could not read JMS message.", e);
         }
     }
@@ -68,23 +68,23 @@ public class JMSQueueReceiver extends Ab
      * @param args The command line arguments.
      * @throws Exception if an error occurs.
      */
-    public static void main(String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
         if (args.length != 4) {
             usage("Wrong number of arguments.");
         }
 
-        String qcfBindingName = args[0];
-        String queueBindingName = args[1];
-        String username = args[2];
-        String password = args[3];
+        final String qcfBindingName = args[0];
+        final String queueBindingName = args[1];
+        final String username = args[2];
+        final String password = args[3];
 
         new JMSQueueReceiver(qcfBindingName, queueBindingName, username, password);
 
-        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+        final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         // Loop until the word "exit" is typed
         System.out.println("Type \"exit\" to quit JMSQueueReceiver.");
         while (true) {
-            String s = stdin.readLine();
+            final String s = stdin.readLine();
             if (s.equalsIgnoreCase("exit")) {
                 System.out.println("Exiting. Kill the application if it does not exit "
                     + "due to daemon threads.");
@@ -94,7 +94,7 @@ public class JMSQueueReceiver extends Ab
     }
 
 
-    private static void usage(String msg) {
+    private static void usage(final String msg) {
         System.err.println(msg);
         System.err.println("Usage: java " + JMSQueueReceiver.class.getName()
             + " QueueConnectionFactoryBindingName QueueBindingName username password");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java Mon Dec 10 19:36:06 2012
@@ -52,8 +52,8 @@ public class JMSTopicManager extends Abs
      * @param password The credentials for the user.
      * @param info The Queue connection info.
      */
-    protected JMSTopicManager(String name, Context context, String factoryBindingName, String topicBindingName,
-                              String userName, String password, TopicInfo info) {
+    protected JMSTopicManager(final String name, final Context context, final String factoryBindingName, final String topicBindingName,
+                              final String userName, final String password, final TopicInfo info) {
         super(name);
         this.context = context;
         this.factoryBindingName = factoryBindingName;
@@ -77,10 +77,10 @@ public class JMSTopicManager extends Abs
      * @param password The password to use to create the Topic Connection.
      * @return A JMSTopicManager.
      */
-    public static JMSTopicManager getJMSTopicManager(String factoryName, String providerURL, String urlPkgPrefixes,
-                                                     String securityPrincipalName, String securityCredentials,
-                                                     String factoryBindingName, String topicBindingName,
-                                                     String userName, String password) {
+    public static JMSTopicManager getJMSTopicManager(final String factoryName, final String providerURL, final String urlPkgPrefixes,
+                                                     final String securityPrincipalName, final String securityCredentials,
+                                                     final String factoryBindingName, final String topicBindingName,
+                                                     final String userName, final String password) {
 
         if (factoryBindingName == null) {
             LOGGER.error("No factory name provided for JMSTopicManager");
@@ -91,14 +91,14 @@ public class JMSTopicManager extends Abs
             return null;
         }
 
-        String name = "JMSTopic:" + factoryBindingName + '.' + topicBindingName;
+        final String name = "JMSTopic:" + factoryBindingName + '.' + topicBindingName;
         return getManager(name, factory, new FactoryData(factoryName, providerURL, urlPkgPrefixes,
             securityPrincipalName, securityCredentials, factoryBindingName, topicBindingName, userName, password));
     }
 
 
     @Override
-    public void send(Serializable object) throws Exception {
+    public void send(final Serializable object) throws Exception {
         if (info == null) {
             info = connect(context, factoryBindingName, topicBindingName, userName, password, false);
         }
@@ -112,7 +112,7 @@ public class JMSTopicManager extends Abs
                 info.session.close();
                 info.conn.close();
             }
-        } catch (JMSException ex) {
+        } catch (final JMSException ex) {
             LOGGER.error("Error closing " + getName(), ex);
         }
     }
@@ -121,19 +121,19 @@ public class JMSTopicManager extends Abs
      * Data for the factory.
      */
     private static class FactoryData {
-        private String factoryName;
-        private String providerURL;
-        private String urlPkgPrefixes;
-        private String securityPrincipalName;
-        private String securityCredentials;
-        private String factoryBindingName;
-        private String topicBindingName;
-        private String userName;
-        private String password;
-
-        public FactoryData(String factoryName, String providerURL, String urlPkgPrefixes, String securityPrincipalName,
-                           String securityCredentials, String factoryBindingName, String topicBindingName,
-                           String userName, String password) {
+        private final String factoryName;
+        private final String providerURL;
+        private final String urlPkgPrefixes;
+        private final String securityPrincipalName;
+        private final String securityCredentials;
+        private final String factoryBindingName;
+        private final String topicBindingName;
+        private final String userName;
+        private final String password;
+
+        public FactoryData(final String factoryName, final String providerURL, final String urlPkgPrefixes, final String securityPrincipalName,
+                           final String securityCredentials, final String factoryBindingName, final String topicBindingName,
+                           final String userName, final String password) {
             this.factoryName = factoryName;
             this.providerURL = providerURL;
             this.urlPkgPrefixes = urlPkgPrefixes;
@@ -146,27 +146,27 @@ public class JMSTopicManager extends Abs
         }
     }
 
-    private static TopicInfo connect(Context context, String factoryBindingName, String queueBindingName,
-                                     String userName, String password, boolean suppress) throws Exception {
+    private static TopicInfo connect(final Context context, final String factoryBindingName, final String queueBindingName,
+                                     final String userName, final String password, final boolean suppress) throws Exception {
         try {
-            TopicConnectionFactory factory = (TopicConnectionFactory) lookup(context, factoryBindingName);
+            final TopicConnectionFactory factory = (TopicConnectionFactory) lookup(context, factoryBindingName);
             TopicConnection conn;
             if (userName != null) {
                 conn = factory.createTopicConnection(userName, password);
             } else {
                 conn = factory.createTopicConnection();
             }
-            TopicSession sess = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-            Topic topic = (Topic) lookup(context, queueBindingName);
-            TopicPublisher publisher = sess.createPublisher(topic);
+            final TopicSession sess = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+            final Topic topic = (Topic) lookup(context, queueBindingName);
+            final TopicPublisher publisher = sess.createPublisher(topic);
             conn.start();
             return new TopicInfo(conn, sess, publisher);
-        } catch (NamingException ex) {
+        } catch (final NamingException ex) {
             LOGGER.warn("Unable to locate connection factory " + factoryBindingName, ex);
             if (!suppress) {
                 throw ex;
             }
-        } catch (JMSException ex) {
+        } catch (final JMSException ex) {
             LOGGER.warn("Unable to create connection to queue " + queueBindingName, ex);
             if (!suppress) {
                 throw ex;
@@ -180,7 +180,7 @@ public class JMSTopicManager extends Abs
         private final TopicSession session;
         private final TopicPublisher publisher;
 
-        public TopicInfo(TopicConnection conn, TopicSession session, TopicPublisher publisher) {
+        public TopicInfo(final TopicConnection conn, final TopicSession session, final TopicPublisher publisher) {
             this.conn = conn;
             this.session = session;
             this.publisher = publisher;
@@ -192,17 +192,17 @@ public class JMSTopicManager extends Abs
      */
     private static class JMSTopicManagerFactory implements ManagerFactory<JMSTopicManager, FactoryData> {
 
-        public JMSTopicManager createManager(String name, FactoryData data) {
+        public JMSTopicManager createManager(final String name, final FactoryData data) {
             try {
-                Context ctx = createContext(data.factoryName, data.providerURL, data.urlPkgPrefixes,
+                final Context ctx = createContext(data.factoryName, data.providerURL, data.urlPkgPrefixes,
                     data.securityPrincipalName, data.securityCredentials);
-                TopicInfo info = connect(ctx, data.factoryBindingName, data.topicBindingName, data.userName,
+                final TopicInfo info = connect(ctx, data.factoryBindingName, data.topicBindingName, data.userName,
                     data.password, true);
                 return new JMSTopicManager(name, ctx, data.factoryBindingName, data.topicBindingName,
                     data.userName, data.password, info);
-            } catch (NamingException ex) {
+            } catch (final NamingException ex) {
                 LOGGER.error("Unable to locate resource", ex);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.error("Unable to connect", ex);
             }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicReceiver.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicReceiver.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicReceiver.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicReceiver.java Mon Dec 10 19:36:06 2012
@@ -42,22 +42,22 @@ public class JMSTopicReceiver extends Ab
      * @param username The userid to connect to the topic.
      * @param password The password to connect to the topic.
      */
-    public JMSTopicReceiver(String tcfBindingName, String topicBindingName, String username, String password) {
+    public JMSTopicReceiver(final String tcfBindingName, final String topicBindingName, final String username, final String password) {
         try {
-            Context ctx = new InitialContext();
+            final Context ctx = new InitialContext();
             TopicConnectionFactory topicConnectionFactory;
             topicConnectionFactory = (TopicConnectionFactory) lookup(ctx, tcfBindingName);
-            TopicConnection topicConnection = topicConnectionFactory.createTopicConnection(username, password);
+            final TopicConnection topicConnection = topicConnectionFactory.createTopicConnection(username, password);
             topicConnection.start();
-            TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-            Topic topic = (Topic) ctx.lookup(topicBindingName);
-            TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
+            final TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+            final Topic topic = (Topic) ctx.lookup(topicBindingName);
+            final TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
             topicSubscriber.setMessageListener(this);
-        } catch (JMSException e) {
+        } catch (final JMSException e) {
             logger.error("Could not read JMS message.", e);
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             logger.error("Could not read JMS message.", e);
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             logger.error("Could not read JMS message.", e);
         }
     }
@@ -67,23 +67,23 @@ public class JMSTopicReceiver extends Ab
      * @param args The command line arguments.
      * @throws Exception if an error occurs.
      */
-    public static void main(String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
         if (args.length != 4) {
             usage("Wrong number of arguments.");
         }
 
-        String tcfBindingName = args[0];
-        String topicBindingName = args[1];
-        String username = args[2];
-        String password = args[3];
+        final String tcfBindingName = args[0];
+        final String topicBindingName = args[1];
+        final String username = args[2];
+        final String password = args[3];
 
         new JMSTopicReceiver(tcfBindingName, topicBindingName, username, password);
 
-        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+        final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         // Loop until the word "exit" is typed
         System.out.println("Type \"exit\" to quit JMSTopicReceiver.");
         while (true) {
-            String s = stdin.readLine();
+            final String s = stdin.readLine();
             if (s.equalsIgnoreCase("exit")) {
                 System.out.println("Exiting. Kill the application if it does not exit "
                     + "due to daemon threads.");
@@ -92,7 +92,7 @@ public class JMSTopicReceiver extends Ab
         }
     }
 
-    private static void usage(String msg) {
+    private static void usage(final String msg) {
         System.err.println(msg);
         System.err.println("Usage: java " + JMSTopicReceiver.class.getName()
             + " TopicConnectionFactoryBindingName TopicBindingName username password");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Priority.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Priority.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Priority.java Mon Dec 10 19:36:06 2012
@@ -31,7 +31,7 @@ public class Priority {
      * @param facility The Facility.
      * @param severity The Severity.
      */
-    public Priority(Facility facility, Severity severity) {
+    public Priority(final Facility facility, final Severity severity) {
         this.facility = facility;
         this.severity = severity;
     }
@@ -42,7 +42,7 @@ public class Priority {
      * @param level The Level.
      * @return The integer value of the priority.
      */
-    public static int getPriority(Facility facility, Level level) {
+    public static int getPriority(final Facility facility, final Level level) {
         return (facility.getCode() << 3) + Severity.getSeverity(level).getCode();
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Protocol.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Protocol.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Protocol.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Protocol.java Mon Dec 10 19:36:06 2012
@@ -30,7 +30,7 @@ public enum Protocol {
      * @param name The enumeration name to check.
      * @return true if this enumeration has the specified name.
      */
-    public boolean isEqual(String name) {
+    public boolean isEqual(final String name) {
         return this.name().equalsIgnoreCase(name);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Severity.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Severity.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Severity.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/Severity.java Mon Dec 10 19:36:06 2012
@@ -53,7 +53,7 @@ public enum Severity {
 
     private final int code;
 
-    private Severity(int code) {
+    private Severity(final int code) {
         this.code = code;
     }
 
@@ -70,7 +70,7 @@ public enum Severity {
      * @param name the name to match.
      * @return true if the name matches, false otherwise.
      */
-    public boolean isEqual(String name) {
+    public boolean isEqual(final String name) {
         return this.name().equalsIgnoreCase(name);
     }
 
@@ -79,7 +79,7 @@ public enum Severity {
      * @param level The Level.
      * @return The matching Severity, or DEBUG if there is no match.
      */
-    public static Severity getSeverity(Level level) {
+    public static Severity getSeverity(final Level level) {
         switch (level) {
             case ALL:
                 return DEBUG;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java Mon Dec 10 19:36:06 2012
@@ -62,7 +62,7 @@ public class SocketServer extends Abstra
      * @param port to listen on.
      * @throws IOException If an error occurs.
      */
-    public SocketServer(int port) throws IOException {
+    public SocketServer(final int port) throws IOException {
         server = new ServerSocket(port);
         if (logger == null) {
             logger = LogManager.getLogger(this);
@@ -75,13 +75,13 @@ public class SocketServer extends Abstra
      * @param args The command line arguments.
      * @throws Exception if an error occurs.
      */
-    public static void main(String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
         if (args.length < 1 || args.length > 2) {
             System.err.println("Incorrect number of arguments");
             printUsage();
             return;
         }
-        int port = Integer.parseInt(args[0]);
+        final int port = Integer.parseInt(args[0]);
         if (port <= 0 || port >= MAX_PORT) {
             System.err.println("Invalid port number");
             printUsage();
@@ -91,12 +91,12 @@ public class SocketServer extends Abstra
             ConfigurationFactory.setConfigurationFactory(new ServerConfigurationFactory(args[1]));
         }
         logger = LogManager.getLogger(SocketServer.class.getName());
-        SocketServer sserver = new SocketServer(port);
-        Thread server = new Thread(sserver);
+        final SocketServer sserver = new SocketServer(port);
+        final Thread server = new Thread(sserver);
         server.start();
-        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
+        final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
         while (true) {
-            String line = reader.readLine();
+            final String line = reader.readLine();
             if (line.equalsIgnoreCase("Quit") || line.equalsIgnoreCase("Stop") || line.equalsIgnoreCase("Exit")) {
                 sserver.shutdown();
                 server.join();
@@ -124,27 +124,27 @@ public class SocketServer extends Abstra
         while (isActive) {
             try {
                 // Accept incoming connections.
-                Socket clientSocket = server.accept();
+                final Socket clientSocket = server.accept();
                 clientSocket.setSoLinger(true, 0);
 
                 // accept() will block until a client connects to the server.
                 // If execution reaches this point, then it means that a client
                 // socket has been accepted.
 
-                SocketHandler handler = new SocketHandler(clientSocket);
+                final SocketHandler handler = new SocketHandler(clientSocket);
                 handlers.put(handler.getId(), handler);
                 handler.start();
-            } catch (IOException ioe) {
+            } catch (final IOException ioe) {
                 System.out.println("Exception encountered on accept. Ignoring. Stack Trace :");
                 ioe.printStackTrace();
             }
         }
-        for (Map.Entry<Long, SocketHandler> entry : handlers.entrySet()) {
-            SocketHandler handler = entry.getValue();
+        for (final Map.Entry<Long, SocketHandler> entry : handlers.entrySet()) {
+            final SocketHandler handler = entry.getValue();
             handler.shutdown();
             try {
                 handler.join();
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 // Ignore the exception
             }
         }
@@ -158,7 +158,7 @@ public class SocketServer extends Abstra
 
         private boolean shutdown = false;
 
-        public SocketHandler(Socket socket) throws IOException {
+        public SocketHandler(final Socket socket) throws IOException {
 
             ois = new ObjectInputStream(socket.getInputStream());
         }
@@ -174,24 +174,24 @@ public class SocketServer extends Abstra
             try {
                 try {
                     while (!shutdown) {
-                        LogEvent event = (LogEvent) ois.readObject();
+                        final LogEvent event = (LogEvent) ois.readObject();
                         if (event != null) {
                             log(event);
                         }
                     }
-                } catch (EOFException eof) {
+                } catch (final EOFException eof) {
                     closed = true;
-                } catch (OptionalDataException opt) {
+                } catch (final OptionalDataException opt) {
                     logger.error("OptionalDataException eof=" + opt.eof + " length=" + opt.length, opt);
-                } catch (ClassNotFoundException cnfe) {
+                } catch (final ClassNotFoundException cnfe) {
                     logger.error("Unable to locate LogEvent class", cnfe);
-                } catch (IOException ioe) {
+                } catch (final IOException ioe) {
                     logger.error("IOException encountered while reading from socket", ioe);
                 }
                 if (!closed) {
                     try {
                         ois.close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         // Ignore the exception;
                     }
                 }
@@ -208,29 +208,29 @@ public class SocketServer extends Abstra
 
         private final String path;
 
-        public ServerConfigurationFactory(String path) {
+        public ServerConfigurationFactory(final String path) {
             this.path = path;
         }
 
         @Override
-        public Configuration getConfiguration(String name, URI configLocation) {
+        public Configuration getConfiguration(final String name, final URI configLocation) {
             if (path != null && path.length() > 0) {
                 File file = null;
                 ConfigurationSource source = null;
                 try {
                     file = new File(path);
-                    FileInputStream is = new FileInputStream(file);
+                    final FileInputStream is = new FileInputStream(file);
                     source = new ConfigurationSource(is, file);
-                } catch (FileNotFoundException ex) {
+                } catch (final FileNotFoundException ex) {
                     // Ignore this error
                 }
                 if (source == null) {
                     try {
-                        URL url = new URL(path);
+                        final URL url = new URL(path);
                         source = new ConfigurationSource(url.openStream(), path);
-                    } catch (MalformedURLException mue) {
+                    } catch (final MalformedURLException mue) {
                         // Ignore this error
-                    } catch (IOException ioe) {
+                    } catch (final IOException ioe) {
                         // Ignore this error
                     }
                 }
@@ -239,7 +239,7 @@ public class SocketServer extends Abstra
                     if (source != null) {
                         return new XMLConfiguration(source);
                     }
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     // Ignore this error.
                 }
                 System.err.println("Unable to process configuration at " + path + ", using default.");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java Mon Dec 10 19:36:06 2012
@@ -63,8 +63,8 @@ public class TCPSocketManager extends Ab
      * @param port The port number on the host.
      * @param delay Reconnection interval.
      */
-    public TCPSocketManager(String name, OutputStream os, Socket sock, InetAddress addr, String host, int port,
-                            int delay) {
+    public TCPSocketManager(final String name, final OutputStream os, final Socket sock, final InetAddress addr, final String host, final int port,
+                            final int delay) {
         super(name, os, addr, host, port);
         this.reconnectionDelay = delay;
         this.socket = sock;
@@ -84,7 +84,7 @@ public class TCPSocketManager extends Ab
      * @param delay The interval to pause between retries.
      * @return A TCPSocketManager.
      */
-    public static TCPSocketManager getSocketManager(String host, int port, int delay) {
+    public static TCPSocketManager getSocketManager(final String host, int port, int delay) {
         if (host == null || host.length() == 0) {
             throw new IllegalArgumentException("A host name is required");
         }
@@ -98,27 +98,27 @@ public class TCPSocketManager extends Ab
     }
 
     @Override
-    protected synchronized void write(byte[] bytes, int offset, int length)  {
+    protected synchronized void write(final byte[] bytes, final int offset, final int length)  {
         if (socket == null) {
             if (connector != null) {
                 connector.latch();
             }
             if (socket == null) {
-                String msg = "Error writing to " + getName() + " socket not available";
+                final String msg = "Error writing to " + getName() + " socket not available";
                 throw new AppenderRuntimeException(msg);
             }
         }
         try {
             getOutputStream().write(bytes, offset, length);
             socket.setSendBufferSize(length);
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             if (retry && connector == null) {
                 connector = new Reconnector(this);
                 connector.setDaemon(true);
                 connector.setPriority(Thread.MIN_PRIORITY);
                 connector.start();
             }
-            String msg = "Error writing to " + getName();
+            final String msg = "Error writing to " + getName();
             throw new AppenderRuntimeException(msg, ex);
         }
     }
@@ -144,14 +144,14 @@ public class TCPSocketManager extends Ab
 
         private final Object owner;
 
-        public Reconnector(OutputStreamManager owner) {
+        public Reconnector(final OutputStreamManager owner) {
             this.owner = owner;
         }
 
         public void latch()  {
             try {
                 latch.await();
-            } catch (InterruptedException ex) {
+            } catch (final InterruptedException ex) {
                 // Ignore the exception.
             }
         }
@@ -165,12 +165,12 @@ public class TCPSocketManager extends Ab
             while (!shutdown) {
                 try {
                     sleep(reconnectionDelay);
-                    Socket sock = new Socket(address, port);
-                    OutputStream newOS = sock.getOutputStream();
+                    final Socket sock = new Socket(address, port);
+                    final OutputStream newOS = sock.getOutputStream();
                     synchronized (owner) {
                         try {
                             getOutputStream().close();
-                        } catch (IOException ioe) {
+                        } catch (final IOException ioe) {
                             // Ignore this.
                         }
 
@@ -180,11 +180,11 @@ public class TCPSocketManager extends Ab
                         shutdown = true;
                     }
                     LOGGER.debug("Connection to " + host + ":" + port + " reestablished.");
-                } catch (InterruptedException ie) {
+                } catch (final InterruptedException ie) {
                     LOGGER.debug("Reconnection interrupted.");
-                } catch (ConnectException ex) {
+                } catch (final ConnectException ex) {
                     LOGGER.debug(host + ":" + port + " refused connection");
-                } catch (IOException ioe) {
+                } catch (final IOException ioe) {
                     LOGGER.debug("Unable to reconnect to " + host + ":" + port);
                 } finally {
                     latch.countDown();
@@ -197,11 +197,11 @@ public class TCPSocketManager extends Ab
      * Data for the factory.
      */
     private static class FactoryData {
-        private String host;
-        private int port;
-        private int delay;
+        private final String host;
+        private final int port;
+        private final int delay;
 
-        public FactoryData(String host, int port, int delay) {
+        public FactoryData(final String host, final int port, final int delay) {
             this.host = host;
             this.port = port;
             this.delay = delay;
@@ -213,21 +213,21 @@ public class TCPSocketManager extends Ab
      */
     private static class TCPSocketManagerFactory implements ManagerFactory<TCPSocketManager, FactoryData> {
 
-        public TCPSocketManager createManager(String name, FactoryData data) {
+        public TCPSocketManager createManager(final String name, final FactoryData data) {
 
             InetAddress address;
             OutputStream os = null;
             try {
                 address = InetAddress.getByName(data.host);
-            } catch (UnknownHostException ex) {
+            } catch (final UnknownHostException ex) {
                 LOGGER.error("Could not find address of " + data.host, ex);
                 return null;
             }
             try {
-                Socket socket = new Socket(data.host, data.port);
+                final Socket socket = new Socket(data.host, data.port);
                 os = socket.getOutputStream();
                 return new TCPSocketManager(name, os, socket, address, data.host, data.port, data.delay);
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
                 LOGGER.error("TCPSocketManager (" + name + ") " + ex);
                 os = new ByteArrayOutputStream();
             }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -67,7 +67,7 @@ public abstract class AbstractPatternCon
      * @param e null values are accepted
      * @return the name of the conversion pattern
      */
-    public String getStyleClass(Object e) {
+    public String getStyleClass(final Object e) {
         return style;
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractStyleNameConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractStyleNameConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractStyleNameConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractStyleNameConverter.java Mon Dec 10 19:36:06 2012
@@ -49,7 +49,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Black newInstance(Configuration config, final String[] options) {
+        public static Black newInstance(final Configuration config, final String[] options) {
             return newInstance(Black.class, NAME, config, options);
         }
 
@@ -61,7 +61,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Black(List<PatternFormatter> formatters, String styling) {
+        public Black(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -85,7 +85,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Blue newInstance(Configuration config, final String[] options) {
+        public static Blue newInstance(final Configuration config, final String[] options) {
             return newInstance(Blue.class, NAME, config, options);
         }
 
@@ -97,7 +97,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Blue(List<PatternFormatter> formatters, String styling) {
+        public Blue(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -121,7 +121,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Cyan newInstance(Configuration config, final String[] options) {
+        public static Cyan newInstance(final Configuration config, final String[] options) {
             return newInstance(Cyan.class, NAME, config, options);
         }
 
@@ -133,7 +133,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Cyan(List<PatternFormatter> formatters, String styling) {
+        public Cyan(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -157,7 +157,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Green newInstance(Configuration config, final String[] options) {
+        public static Green newInstance(final Configuration config, final String[] options) {
             return newInstance(Green.class, NAME, config, options);
         }
 
@@ -169,7 +169,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Green(List<PatternFormatter> formatters, String styling) {
+        public Green(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -193,7 +193,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Magenta newInstance(Configuration config, final String[] options) {
+        public static Magenta newInstance(final Configuration config, final String[] options) {
             return newInstance(Magenta.class, NAME, config, options);
         }
 
@@ -205,7 +205,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Magenta(List<PatternFormatter> formatters, String styling) {
+        public Magenta(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -229,7 +229,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Red newInstance(Configuration config, final String[] options) {
+        public static Red newInstance(final Configuration config, final String[] options) {
             return newInstance(Red.class, NAME, config, options);
         }
 
@@ -241,7 +241,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Red(List<PatternFormatter> formatters, String styling) {
+        public Red(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -265,7 +265,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static White newInstance(Configuration config, final String[] options) {
+        public static White newInstance(final Configuration config, final String[] options) {
             return newInstance(White.class, NAME, config, options);
         }
 
@@ -277,7 +277,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public White(List<PatternFormatter> formatters, String styling) {
+        public White(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -301,7 +301,7 @@ public abstract class AbstractStyleNameC
          *            formatted.
          * @return new instance of class or null
          */
-        public static Yellow newInstance(Configuration config, final String[] options) {
+        public static Yellow newInstance(final Configuration config, final String[] options) {
             return newInstance(Yellow.class, NAME, config, options);
         }
 
@@ -313,7 +313,7 @@ public abstract class AbstractStyleNameC
          * @param styling
          *            The styling that should encapsulate the pattern.
          */
-        public Yellow(List<PatternFormatter> formatters, String styling) {
+        public Yellow(final List<PatternFormatter> formatters, final String styling) {
             super(NAME, formatters, styling);
         }
     }
@@ -327,26 +327,26 @@ public abstract class AbstractStyleNameC
      *            The pattern options, may be null. If the first element is "short", only the first line of the throwable will be formatted.
      * @return new instance of class or null
      */
-    private static <T extends AbstractStyleNameConverter> T newInstance(Class<T> asnConverterClass, String name, Configuration config,
+    private static <T extends AbstractStyleNameConverter> T newInstance(final Class<T> asnConverterClass, final String name, final Configuration config,
             final String[] options) {
-        List<PatternFormatter> formatters = toPatternFormatterList(config, options);
+        final List<PatternFormatter> formatters = toPatternFormatterList(config, options);
         if (formatters == null) {
             return null;
         }
         try {
             final Constructor<T> constructor = asnConverterClass.getConstructor(List.class, String.class);
             return constructor.newInstance(formatters, AnsiEscape.createSequence(name));
-        } catch (SecurityException e) {
+        } catch (final SecurityException e) {
             LOGGER.error(e.toString(), e);
-        } catch (NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) {
             LOGGER.error(e.toString(), e);
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             LOGGER.error(e.toString(), e);
-        } catch (InstantiationException e) {
+        } catch (final InstantiationException e) {
             LOGGER.error(e.toString(), e);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             LOGGER.error(e.toString(), e);
-        } catch (InvocationTargetException e) {
+        } catch (final InvocationTargetException e) {
             LOGGER.error(e.toString(), e);
         }
         return null;
@@ -361,12 +361,12 @@ public abstract class AbstractStyleNameC
      *            pattern options
      * @return a list of PatternFormatter from the given configuration and options or null if no pattern is supplied.
      */
-    private static List<PatternFormatter> toPatternFormatterList(Configuration config, final String[] options) {
+    private static List<PatternFormatter> toPatternFormatterList(final Configuration config, final String[] options) {
         if (options.length == 0 || options[0] == null) {
             LOGGER.error("No pattern supplied on style for config=" + config);
             return null;
         }
-        PatternParser parser = PatternLayout.createPatternParser(config);
+        final PatternParser parser = PatternLayout.createPatternParser(config);
         if (parser == null) {
             LOGGER.error("No PatternParser created for config=" + config + ", options=" + options);
             return null;
@@ -386,7 +386,7 @@ public abstract class AbstractStyleNameC
      * @param styling
      *            The styling that should encapsulate the pattern.
      */
-    protected AbstractStyleNameConverter(String name, List<PatternFormatter> formatters, String styling) {
+    protected AbstractStyleNameConverter(final String name, final List<PatternFormatter> formatters, final String styling) {
         super(name, "style");
         this.formatters = formatters;
         this.style = styling;
@@ -397,8 +397,8 @@ public abstract class AbstractStyleNameC
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        StringBuilder buf = new StringBuilder();
-        for (PatternFormatter formatter : formatters) {
+        final StringBuilder buf = new StringBuilder();
+        for (final PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
         if (buf.length() > 0) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java Mon Dec 10 19:36:06 2012
@@ -83,7 +83,7 @@ public enum AnsiEscape {
     
     private final String code;
 
-    private AnsiEscape(String code) {
+    private AnsiEscape(final String code) {
         this.code = code;
     }
 
@@ -91,7 +91,7 @@ public enum AnsiEscape {
         return PREFIX.getCode() + SUFFIX.getCode();
     }
 
-    private static String toRegexSeparator(String separator) {
+    private static String toRegexSeparator(final String separator) {
         return WHITESPACE_REGEX + separator + WHITESPACE_REGEX;
     }
 
@@ -121,7 +121,7 @@ public enum AnsiEscape {
      *            do not escape these keys, leave the values as is in the map
      * @return a new map
      */
-    public static Map<String, String> createMap(String values, String[] dontEscapeKeys) {
+    public static Map<String, String> createMap(final String values, final String[] dontEscapeKeys) {
         return createMap(values.split(toRegexSeparator(",")), dontEscapeKeys);
     }
 
@@ -147,12 +147,12 @@ public enum AnsiEscape {
      *            do not escape these keys, leave the values as is in the map
      * @return a new map
      */
-    public static Map<String, String> createMap(String[] values, String[] dontEscapeKeys) {
+    public static Map<String, String> createMap(final String[] values, final String[] dontEscapeKeys) {
         final String[] sortedIgnoreKeys = dontEscapeKeys != null ? dontEscapeKeys.clone() : new String[0];
         Arrays.sort(sortedIgnoreKeys);
-        Map<String, String> map = new HashMap<String, String>();
-        for (String string : values) {
-            String[] keyValue = string.split(toRegexSeparator("="));
+        final Map<String, String> map = new HashMap<String, String>();
+        for (final String string : values) {
+            final String[] keyValue = string.split(toRegexSeparator("="));
             if (keyValue.length > 1) {
                 final String key = keyValue[0].toUpperCase(Locale.ENGLISH);
                 final String value = keyValue[1];
@@ -170,21 +170,21 @@ public enum AnsiEscape {
      *            {@linkplain AnsiEscape} names.
      * @return An ANSI escape sequence.
      */
-    public static String createSequence(String... names) {
+    public static String createSequence(final String... names) {
         if (names == null) {
             return getDefaultStyle();
         }
-        StringBuilder sb = new StringBuilder(AnsiEscape.PREFIX.getCode());
+        final StringBuilder sb = new StringBuilder(AnsiEscape.PREFIX.getCode());
         boolean first = true;
-        for (String name : names) {
+        for (final String name : names) {
             try {
-                AnsiEscape escape = AnsiEscape.valueOf(name.trim().toUpperCase(Locale.ENGLISH));
+                final AnsiEscape escape = AnsiEscape.valueOf(name.trim().toUpperCase(Locale.ENGLISH));
                 if (!first) {
                     sb.append(AnsiEscape.SEPARATOR.getCode());
                 }
                 first = false;
                 sb.append(escape.getCode());
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 // Ignore the error.
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/CachedDateFormat.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/CachedDateFormat.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/CachedDateFormat.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/CachedDateFormat.java Mon Dec 10 19:36:06 2012
@@ -111,7 +111,7 @@ final class CachedDateFormat extends Dat
     /**
      * Cache of previous conversion.
      */
-    private StringBuffer cache = new StringBuffer(BUF_SIZE);
+    private final StringBuffer cache = new StringBuffer(BUF_SIZE);
 
     /**
      * Maximum validity period for the cache.
@@ -176,7 +176,7 @@ final class CachedDateFormat extends Dat
             slotBegin -= MILLIS_IN_SECONDS;
         }
 
-        int millis = (int) (time - slotBegin);
+        final int millis = (int) (time - slotBegin);
 
         int magic = MAGIC1;
         String magicString = MAGICSTRING1;
@@ -186,7 +186,7 @@ final class CachedDateFormat extends Dat
             magicString = MAGICSTRING2;
         }
 
-        String plusMagic = formatter.format(new Date(slotBegin + magic));
+        final String plusMagic = formatter.format(new Date(slotBegin + magic));
 
         /**
          *   If the string lengths differ then
@@ -200,10 +200,10 @@ final class CachedDateFormat extends Dat
                 if (formatted.charAt(i) != plusMagic.charAt(i)) {
                     //
                     //   determine the expected digits for the base time
-                    StringBuffer formattedMillis = new StringBuffer("ABC");
+                    final StringBuffer formattedMillis = new StringBuffer("ABC");
                     millisecondFormat(millis, formattedMillis, 0);
 
-                    String plusZero = formatter.format(new Date(slotBegin));
+                    final String plusZero = formatter.format(new Date(slotBegin));
 
                     //   If the next 3 characters match the magic
                     //      string and the expected string
@@ -235,7 +235,7 @@ final class CachedDateFormat extends Dat
      * @return the formatted time string.
      */
     @Override
-    public StringBuffer format(Date date, StringBuffer sbuf, FieldPosition fieldPosition) {
+    public StringBuffer format(final Date date, final StringBuffer sbuf, final FieldPosition fieldPosition) {
         format(date.getTime(), sbuf);
 
         return sbuf;
@@ -248,7 +248,7 @@ final class CachedDateFormat extends Dat
      * @param buf the string buffer to write to.
      * @return the formatted time string.
      */
-    public StringBuffer format(long now, StringBuffer buf) {
+    public StringBuffer format(final long now, final StringBuffer buf) {
         //
         // If the current requested time is identical to the previously
         //     requested time, then append the cache contents.
@@ -349,7 +349,7 @@ final class CachedDateFormat extends Dat
      * @return parsed date, likely null.
      */
     @Override
-    public Date parse(String s, ParsePosition pos) {
+    public Date parse(final String s, final ParsePosition pos) {
         return formatter.parse(s, pos);
     }
 
@@ -377,7 +377,7 @@ final class CachedDateFormat extends Dat
         //      (for example, "HH:mm:ss,SSS SSS"), then set the expiration to
         //      one millisecond which should only perform duplicate request caching.
         //
-        int firstS = pattern.indexOf('S');
+        final int firstS = pattern.indexOf('S');
 
         if ((firstS >= 0) && (firstS != pattern.lastIndexOf("SSS"))) {
             return 1;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -57,7 +57,7 @@ public final class ClassNamePatternConve
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        StackTraceElement element = event.getSource();
+        final StackTraceElement element = event.getSource();
         if (element == null) {
             toAppendTo.append(NA);
         } else {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -128,7 +128,7 @@ public final class DatePatternConverter 
         
         try {
             tempFormat = new SimpleDateFormat(pattern);
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             LOGGER.warn("Could not instantiate SimpleDateFormat with pattern " + patternOption, e);
 
             // default to the ISO8601 format
@@ -137,7 +137,7 @@ public final class DatePatternConverter 
 
         // if the option list contains a TZ option, then set it.
         if ((options != null) && (options.length > 1)) {
-            TimeZone tz = TimeZone.getTimeZone(options[1]);
+            final TimeZone tz = TimeZone.getTimeZone(options[1]);
             tempFormat.setTimeZone(tz);
         }
         simpleFormat = tempFormat; 
@@ -158,7 +158,7 @@ public final class DatePatternConverter 
      */
     @Override
     public void format(final LogEvent event, final StringBuilder output) {
-        long timestamp = event.getMillis();
+        final long timestamp = event.getMillis();
 
         synchronized (this) {
             if (timestamp != lastTimestamp) {
@@ -169,8 +169,8 @@ public final class DatePatternConverter 
         output.append(cachedDate);
     }
 
-    public void format(final StringBuilder toAppendTo, Object... objects) {
-        for (Object obj : objects) {
+    public void format(final StringBuilder toAppendTo, final Object... objects) {
+        for (final Object obj : objects) {
             if (obj instanceof Date) {
                 format(obj, toAppendTo);
                 break;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -50,11 +50,11 @@ public final class ExtendedThrowablePatt
         List<String> tempPackages = null;
         if (options != null && options.length > 1) {
             if (options[1].startsWith(FILTERS) && options[1].endsWith(")")) {
-                String filterStr = options[1].substring(FILTERS.length(), options[1].length() - 1);
-                String[] array = filterStr.split(",");
+                final String filterStr = options[1].substring(FILTERS.length(), options[1].length() - 1);
+                final String[] array = filterStr.split(",");
                 if (array.length > 0) {
                     tempPackages = new ArrayList<String>(array.length);
-                    for (String token : array) {
+                    for (final String token : array) {
                         tempPackages.add(token.trim());
                     }
                 }
@@ -74,10 +74,10 @@ public final class ExtendedThrowablePatt
         String type = null;
         String[] array = options;
         if (options != null && options.length == 1 && options[0].length() > 0) {
-            String[] opts = options[0].split(",", 2);
-            String first = opts[0].trim();
+            final String[] opts = options[0].split(",", 2);
+            final String first = opts[0].trim();
             String filter;
-            Scanner scanner = new Scanner(first);
+            final Scanner scanner = new Scanner(first);
             if (first.equalsIgnoreCase(FULL) || first.equalsIgnoreCase(SHORT) || scanner.hasNextInt()) {
                 type = first;
                 filter = opts[1].trim();
@@ -95,21 +95,21 @@ public final class ExtendedThrowablePatt
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        Throwable throwable = event.getThrown();
+        final Throwable throwable = event.getThrown();
         if (throwable != null) {
             if (!(throwable instanceof ThrowableProxy)) {
                 super.format(event, toAppendTo);
                 return;
             }
-            ThrowableProxy t = (ThrowableProxy) throwable;
-            String trace = t.getExtendedStackTrace(packages);
-            int len = toAppendTo.length();
+            final ThrowableProxy t = (ThrowableProxy) throwable;
+            final String trace = t.getExtendedStackTrace(packages);
+            final int len = toAppendTo.length();
             if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                 toAppendTo.append(" ");
             }
             if (lines > 0) {
-                StringBuilder sb = new StringBuilder();
-                String[] array = trace.split("\n");
+                final StringBuilder sb = new StringBuilder();
+                final String[] array = trace.split("\n");
                 for (int i = 0; i < lines; ++i) {
                     sb.append(array[i]).append("\n");
                 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileLocationPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileLocationPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileLocationPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileLocationPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -54,7 +54,7 @@ public final class FileLocationPatternCo
      */
     @Override
     public void format(final LogEvent event, final StringBuilder output) {
-        StackTraceElement element = event.getSource();
+        final StackTraceElement element = event.getSource();
 
         if (element != null) {
             output.append(element.getFileName());

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FullLocationPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FullLocationPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FullLocationPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FullLocationPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -54,7 +54,7 @@ public final class FullLocationPatternCo
      */
     @Override
     public void format(final LogEvent event, final StringBuilder output) {
-        StackTraceElement element = event.getSource();
+        final StackTraceElement element = event.getSource();
 
         if (element != null) {
             output.append(element.toString());

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java Mon Dec 10 19:36:06 2012
@@ -128,9 +128,9 @@ public final class HighlightConverter ex
         if (options.length < 2) {
             return DEFAULT_STYLES;
         }
-        Map<String, String> styles = AnsiEscape.createMap(options[1], new String[] { STYLE_KEY });
-        EnumMap<Level, String> levelStyles = new EnumMap<Level, String>(DEFAULT_STYLES);
-        for (Map.Entry<String, String> entry : styles.entrySet()) {
+        final Map<String, String> styles = AnsiEscape.createMap(options[1], new String[] { STYLE_KEY });
+        final EnumMap<Level, String> levelStyles = new EnumMap<Level, String>(DEFAULT_STYLES);
+        for (final Map.Entry<String, String> entry : styles.entrySet()) {
             final String key = entry.getKey().toUpperCase(Locale.ENGLISH);
             final String value = entry.getValue();
             if (STYLE_KEY.equalsIgnoreCase(key)) {
@@ -161,7 +161,7 @@ public final class HighlightConverter ex
      *            pattern options, may be null. If first element is "short", only the first line of the throwable will be formatted.
      * @return instance of class.
      */
-    public static HighlightConverter newInstance(Configuration config, final String[] options) {
+    public static HighlightConverter newInstance(final Configuration config, final String[] options) {
         if (options.length < 1) {
             LOGGER.error("Incorrect number of options on style. Expected at least 1, received " + options.length);
             return null;
@@ -170,8 +170,8 @@ public final class HighlightConverter ex
             LOGGER.error("No pattern supplied on style");
             return null;
         }
-        PatternParser parser = PatternLayout.createPatternParser(config);
-        List<PatternFormatter> formatters = parser.parse(options[0]);
+        final PatternParser parser = PatternLayout.createPatternParser(config);
+        final List<PatternFormatter> formatters = parser.parse(options[0]);
         return new HighlightConverter(formatters, createLevelStyleMap(options));
     }
 
@@ -185,7 +185,7 @@ public final class HighlightConverter ex
      * @param formatters
      *            The PatternFormatters to generate the text to manipulate.
      */
-    private HighlightConverter(List<PatternFormatter> formatters, EnumMap<Level, String> levelStyles) {
+    private HighlightConverter(final List<PatternFormatter> formatters, final EnumMap<Level, String> levelStyles) {
         super("style", "style");
         this.formatters = formatters;
         this.levelStyles = levelStyles;
@@ -196,8 +196,8 @@ public final class HighlightConverter ex
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        StringBuilder buf = new StringBuilder();
-        for (PatternFormatter formatter : formatters) {
+        final StringBuilder buf = new StringBuilder();
+        for (final PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -51,8 +51,8 @@ public final class IntegerPatternConvert
         return INSTANCE;
     }
 
-    public void format(final StringBuilder toAppendTo, Object... objects) {
-        for (Object obj : objects) {
+    public void format(final StringBuilder toAppendTo, final Object... objects) {
+        for (final Object obj : objects) {
             if (obj instanceof Integer) {
                 format(obj, toAppendTo);
                 break;
@@ -63,7 +63,7 @@ public final class IntegerPatternConvert
     /**
      * {@inheritDoc}
      */
-    public void format(Object obj, final StringBuilder toAppendTo) {
+    public void format(final Object obj, final StringBuilder toAppendTo) {
         if (obj instanceof Integer) {
             toAppendTo.append(obj.toString());
         }



Mime
View raw message