[jboss-svn-commits] JBoss Common SVN: r2785 - in common-logging-log4j/trunk/src/main/java/org/jboss/logging: appender and 4 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Mar 31 11:12:39 EDT 2008


Author: adrian at jboss.org
Date: 2008-03-31 11:12:39 -0400 (Mon, 31 Mar 2008)
New Revision: 2785

Modified:
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/appender/RegexEventEvaluator.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/filter/TCLFilter.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/PatternParserEx.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadMDCConverter.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadNDCConverter.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jNDCProvider.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryStream.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryWriter.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerStream.java
   common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerWriter.java
Log:
Sourcecode tidyup

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -40,17 +40,26 @@
  */
 public class XLevel extends Level
 {
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+
    /** The integer representation of the level, ({@link Level#TRACE_INT} - 100) */
+   @SuppressWarnings("hiding")
    public static final int TRACE_INT = Level.TRACE_INT - 100;
 
    /** The string name of the trace level. */
    public static final String TRACE_STR = "TRACE";
    
    /** The TRACE level object singleton */
+   @SuppressWarnings("hiding")
    public static final XLevel TRACE = new XLevel(TRACE_INT, TRACE_STR, 7);
 
    /**
     * Construct a <tt>XLevel</tt>.
+    * 
+    * @param level the level
+    * @param strLevel ???
+    * @param syslogEquiv the system log equivalent
     */
    protected XLevel(final int level, final String strLevel, final int syslogEquiv)
    {

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/appender/RegexEventEvaluator.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/appender/RegexEventEvaluator.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/appender/RegexEventEvaluator.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -37,7 +37,7 @@
 public class RegexEventEvaluator implements TriggeringEventEvaluator
 {
    /** A cache HashMap<String, RE> of previously compiled REs */
-   private HashMap regexMap = new HashMap();
+   private HashMap<String, Pattern> regexMap = new HashMap<String, Pattern>();
 
    /** Lookup the current MDC 'RegexEventEvaluator' to determine the regular
     * expression context that should be applied to determine if the logging
@@ -55,7 +55,7 @@
       if( regex != null )
       {
          // Look for a cached regex pattern
-         Pattern re = (Pattern) regexMap.get(regex);
+         Pattern re = regexMap.get(regex);
          if( re == null )
          {
             re = Pattern.compile(regex);

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/filter/TCLFilter.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/filter/TCLFilter.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/filter/TCLFilter.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -149,8 +149,8 @@
       URL[] urls = {};
       try
       {
-         Class returnType = urls.getClass();
-         Class[] parameterTypes = {};
+         Class<?> returnType = urls.getClass();
+         Class<?>[] parameterTypes = {};
          Method getURLs = cl.getClass().getMethod("getURLs", parameterTypes);
          if( returnType.isAssignableFrom(getURLs.getReturnType()) )
          {

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/PatternParserEx.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/PatternParserEx.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/PatternParserEx.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -55,7 +55,9 @@
  */
 public class PatternParserEx extends PatternParser
 {
-   /** Creates a new instance of PatternParser */
+   /** Creates a new instance of PatternParser
+    * @param pattern the patatern
+    */
    public PatternParserEx(String pattern)
    {
       super(pattern);

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadMDCConverter.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadMDCConverter.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadMDCConverter.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -35,7 +35,10 @@
 public class ThreadMDCConverter extends PatternConverter
 {
    private String key;
-   /** Creates a new instance of ThreadMDCPatternConverter */
+   /** Creates a new instance of ThreadMDCPatternConverter
+    * @param formattingInfo the formatting info
+    * @param key the key 
+    */
    public ThreadMDCConverter(FormattingInfo formattingInfo, String key)
    {
       super(formattingInfo);

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadNDCConverter.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadNDCConverter.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/layout/ThreadNDCConverter.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -34,7 +34,9 @@
  */
 public class ThreadNDCConverter extends PatternConverter
 {
-   /** Creates a new instance of ThreadMDCPatternConverter */
+   /** Creates a new instance of ThreadMDCPatternConverter
+    * @param formattingInfo the formatting info
+    */
    public ThreadNDCConverter(FormattingInfo formattingInfo)
    {
       super(formattingInfo);

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -79,6 +79,8 @@
 
    /**
     * Exposes the delegate Log4j Logger.
+    * 
+    * @return the underlying logger
     */
    public org.apache.log4j.Logger getLogger()
    {
@@ -119,6 +121,7 @@
     * @return true if a {@link #trace(Object)} method invocation would pass
     * the msg to the configured appenders, false otherwise.
     */
+   @Deprecated
    public boolean isDebugEnabled()
    {
       Level l = Level.DEBUG;
@@ -151,6 +154,7 @@
     * @return true if a {@link #info(Object)} method invocation would pass
     * the msg to the configured appenders, false otherwise.
     */
+   @Deprecated
    public boolean isInfoEnabled()
    {
       Level l = Level.INFO;
@@ -235,6 +239,8 @@
     * Issue a log msg with the given level.
     * Invokes log.log(p, message);
     *
+    * @param p the priority
+    * @param message the message
     * @deprecated  Use Level versions.
     */
    public void log(Priority p, Object message)
@@ -246,6 +252,10 @@
     * Issue a log msg with the given priority.
     * Invokes log.log(p, message, t);
     *
+    *
+    * @param p the priority
+    * @param message the message
+    * @param t the throwable
     * @deprecated  Use Level versions.
     */
    public void log(Priority p, Object message, Throwable t)
@@ -256,6 +266,9 @@
    /**
     * Issue a log msg with the given level.
     * Invokes log.log(l, message);
+    * 
+    * @param l the level
+    * @param message the message
     */
    public void log(Level l, Object message)
    {
@@ -265,6 +278,10 @@
    /**
     * Issue a log msg with the given level.
     * Invokes log.log(l, message, t);
+    * 
+    * @param l the level
+    * @param message the message
+    * @param t the throwable
     */
    public void log(Level l, Object message, Throwable t)
    {

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jNDCProvider.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jNDCProvider.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jNDCProvider.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -21,8 +21,6 @@
  */
 package org.jboss.logging.log4j;
 
-import java.util.Stack;
-
 import org.apache.log4j.NDC;
 import org.jboss.logging.NDCProvider;
 

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryStream.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryStream.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryStream.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -40,6 +40,7 @@
  * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
  * @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
  */
+ at SuppressWarnings("deprecation")
 public class CategoryStream
     extends PrintStream
 {
@@ -66,6 +67,8 @@
    
    /**
     * Redirect logging to the indicated category using Priority.INFO
+    * 
+    * @param category the category
     */
    public CategoryStream(final Category category)
    {
@@ -75,6 +78,10 @@
    /**
     * Redirect logging to the indicated category using the given
     * priority. The ps is simply passed to super but is not used.
+    * 
+    * @param category the category
+    * @param priority the priority
+    * @param ps the print stream
     */
    public CategoryStream(final Category category,
                          final Priority priority,
@@ -107,10 +114,10 @@
       write(bytes, 0, 1);
    }
 
-   private ThreadLocal recursiveCheck = new ThreadLocal();
+   private ThreadLocal<Boolean> recursiveCheck = new ThreadLocal<Boolean>();
    public void write(byte[] b, int off, int len)
    {
-      Boolean recursed = (Boolean)recursiveCheck.get();
+      Boolean recursed = recursiveCheck.get();
       if (recursed != null && recursed.equals(Boolean.TRUE))
       {
          /* There is a configuration error that is causing looping. Most

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryWriter.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryWriter.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/CategoryWriter.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -42,12 +42,9 @@
  * @created    August 19, 2001
  * @version    $$
  */
+ at SuppressWarnings("deprecation")
 public class CategoryWriter
        extends PrintWriter {
-   private Category category;
-   private Priority priority;
-   private boolean  inWrite;
-   private boolean  issuedWarning;
 
    /**
     *  Redirect logging to the indicated category using Priority.INFO

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerStream.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerStream.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerStream.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -60,11 +60,12 @@
    
    private Logger logger;
    private Level level;
-   private boolean inWrite;
    private boolean issuedWarning;
    
    /**
     * Redirect logging to the indicated logger using Level.INFO
+    * 
+    * @param logger the logger
     */
    public LoggerStream(final Logger logger)
    {
@@ -74,6 +75,10 @@
    /**
     * Redirect logging to the indicated logger using the given
     * level. The ps is simply passed to super but is not used.
+    * 
+    * @param logger the logger
+    * @param level the level
+    * @param ps the stream
     */
    public LoggerStream(final Logger logger,
                        final Level level,
@@ -106,10 +111,10 @@
       write(bytes, 0, 1);
    }
     
-   private ThreadLocal recursiveCheck = new ThreadLocal();
+   private ThreadLocal<Boolean> recursiveCheck = new ThreadLocal<Boolean>();
    public void write(byte[] b, int off, int len)
    {
-      Boolean recursed = (Boolean)recursiveCheck.get();
+      Boolean recursed = recursiveCheck.get();
       if (recursed != null && recursed.equals(Boolean.TRUE))
       {
          /* There is a configuration error that is causing looping. Most

Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerWriter.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerWriter.java	2008-03-31 15:01:38 UTC (rev 2784)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/util/LoggerWriter.java	2008-03-31 15:12:39 UTC (rev 2785)
@@ -43,11 +43,6 @@
 public class LoggerWriter
    extends PrintWriter
 {
-   private Logger logger;
-   private Level level;
-   private boolean  inWrite;
-   private boolean  issuedWarning;
-
    /**
     *  Redirect logging to the indicated logger using Level.INFO
     *




More information about the jboss-svn-commits mailing list