commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1432547 - in /commons/proper/logging/trunk/src: java/org/apache/commons/logging/impl/AvalonLogger.java java/org/apache/commons/logging/impl/LogFactoryImpl.java test/org/apache/commons/logging/log4j/log4j12/TestAppender.java
Date Sun, 13 Jan 2013 04:39:04 GMT
Author: ggregory
Date: Sun Jan 13 04:39:03 2013
New Revision: 1432547

URL: http://svn.apache.org/viewvc?rev=1432547&view=rev
Log:
Convert control statement bodies to block.

Modified:
    commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/AvalonLogger.java
    commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
    commons/proper/logging/trunk/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java

Modified: commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/AvalonLogger.java
URL: http://svn.apache.org/viewvc/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/AvalonLogger.java?rev=1432547&r1=1432546&r2=1432547&view=diff
==============================================================================
--- commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/AvalonLogger.java
(original)
+++ commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/AvalonLogger.java
Sun Jan 13 04:39:03 2013
@@ -74,8 +74,9 @@ public class AvalonLogger implements Log
      * @param name the name of the avalon logger implementation to delegate to
      */
     public AvalonLogger(String name) {
-        if (defaultLogger == null)
+        if (defaultLogger == null) {
             throw new NullPointerException("default logger has to be specified if this constructor
is used!");
+        }
         this.logger = defaultLogger.getChildLogger(name);
     }
 
@@ -106,7 +107,9 @@ public class AvalonLogger implements Log
     * @see org.apache.commons.logging.Log#debug(Object, Throwable)
      */
     public void debug(Object message, Throwable t) {
-        if (getLogger().isDebugEnabled()) getLogger().debug(String.valueOf(message), t);
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug(String.valueOf(message), t);
+        }
     }
 
     /**
@@ -116,7 +119,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#debug(Object)
      */
     public void debug(Object message) {
-        if (getLogger().isDebugEnabled()) getLogger().debug(String.valueOf(message));
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug(String.valueOf(message));
+        }
     }
 
     /**
@@ -127,7 +132,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#error(Object, Throwable)
      */
     public void error(Object message, Throwable t) {
-        if (getLogger().isErrorEnabled()) getLogger().error(String.valueOf(message), t);
+        if (getLogger().isErrorEnabled()) {
+            getLogger().error(String.valueOf(message), t);
+        }
     }
 
     /**
@@ -137,7 +144,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#error(Object)
      */
     public void error(Object message) {
-        if (getLogger().isErrorEnabled()) getLogger().error(String.valueOf(message));
+        if (getLogger().isErrorEnabled()) {
+            getLogger().error(String.valueOf(message));
+        }
     }
 
     /**
@@ -148,7 +157,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#fatal(Object, Throwable)
      */
     public void fatal(Object message, Throwable t) {
-        if (getLogger().isFatalErrorEnabled()) getLogger().fatalError(String.valueOf(message),
t);
+        if (getLogger().isFatalErrorEnabled()) {
+            getLogger().fatalError(String.valueOf(message), t);
+        }
     }
 
     /**
@@ -158,7 +169,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#fatal(Object)
      */
     public void fatal(Object message) {
-        if (getLogger().isFatalErrorEnabled()) getLogger().fatalError(String.valueOf(message));
+        if (getLogger().isFatalErrorEnabled()) {
+            getLogger().fatalError(String.valueOf(message));
+        }
     }
 
     /**
@@ -169,7 +182,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#info(Object, Throwable)
      */
     public void info(Object message, Throwable t) {
-        if (getLogger().isInfoEnabled()) getLogger().info(String.valueOf(message), t);
+        if (getLogger().isInfoEnabled()) {
+            getLogger().info(String.valueOf(message), t);
+        }
     }
 
     /**
@@ -179,7 +194,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#info(Object)
      */
     public void info(Object message) {
-        if (getLogger().isInfoEnabled()) getLogger().info(String.valueOf(message));
+        if (getLogger().isInfoEnabled()) {
+            getLogger().info(String.valueOf(message));
+        }
     }
 
     /**
@@ -238,7 +255,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#trace(Object, Throwable)
      */
     public void trace(Object message, Throwable t) {
-        if (getLogger().isDebugEnabled()) getLogger().debug(String.valueOf(message), t);
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug(String.valueOf(message), t);
+        }
     }
 
     /**
@@ -248,7 +267,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#trace(Object)
      */
     public void trace(Object message) {
-        if (getLogger().isDebugEnabled()) getLogger().debug(String.valueOf(message));
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug(String.valueOf(message));
+        }
     }
 
     /**
@@ -259,7 +280,9 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#warn(Object, Throwable)
      */
     public void warn(Object message, Throwable t) {
-        if (getLogger().isWarnEnabled()) getLogger().warn(String.valueOf(message), t);
+        if (getLogger().isWarnEnabled()) {
+            getLogger().warn(String.valueOf(message), t);
+        }
     }
 
     /**
@@ -269,6 +292,8 @@ public class AvalonLogger implements Log
      * @see org.apache.commons.logging.Log#warn(Object)
      */
     public void warn(Object message) {
-        if (getLogger().isWarnEnabled()) getLogger().warn(String.valueOf(message));
+        if (getLogger().isWarnEnabled()) {
+            getLogger().warn(String.valueOf(message));
+        }
     }
 }

