logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1584470 [3/3] - in /logging/log4j/log4j2/trunk: log4j-1.2-api/src/test/java/org/apache/log4j/ log4j-api/src/main/java/org/apache/logging/log4j/ log4j-api/src/main/java/org/apache/logging/log4j/message/ log4j-api/src/main/java/org/apache/lo...
Date Thu, 03 Apr 2014 23:34:34 GMT
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
Thu Apr  3 23:34:32 2014
@@ -138,7 +138,7 @@ public class PerfTestDriver {
                 detail = _threadCount + " threads";
             }
             final String target = _runner.substring(_runner.indexOf(".Run") + 4);
-            return target + ": " + _name + " (" + detail + ")";
+            return target + ": " + _name + " (" + detail + ')';
         }
     }
 
@@ -214,7 +214,7 @@ public class PerfTestDriver {
         final String LOG12 = RunLog4j1.class.getName();
         final String LOG20 = RunLog4j2.class.getName();
         final String LOGBK = RunLogback.class.getName();
-        
+
         final String THREADNAME = "-DAsyncLogger.ThreadNameStrategy=" //
                 + System.getProperty("AsyncLogger.ThreadNameStrategy", "CACHED");
 
@@ -338,7 +338,7 @@ public class PerfTestDriver {
     private static void runPerfTest(final int repeat, final int setupIndex, final Setup config,
             final ProcessBuilder pb) throws IOException, InterruptedException {
         for (int i = 0; i < repeat; i++) {
-            System.out.print(" (" + (i + 1) + "/" + repeat + ")...");
+            System.out.print(" (" + (i + 1) + '/' + repeat + ")...");
             final Process process = pb.start();
 
             final boolean[] stop = { false };
@@ -346,7 +346,7 @@ public class PerfTestDriver {
             process.waitFor();
             stop[0] = true;
 
-            final File gc = new File("gc" + setupIndex + "_" + i
+            final File gc = new File("gc" + setupIndex + '_' + i
                     + config._log4jConfig + ".log");
             if (gc.exists()) {
                 gc.delete();

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java
Thu Apr  3 23:34:32 2014
@@ -75,7 +75,7 @@ class PerfTestResultFormatter {
         sb.append(LF);
         for (int i = 0; i < 3; i++) {
             for (final String subKey : subKeys) {
-                sb.append("\t").append(subKey);
+                sb.append('\t').append(subKey);
             }
         }
         sb.append(LF);
@@ -87,13 +87,13 @@ class PerfTestResultFormatter {
                     final Stats stats = sub.get(subKey);
                     switch (i) {
                     case 0:
-                        sb.append("\t").append((long) stats.avgLatency);
+                        sb.append('\t').append((long) stats.avgLatency);
                         break;
                     case 1:
-                        sb.append("\t").append((long) stats.latency99Pct);
+                        sb.append('\t').append((long) stats.latency99Pct);
                         break;
                     case 2:
-                        sb.append("\t").append((long) stats.latency99_99Pct);
+                        sb.append('\t').append((long) stats.latency99_99Pct);
                         break;
                     }
                 }
@@ -109,7 +109,7 @@ class PerfTestResultFormatter {
         sb.append("\tThroughput per thread (msg/sec)");
         sb.append(LF);
         for (final String subKey : subKeys) {
-            sb.append("\t").append(subKey);
+            sb.append('\t').append(subKey);
         }
         sb.append(LF);
         for (final String key : results.keySet()) {
@@ -117,7 +117,7 @@ class PerfTestResultFormatter {
             final Map<String, Stats> sub = results.get(key);
             for (final String subKey : sub.keySet()) {
                 final Stats stats = sub.get(subKey);
-                sb.append("\t").append(stats.throughput);
+                sb.append('\t').append(stats.throughput);
             }
             sb.append(LF);
         }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptionsTest.java
Thu Apr  3 23:34:32 2014
@@ -136,7 +136,7 @@ public final class ThrowableFormatOption
      */
     @Test
     public void testSeparatorAsDefaultLineSeparator() {
-        test(new String[]{"separator(" + Constants.LINE_SEP + ")"}, Integer.MAX_VALUE, Constants.LINE_SEP,
null);
+        test(new String[]{"separator(" + Constants.LINE_SEP + ')'}, Integer.MAX_VALUE, Constants.LINE_SEP,
null);
     }
 
     /**

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java
Thu Apr  3 23:34:32 2014
@@ -154,6 +154,6 @@ public class JSONLayoutTest {
 
     private void checkAt(String expected, int lineIndex, List<String> list) {
         final String trimedLine = list.get(lineIndex).trim();
-        assertTrue("Incorrect line index " + lineIndex + ": \"" + trimedLine + "\"", trimedLine.equals(expected));
+        assertTrue("Incorrect line index " + lineIndex + ": \"" + trimedLine + '"', trimedLine.equals(expected));
     }
 }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
Thu Apr  3 23:34:32 2014
@@ -211,7 +211,7 @@ public class PatternLayoutTest {
             "org.apache.logging.log4j.core.Logger", Level.INFO, new SimpleMessage("Hello,
world 1!"), null);
         byte[] header = layout.getHeader();
         assertNotNull("No header", header);
-        assertTrue("expected \"Hello world Header\", actual \"" + new String(header) + "\"",
new String(header).equals(new String("Hello world Header")));
+        assertTrue("expected \"Hello world Header\", actual \"" + new String(header) + '"',
new String(header).equals(new String("Hello world Header")));
     }
 
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/util/Compare.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/util/Compare.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/util/Compare.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/util/Compare.java
Thu Apr  3 23:34:32 2014
@@ -116,7 +116,7 @@ public class Compare {
         String s1;
         int lineCounter = 0;
         System.out.println("--------------------------------");
-        System.out.println("Contents of " + file + ":");
+        System.out.println("Contents of " + file + ':');
 
         while ((s1 = in1.readLine()) != null) {
             lineCounter++;

Modified: logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
Thu Apr  3 23:34:32 2014
@@ -93,12 +93,12 @@ public class FlumeAvroManager extends Ab
         boolean first = true;
         for (final Agent agent : agents) {
             if (!first) {
-                sb.append(",");
+                sb.append(',');
             }
-            sb.append(agent.getHost()).append(":").append(agent.getPort());
+            sb.append(agent.getHost()).append(':').append(agent.getPort());
             first = false;
         }
-        sb.append("]");
+        sb.append(']');
         return getManager(sb.toString(), factory,
                 new FactoryData(name, agents, batchSize, retries, connectTimeout, requestTimeout));
     }
@@ -147,13 +147,13 @@ public class FlumeAvroManager extends Ab
             } catch (final Exception ex) {
                 rpcClient.close();
                 rpcClient = null;
-                final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ":" +
+                final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ':' +
                     agents[current].getPort();
                 LOGGER.warn(msg, ex);
                 throw new AppenderLoggingException("No Flume agents are available");
             }
         }  else {
-            final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ":" +
+            final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ':' +
                 agents[current].getPort();
             LOGGER.warn(msg);
             throw new AppenderLoggingException("No Flume agents are available");
@@ -172,13 +172,13 @@ public class FlumeAvroManager extends Ab
             } catch (final Exception ex) {
                 rpcClient.close();
                 rpcClient = null;
-                final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ":" +
+                final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ':' +
                     agents[current].getPort();
                 LOGGER.warn(msg, ex);
                 throw new AppenderLoggingException("No Flume agents are available");
             }
         } else {
-            final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ":" +
+            final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost()
+ ':' +
                 agents[current].getPort();
             LOGGER.warn(msg);
             throw new AppenderLoggingException("No Flume agents are available");
@@ -201,10 +201,10 @@ public class FlumeAvroManager extends Ab
             final StringBuilder sb = new StringBuilder();
             for (final Agent agent : agents) {
                 if (sb.length() > 0) {
-                    sb.append(" ");
+                    sb.append(' ');
                 }
                 final String hostName = "host" + count++;
-                props.put("hosts." + hostName, agent.getHost() + ":" + agent.getPort());
+                props.put("hosts." + hostName, agent.getHost() + ':' + agent.getPort());
                 sb.append(hostName);
             }
             props.put("hosts", sb.toString());

Modified: logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedManager.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedManager.java
Thu Apr  3 23:34:32 2014
@@ -85,22 +85,22 @@ public class FlumeEmbeddedManager extend
         boolean first = true;
 
         if (agents != null && agents.length > 0) {
-            sb.append(name).append("[");
+            sb.append(name).append('[');
             for (final Agent agent : agents) {
                 if (!first) {
-                    sb.append("_");
+                    sb.append('_');
                 }
-                sb.append(agent.getHost()).append("-").append(agent.getPort());
+                sb.append(agent.getHost()).append('-').append(agent.getPort());
                 first = false;
             }
-            sb.append("]");
+            sb.append(']');
         } else {
             String sep = "";
-            sb.append(name).append("-");
+            sb.append(name).append('-');
             final StringBuilder props = new StringBuilder();
             for (final Property prop : properties) {
                 props.append(sep);
-                props.append(prop.getName()).append("=").append(prop.getValue());
+                props.append(prop.getName()).append('=').append(prop.getValue());
                 sep = "_";
             }
             sb.append(NameUtil.md5(props.toString()));

Modified: logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
Thu Apr  3 23:34:32 2014
@@ -163,13 +163,13 @@ public class FlumePersistentManager exte
         boolean first = true;
         for (final Agent agent : agents) {
             if (!first) {
-                sb.append(",");
+                sb.append(',');
             }
-            sb.append(agent.getHost()).append(":").append(agent.getPort());
+            sb.append(agent.getHost()).append(':').append(agent.getPort());
             first = false;
         }
-        sb.append("]");
-        sb.append(" ").append(dataDirectory);
+        sb.append(']');
+        sb.append(' ').append(dataDirectory);
         return getManager(sb.toString(), factory, new FactoryData(name, agents, batchSize,
retries,
             connectionTimeout, requestTimeout, delay, lockTimeoutRetryCount, dataDir, properties));
     }

Modified: logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java?rev=1584470&r1=1584469&r2=1584470&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
Thu Apr  3 23:34:32 2014
@@ -61,7 +61,7 @@ import org.apache.logging.log4j.core.jmx
 /**
  * Swing GUI that connects to a Java process via JMX and allows the user to view
  * and modify the Log4j 2 configuration, as well as monitor status logs.
- * 
+ *
  * @see <a href=
  *      "http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html"
  *      >http://docs.oracle.com/javase/6/docs/technotes/guides/management/
@@ -111,7 +111,7 @@ public class ClientGUI extends JPanel im
             JTextArea text = createTextArea();
             final String[] messages = status.getStatusDataHistory();
             for (final String message : messages) {
-                text.append(message + "\n");
+                text.append(message + '\n');
             }
             statusLogTextAreaMap.put(ctx.getObjectName(), text);
             registerListeners(status);
@@ -189,7 +189,7 @@ public class ClientGUI extends JPanel im
         if (StatusLoggerAdminMBean.NOTIF_TYPE_MESSAGE.equals(notif.getType())) {
             JTextArea text = statusLogTextAreaMap.get(paramObject);
             if (text != null) {
-                text.append(notif.getMessage() + "\n");
+                text.append(notif.getMessage() + '\n');
             }
             return;
         }
@@ -206,7 +206,7 @@ public class ClientGUI extends JPanel im
 
     /**
      * Called every time a Log4J2 MBean was registered in the MBean server.
-     * 
+     *
      * @param mbeanName ObjectName of the registered Log4J2 MBean
      */
     private void onMBeanRegistered(ObjectName mbeanName) {
@@ -222,7 +222,7 @@ public class ClientGUI extends JPanel im
 
     /**
      * Called every time a Log4J2 MBean was unregistered from the MBean server.
-     * 
+     *
      * @param mbeanName ObjectName of the unregistered Log4J2 MBean
      */
     private void onMBeanUnregistered(ObjectName mbeanName) {
@@ -250,7 +250,7 @@ public class ClientGUI extends JPanel im
      * Useful links:
      * http://www.componative.com/content/controller/developer/insights
      * /jconsole3/
-     * 
+     *
      * @param args must have at least one parameter, which specifies the
      *            location to connect to. Must be of the form {@code host:port}
      *            or {@code service:jmx:rmi:///jndi/rmi://<host>:<port>/jmxrmi}



Mime
View raw message