logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1562691 - in /logging/log4j/log4j2/trunk/log4j-core/src: main/java/org/apache/logging/log4j/core/net/ main/java/org/apache/logging/log4j/core/net/ssl/ test/java/org/apache/logging/log4j/core/appender/ test/java/org/apache/logging/log4j/cor...
Date Thu, 30 Jan 2014 04:23:34 GMT
Author: ggregory
Date: Thu Jan 30 04:23:34 2014
New Revision: 1562691

URL: http://svn.apache.org/r1562691
Log:
Convert control statement bodies to block.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TLSSocketManager.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SSLConfiguration.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/TLSSyslogAppenderTest.java
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTLSSyslogServer.java
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/LegacyBSDTLSSyslogInputStreamReader.java
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogInputStreamReader.java
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogTestUtil.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TLSSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TLSSocketManager.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TLSSocketManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TLSSocketManager.java
Thu Jan 30 04:23:34 2014
@@ -100,10 +100,11 @@ public class TLSSocketManager extends TC
     private static SSLSocketFactory createSSLSocketFactory(SSLConfiguration sslConf) {
         SSLSocketFactory socketFactory;
 
-        if (sslConf != null)
+        if (sslConf != null) {
             socketFactory = sslConf.getSSLSocketFactory();
-        else
+        } else {
             socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
+        }
 
         return socketFactory;
     }
@@ -152,8 +153,9 @@ public class TLSSocketManager extends TC
         }
 
         private void checkDelay(int delay, OutputStream os) throws TLSSocketManagerFactoryException
{
-            if (delay == 0 && os == null)
+            if (delay == 0 && os == null) {
                 throw new TLSSocketManagerFactoryException();
+            }
         }
 
         private Socket createSocket(TLSFactoryData data) throws IOException {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
Thu Jan 30 04:23:34 2014
@@ -74,8 +74,9 @@ public class KeyStoreConfiguration exten
         }
         finally {
             try {
-                if (fin != null)
+                if (fin != null) {
                     fin.close();
+                }
             } catch (IOException e) {
             }
         }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SSLConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SSLConfiguration.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SSLConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SSLConfiguration.java