Modified: commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java?rev=1432547&r1=1432546&r2=1432547&view=diff
==============================================================================
--- commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
(original)
+++ commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
Sun Jan 13 04:39:03 2013
@@ -739,8 +739,9 @@ public class LogFactoryImpl extends LogF
      */
     private boolean getBooleanConfiguration(String key, boolean dflt) {
         String val = getConfigurationValue(key);
-        if (val == null)
+        if (val == null) {
             return dflt;
+        }
         return Boolean.valueOf(val).booleanValue();
     }
 
@@ -1234,19 +1235,22 @@ public class LogFactoryImpl extends LogF
     private ClassLoader getLowestClassLoader(ClassLoader c1, ClassLoader c2) {
         // TODO: use AccessController when dealing with classloaders here
         
-        if (c1 == null)
+        if (c1 == null) {
             return c2;
+        }
         
-        if (c2 == null)
+        if (c2 == null) {
             return c1;
+        }
         
         ClassLoader current;
 
         // scan c1's ancestors to find c2
         current = c1;
         while (current != null) {
-            if (current == c2)
+            if (current == c2) {
                 return c1;
+            }
             // current = current.getParent();
             current = getParentClassLoader(current);
         }
@@ -1254,8 +1258,9 @@ public class LogFactoryImpl extends LogF
         // scan c2's ancestors to find c1
         current = c2;
         while (current != null) {
-            if (current == c1)
+            if (current == c1) {
                 return c2;
+            }
             // current = current.getParent();
             current = getParentClassLoader(current);
         }

Modified: commons/proper/logging/trunk/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java
URL: http://svn.apache.org/viewvc/commons/proper/logging/trunk/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java?rev=1432547&r1=1432546&r2=1432547&view=diff
==============================================================================
--- commons/proper/logging/trunk/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java
(original)
+++ commons/proper/logging/trunk/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java
Sun Jan 13 04:39:03 2013
@@ -54,15 +54,17 @@ public class TestAppender extends Append
         
         lev.level = event.getLevel().toString();
 
-        if (event.getMessage() == null)
+        if (event.getMessage() == null) {
             lev.msg = null;
-        else
+        } else {
             lev.msg = event.getMessage().toString();
+        }
         
-        if (event.getThrowableInformation() == null)
+        if (event.getThrowableInformation() == null) {
             lev.throwable = null;
-        else
+        } else {
             lev.throwable = event.getThrowableInformation().getThrowable();
+        }
 
         events.add(lev);
     }



Mime
View raw message