Thu Jan 30 04:23:34 2014
@@ -163,8 +163,9 @@ public class SSLConfiguration {
         KeyStore trustStore = null;
         TrustManagerFactory tmFactory = null;
 
-        if (trustStoreConfig == null)
+        if (trustStoreConfig == null) {
             throw new TrustStoreConfigurationException(new Exception("The trustStoreConfiguration
is null"));
+        }
 
         try {
             trustStore = trustStoreConfig.getTrustStore();
@@ -188,8 +189,9 @@ public class SSLConfiguration {
         KeyStore keyStore = null;
         KeyManagerFactory kmFactory = null;
 
-        if (keyStoreConfig == null)
+        if (keyStoreConfig == null) {
             throw new KeyStoreConfigurationException(new Exception("The keyStoreConfiguration
is null"));
+        }
 
         try {
             keyStore = keyStoreConfig.getKeyStore();
@@ -213,21 +215,24 @@ public class SSLConfiguration {
     }
 
     public boolean equals(SSLConfiguration config) {
-        if (config == null)
+        if (config == null) {
             return false;
+        }
 
         boolean keyStoreEquals = false;
         boolean trustStoreEquals = false;
 
-        if (keyStoreConfig != null)
+        if (keyStoreConfig != null) {
             keyStoreEquals = keyStoreConfig.equals(config.keyStoreConfig);
-        else
+        } else {
             keyStoreEquals = keyStoreConfig == config.keyStoreConfig;
+        }
 
-        if (trustStoreConfig != null)
+        if (trustStoreConfig != null) {
             trustStoreEquals = trustStoreConfig.equals(config.trustStoreConfig);
-        else
+        } else {
             trustStoreEquals = trustStoreConfig == config.trustStoreConfig;
+        }
 
         return keyStoreEquals && trustStoreEquals;
     }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
Thu Jan 30 04:23:34 2014
@@ -45,10 +45,11 @@ public class StoreConfiguration {
     }
 
     public char[] getPasswordAsCharArray() {
-        if (password == null)
+        if (password == null) {
             return null;
-        else
+        } else {
             return password.toCharArray();
+        }
     }
 
     public void setPassword(String password) {
@@ -56,21 +57,24 @@ public class StoreConfiguration {
     }
 
     public boolean equals(StoreConfiguration config) {
-        if (config == null)
+        if (config == null) {
             return false;
+        }
 
         boolean locationEquals = false;
         boolean passwordEquals = false;
 
-        if (location != null)
+        if (location != null) {
             locationEquals = location.equals(config.location);
-        else
+        } else {
             locationEquals = location == config.location;
+        }
 
-        if (password != null)
+        if (password != null) {
             passwordEquals = password.equals(config.password);
-        else
+        } else {
             passwordEquals = password == config.password;
+        }
 
         return locationEquals && passwordEquals;
     }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
Thu Jan 30 04:23:34 2014
@@ -56,8 +56,9 @@ public class SyslogAppenderTestBase {
     }
 
     protected void sendAndCheckLegacyBSDMessages(List<String> messagesToSend) throws
InterruptedException {
-        for (String message : messagesToSend)
+        for (String message : messagesToSend) {
             sendLegacyBSDMessage(message);
+        }
         checkTheNumberOfSentAndReceivedMessages();
         checkTheEqualityOfSentAndReceivedMessages();
     }
@@ -74,8 +75,9 @@ public class SyslogAppenderTestBase {
     }
 
     protected void sendAndCheckStructuredMessages(int numberOfMessages) throws InterruptedException
{
-        for (int i = 0; i < numberOfMessages; i++)
+        for (int i = 0; i < numberOfMessages; i++) {
             sendStructuredMessage();
+        }
         checkTheNumberOfSentAndReceivedMessages();
         checkTheEqualityOfSentAndReceivedMessages();
     }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/TLSSyslogAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/TLSSyslogAppenderTest.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/TLSSyslogAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/TLSSyslogAppenderTest.java
Thu Jan 30 04:23:34 2014
@@ -83,10 +83,11 @@ public class TLSSyslogAppenderTest exten
     private TLSSyslogAppender createAppender() {
         String format;
 
-        if (messageFormat == TLSSyslogMessageFormat.LEGACY_BSD)
+        if (messageFormat == TLSSyslogMessageFormat.LEGACY_BSD) {
             format = "LEGACY_BSD";
-        else
+        } else {
             format = "RFC5424";
+        }
 
         return TLSSyslogAppender.createAppender("localhost", PORT, sslConfig, "-1", null,
"Test", "true", "false", "LOCAL0", "Audit",
                 "18060", "true", "RequestContext", null, null, includeNewLine, null, "TestApp",
"Test", null, "ipAddress,loginId",

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTLSSyslogServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTLSSyslogServer.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTLSSyslogServer.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/mock/MockTLSSyslogServer.java
Thu Jan 30 04:23:34 2014
@@ -111,8 +111,9 @@ public class MockTLSSyslogServer extends
                 message = syslogReader.read();
                 messageList.add(message);
                 count++;
-                if (isEndOfMessages(count))
+                if (isEndOfMessages(count)) {
                     break;
+                }
             }
             this.notify();
         }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/LegacyBSDTLSSyslogInputStreamReader.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/LegacyBSDTLSSyslogInputStreamReader.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/LegacyBSDTLSSyslogInputStreamReader.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/LegacyBSDTLSSyslogInputStreamReader.java
Thu Jan 30 04:23:34 2014
@@ -35,11 +35,13 @@ public class LegacyBSDTLSSyslogInputStre
         try {
             while (true) {
                 int b = inputStream.read();
-                if (b == -1)
+                if (b == -1) {
                     throw new EOFException("The stream has been closed or the end of stream
has been reached");
+                }
                 buffer.write(b);
-                if (b == '\n')
+                if (b == '\n') {
                     break;
+                }
             }
         }
         catch (EOFException e) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogInputStreamReader.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogInputStreamReader.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogInputStreamReader.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogInputStreamReader.java
Thu Jan 30 04:23:34 2014
@@ -72,8 +72,9 @@ public class TLSSyslogInputStreamReader 
     private void readBytesUntilNextSpace() throws IOException {
         for (int i = 0; i < lengthBufferSize; i++) {
             int b = inputStream.read();
-            if (b < 0)
+            if (b < 0) {
                 throw new EOFException("The stream has been closed or the end of stream has
been reached");
+            }
             byte currentByte = (byte)(b & 0xff);
             if (currentByte == SPACE) {
                 position = i;

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogTestUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogTestUtil.java?rev=1562691&r1=1562690&r2=1562691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogTestUtil.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TLSSyslogTestUtil.java
Thu Jan 30 04:23:34 2014
@@ -66,8 +66,9 @@ public class TLSSyslogTestUtil {
     public static int getRandomInt(int max) {
         Random random = new Random();
         int n = random.nextInt(max);
-        if (n < 0)
+        if (n < 0) {
             return -n;
+        }
         return n;
     }
 }



Mime
View raw message