[logback-dev] svn commit: r1175 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core main/java/ch/qos/logback/core/helpers main/java/ch/qos/logback/core/html main/java/ch/qos/logback/core/joran/action main/java/ch/qos/logback/core/layout main/java/ch/qos/logback/core/net main/java/ch/qos/logback/core/pattern main/java/ch/qos/logback/core/read main/java/ch/qos/logback/core/rolling main/java/ch/qos/logback/core/spi test/java/ch/qos/logback/core/appender test/java/ch/qos/logback/core/layout test/java/ch/qos/logback/core/pattern/parser test/java/ch/qos/logback/core/rolling

noreply.ceki at qos.ch noreply.ceki at qos.ch
Mon Jan 8 23:16:28 CET 2007


Author: ceki
Date: Mon Jan  8 23:16:27 2007
New Revision: 1175

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Appender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Layout.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/LayoutBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/helpers/CyclicBuffer.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractLayoutAction.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderAction.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/ConversionRuleAction.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/layout/EchoLayout.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/ListAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachable.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/AbstractAppenderTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/ConsoleAppenderTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppender.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppenderTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/DummyLayout.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/NopLayout.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/RenamingTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeBasedRollingTest.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/TimeBasedRollingTest.java

Log:
The Appender and Layout interfaces are now generic. This is a change with wide implications in the code.


Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Appender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Appender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Appender.java	Mon Jan  8 23:16:27 2007
@@ -14,7 +14,7 @@
 import ch.qos.logback.core.spi.LifeCycle;
   
 
-public interface Appender extends LifeCycle, ContextAware, FilterAttachable {
+public interface Appender<E> extends LifeCycle, ContextAware, FilterAttachable {
 
   /**
    * Get the name of this appender. The name uniquely identifies the appender.
@@ -26,17 +26,17 @@
    * is of type Object.
    * @param event
    */
-  void doAppend(Object event);
+  void doAppend(E event);
 
   /**
    * Set the {@link Layout} for this appender.
    */
-  public void setLayout(Layout layout);
+  public void setLayout(Layout<E> layout);
 
   /**
    * Returns this appenders layout.
    */
-  public Layout getLayout();
+  public Layout<E> getLayout();
 
   /**
    * Set the name of this appender. The name is used by other components to

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java	Mon Jan  8 23:16:27 2007
@@ -24,8 +24,8 @@
  *
  * @author Ceki G&uuml;lc&uuml;
  */
-abstract public class AppenderBase extends ContextAwareBase implements
-    Appender, FilterAttachable {
+abstract public class AppenderBase<E> extends ContextAwareBase implements
+    Appender<E>, FilterAttachable {
 
   protected boolean started = false;
 
@@ -52,7 +52,7 @@
   static final int ALLOWED_REPEATS = 5;
 
   
-  public synchronized void doAppend(Object eventObject) {
+  public synchronized void doAppend(E eventObject) {
     // WARNING: The guard check MUST be the first statement in the
     // doAppend() method.
 
@@ -89,7 +89,7 @@
     }
   }
 
-  abstract protected void append(Object eventObject);
+  abstract protected void append(E eventObject);
 
   /**
    * Set the name of this appender.
@@ -130,10 +130,10 @@
     return fai.getFilterChainDecision(event);
   }
   
-  public Layout getLayout() {
+  public Layout<E> getLayout() {
     return null;
   }
 
-  public void setLayout(Layout layout) {
+  public void setLayout(Layout<E> layout) {
   }
 }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java	Mon Jan  8 23:16:27 2007
@@ -24,7 +24,7 @@
  * @author Ceki G&uuml;lc&uuml;
  */
 
-public class ConsoleAppender extends WriterAppender {
+public class ConsoleAppender<E> extends WriterAppender<E> {
 
     public static final String SYSTEM_OUT = "System.out";
     public static final String SYSTEM_ERR = "System.err";

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java	Mon Jan  8 23:16:27 2007
@@ -24,7 +24,7 @@
  * 
  * @author Ceki G&uuml;lc&uuml;
  */
-public class FileAppender extends WriterAppender {
+public class FileAppender<E> extends WriterAppender<E> {
 
   /**
    * Append to or truncate the file? The default value for this variable is

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Layout.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Layout.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/Layout.java	Mon Jan  8 23:16:27 2007
@@ -12,7 +12,7 @@
 import ch.qos.logback.core.spi.ContextAware;
 import ch.qos.logback.core.spi.LifeCycle;
 
-public interface Layout extends ContextAware, LifeCycle {
+public interface Layout<E> extends ContextAware, LifeCycle {
   // Note that the line.separator property can be looked up even by applets.
   public static final String LINE_SEP = System.getProperty("line.separator");
   public static final int LINE_SEP_LEN = LINE_SEP.length();
@@ -28,7 +28,7 @@
    * @param event The event to format
    * @return the event formatted as a String
    */
-  String doLayout(Object event);
+  String doLayout(E event);
   
   /**
    * Return the file header for this layout. The returned value may be null.

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/LayoutBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/LayoutBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/LayoutBase.java	Mon Jan  8 23:16:27 2007
@@ -11,7 +11,7 @@
 
 import ch.qos.logback.core.spi.ContextAwareBase;
 
-abstract public class LayoutBase extends ContextAwareBase implements Layout  {
+abstract public class LayoutBase<E> extends ContextAwareBase implements Layout<E>  {
 
   Context context;
   protected boolean started;

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java	Mon Jan  8 23:16:27 2007
@@ -25,7 +25,7 @@
  *
  * @author Ceki G&uuml;lc&uuml;
  */
-public class WriterAppender extends AppenderBase {
+public class WriterAppender<E> extends AppenderBase<E> {
 
   /**
    * Immediate flush means that the underlying writer or output stream will be
@@ -58,7 +58,7 @@
    * The layout variable does not need to be set if the appender implementation
    * has its own layout.
    */
-  protected Layout layout;
+  protected Layout<E> layout;
 
   /**
    * The default constructor does nothing.
@@ -115,7 +115,8 @@
     }
   }
 
-  protected void append(Object eventObject) {
+  @Override
+  protected void append(E eventObject) {
     if (!isStarted()) {
       return;
     }
@@ -192,14 +193,14 @@
    * Set the layout for this appender. Note that some appenders have their own
    * (fixed) layouts or do not use any.
    */
-  public void setLayout(Layout layout) {
+  public void setLayout(Layout<E> layout) {
     this.layout = layout;
   }
 
   /**
    * Returns the layout of this appender. The value may be null.
    */
-  public Layout getLayout() {
+  public Layout<E> getLayout() {
     return layout;
   }
 
@@ -275,7 +276,7 @@
    * 
    * @since 0.9.0
    */
-  protected void subAppend(Object event) {
+  protected void subAppend(E event) {
     if (!isStarted()) {
       return;
     }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/helpers/CyclicBuffer.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/helpers/CyclicBuffer.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/helpers/CyclicBuffer.java	Mon Jan  8 23:16:27 2007
@@ -21,9 +21,9 @@
  * 
  * @author Ceki G&uuml;lc&uuml;
  */
-public class CyclicBuffer {
+public class CyclicBuffer<E> {
 
-  Object[] ea;
+  E[] ea;
   int first;
   int last;
   int numElems;
@@ -37,13 +37,14 @@
    * @param maxSize
    *          The maximum number of elements in the buffer.
    */
+  @SuppressWarnings("unchecked")
   public CyclicBuffer(int maxSize) throws IllegalArgumentException {
     if (maxSize < 1) {
       throw new IllegalArgumentException("The maxSize argument (" + maxSize
           + ") is not a positive integer.");
     }
     this.maxSize = maxSize;
-    ea = new Object[maxSize];
+    ea = (E[]) new Object[maxSize];
     first = 0;
     last = 0;
     numElems = 0;
@@ -53,7 +54,7 @@
    * Add an <code>event</code> as the last event in the buffer.
    * 
    */
-  public void add(Object event) {
+  public void add(E event) {
     ea[last] = event;
     if (++last == maxSize)
       last = 0;
@@ -85,8 +86,8 @@
    * Get the oldest (first) element in the buffer. The oldest element is removed
    * from the buffer.
    */
-  public Object get() {
-    Object r = null;
+  public E get() {
+    E r = null;
     if (numElems > 0) {
       numElems--;
       r = ea[first];
@@ -111,6 +112,7 @@
    * @throws IllegalArgumentException
    *           if <code>newSize</code> is negative.
    */
+  @SuppressWarnings("unchecked")
   public void resize(int newSize) {
     if (newSize < 0) {
       throw new IllegalArgumentException("Negative array size [" + newSize
@@ -119,7 +121,8 @@
     if (newSize == numElems)
       return; // nothing to do
 
-    Object[] temp = new Object[newSize];
+    // 
+    E[] temp = (E[]) new Object[newSize];
 
     int loopLen = newSize < numElems ? newSize : numElems;
 

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java	Mon Jan  8 23:16:27 2007
@@ -14,7 +14,7 @@
  *
  * @author S&eacute;bastien Pennec
  */
-public abstract class HTMLLayoutBase extends LayoutBase {
+public abstract class HTMLLayoutBase<E> extends LayoutBase<E> {
 
   protected String pattern;
 
@@ -81,7 +81,7 @@
     }
 
     if (errorCount == 0) {
-      started = true;
+      super.started = true;
     }
   }
   

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java	Mon Jan  8 23:16:27 2007
@@ -100,6 +100,7 @@
    * Once the children elements are also parsed, now is the time to activate
    * the evaluator options.
    */
+  @SuppressWarnings("unchecked")
   public void end(InterpretationContext ec, String e) {
     if (inError) {
       return;
@@ -119,7 +120,7 @@
       ec.popObject();
 
       try {
-        Map<String, EventEvaluator> evaluatorMap = (Map) context.getObject(CoreGlobal.EVALUATOR_MAP);
+        Map<String, EventEvaluator> evaluatorMap = (Map<String, EventEvaluator>) context.getObject(CoreGlobal.EVALUATOR_MAP);
         evaluatorMap.put(evaluator.getName(), evaluator);
       } catch (Exception ex) {
         addError(

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractLayoutAction.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractLayoutAction.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractLayoutAction.java	Mon Jan  8 23:16:27 2007
@@ -1,7 +1,7 @@
 /**
  * LOGBack: the generic, reliable, fast and flexible logging framework.
  * 
- * Copyright (C) 1999-2006, QOS.ch
+ * Copyright (C) 1999-2007, QOS.ch
  * 
  * This library is free software, you can redistribute it and/or modify it under
  * the terms of the GNU Lesser General Public License as published by the Free
@@ -20,35 +20,28 @@
 import ch.qos.logback.core.spi.LifeCycle;
 import ch.qos.logback.core.util.OptionHelper;
 
-
-
-abstract public class AbstractLayoutAction extends Action {
-  Layout layout;
+abstract public class AbstractLayoutAction<E> extends Action {
+  Layout<E> layout;
   boolean inError = false;
 
   /**
    * Instantiates an layout of the given class and sets its name.
    *
    */
+  @SuppressWarnings("unchecked")
   public void begin(InterpretationContext ec, String name, Attributes attributes) {
     // Let us forget about previous errors (in this object)
     inError = false;
 
     String className = attributes.getValue(CLASS_ATTRIBUTE);
     try {
-      layout = (Layout)
+      layout = (Layout<E>)
         OptionHelper.instantiateByClassName(
           className, ch.qos.logback.core.Layout.class, context);
       
-      if(isOfCorrectType(layout)) {
         layout.setContext(this.context);
         //getLogger().debug("Pushing layout on top of the object stack.");
         ec.pushObject(layout);        
-      } else {
-        inError = true;
-        addError("Layout of class ["+className+"] is not of the desired type");
-      }
-
     } catch (Exception oops) {
       inError = true;
       addError("Could not create layout of type " + className + "].", oops);
@@ -60,12 +53,13 @@
    * @param layout
    * @return true if the layout is of the correct type
    */
-  abstract protected boolean isOfCorrectType(Layout layout);
+  //abstract protected boolean isOfCorrectType(Layout layout);
   
   /**
    * Once the children elements are also parsed, now is the time to activate
    * the appender options.
    */
+  @SuppressWarnings("unchecked")
   public void end(InterpretationContext ec, String e) {
     if (inError) {
       return;
@@ -86,7 +80,7 @@
       try {
         //getLogger().debug(
         //  "About to set the layout of the containing appender.");
-        Appender appender = (Appender) ec.peekObject();
+        Appender<E> appender = (Appender<E>) ec.peekObject();
         appender.setLayout(layout);
       } catch (Exception ex) {
         addError(

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderAction.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderAction.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderAction.java	Mon Jan  8 23:16:27 2007
@@ -22,7 +22,7 @@
 
 
 
-public class AppenderAction extends Action {
+public class AppenderAction<E> extends Action {
   Appender appender;
   private boolean inError = false;
 
@@ -31,6 +31,7 @@
    *
    * The appender thus generated is placed in the ExecutionContext appender bag.
    */
+  @SuppressWarnings("unchecked")
   public void begin(
     InterpretationContext ec, String localName, Attributes attributes) throws ActionException {
     String className = attributes.getValue(CLASS_ATTRIBUTE);

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java	Mon Jan  8 23:16:27 2007
@@ -24,6 +24,7 @@
 public class AppenderRefAction extends Action {
   boolean inError = false;
 
+  @SuppressWarnings("unchecked")
   public void begin(InterpretationContext ec, String tagName, Attributes attributes) {
     // Let us forget about previous errors (in this object)
     inError = false;

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/ConversionRuleAction.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/ConversionRuleAction.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/ConversionRuleAction.java	Mon Jan  8 23:16:27 2007
@@ -28,6 +28,7 @@
    * Instantiates an layout of the given class and sets its name.
    *
    */
+  @SuppressWarnings("unchecked")
   public void begin(InterpretationContext ec, String localName, Attributes attributes) {
     // Let us forget about previous errors (in this object)
     inError = false;

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/layout/EchoLayout.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/layout/EchoLayout.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/layout/EchoLayout.java	Mon Jan  8 23:16:27 2007
@@ -17,9 +17,9 @@
  * 
  * @author Ceki
  */
-public class EchoLayout extends LayoutBase {
+public class EchoLayout<E> extends LayoutBase<E> {
 
-  public String doLayout(Object event) {
+  public String doLayout(E event) {
     return event+Layout.LINE_SEP;
   }
 

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java	Mon Jan  8 23:16:27 2007
@@ -39,10 +39,10 @@
  * @author S&eacute;bastien Pennec
  * 
  */
-public abstract class SMTPAppenderBase extends AppenderBase {
+public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
 
-  protected Layout layout;
-  protected Layout subjectLayout;
+  protected Layout<E> layout;
+  protected Layout<E> subjectLayout;
 
   private List<String> to = new ArrayList<String>();
   private String from;
@@ -62,7 +62,7 @@
    * 
    * @return a layout as appropriate for the module
    */
-  abstract protected Layout makeSubjectLayout(String subjectStr);
+  abstract protected Layout<E> makeSubjectLayout(String subjectStr);
 
   /**
    * Start the appender
@@ -99,7 +99,7 @@
    * Perform SMTPAppender specific appending actions, delegating some of them to
    * a subclass and checking if the event triggers an e-mail to be sent.
    */
-  protected void append(Object eventObject) {
+  protected void append(E eventObject) {
 
     if (!checkEntryConditions()) {
       return;
@@ -116,7 +116,7 @@
     }
   }
 
-  abstract protected void subAppend(Object eventObject);
+  abstract protected void subAppend(E eventObject);
 
   /**
    * This method determines if there is a sense in attempting to append.
@@ -192,7 +192,7 @@
   /**
    * Send the contents of the cyclic buffer as an e-mail message.
    */
-  protected void sendBuffer(Object lastEventObject) {
+  protected void sendBuffer(E lastEventObject) {
 
     // Note: this code already owns the monitor for this
     // appender. This frees us from needing to synchronize on 'cb'.
@@ -311,11 +311,11 @@
     this.eventEvaluator = eventEvaluator;
   }
 
-  public Layout getLayout() {
+  public Layout<E> getLayout() {
     return layout;
   }
 
-  public void setLayout(Layout layout) {
+  public void setLayout(Layout<E> layout) {
     this.layout = layout;
   }
 }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java	Mon Jan  8 23:16:27 2007
@@ -27,7 +27,7 @@
  * @author S&eacute;bastien Pennec
  */
 
-public abstract class SocketAppenderBase extends AppenderBase {
+public abstract class SocketAppenderBase<E> extends AppenderBase<E> {
 
   /**
    * The default port number of remote logging server (4560).
@@ -143,7 +143,7 @@
   }
 
   @Override
-  protected void append(Object event) {
+  protected void append(E event) {
 
     if (event == null)
       return;
@@ -177,7 +177,7 @@
     }
   }
   
-  protected abstract void postProcessEvent(Object event);
+  protected abstract void postProcessEvent(E event);
 
   void fireConnector() {
     if (connector == null) {

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java	Mon Jan  8 23:16:27 2007
@@ -7,9 +7,9 @@
 import ch.qos.logback.core.AppenderBase;
 import ch.qos.logback.core.Layout;
 
-public abstract class SyslogAppenderBase extends AppenderBase {
+public abstract class SyslogAppenderBase<E> extends AppenderBase<E> {
 
-  Layout layout;
+  Layout<E> layout;
   int facility;
   String facilityStr;
   String syslogHost;
@@ -45,12 +45,12 @@
     }
   }
 
-  abstract public Layout buildLayout(String facilityStr);
+  abstract public Layout<E> buildLayout(String facilityStr);
 
   abstract public int getSeverityForEvent(Object eventObject);
 
   @Override
-  protected void append(Object eventObject) {
+  protected void append(E eventObject) {
     if (!isStarted()) {
       return;
     }
@@ -185,11 +185,11 @@
   /**
    * You can override
    */
-  public Layout getLayout() {
+  public Layout<E> getLayout() {
     return layout;
   }
 
-  public void setLayout(Layout layout) {
+  public void setLayout(Layout<E> layout) {
     this.layout = layout;
   }
 

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java	Mon Jan  8 23:16:27 2007
@@ -23,7 +23,7 @@
 import ch.qos.logback.core.status.StatusManager;
 
 
-abstract public class PatternLayoutBase extends LayoutBase {
+abstract public class PatternLayoutBase<E> extends LayoutBase<E> {
 
   Converter head;
   String pattern;
@@ -42,6 +42,7 @@
    * Returns a map where the default converter map is merged with the map
    * contained in the context.
    */
+  @SuppressWarnings("unchecked")
   public Map<String, String> getEffectiveConverterMap() {
     
     Map<String, String> effectiveMap = new HashMap<String, String>();
@@ -108,7 +109,7 @@
     }
   }
 
-  protected String writeLoopOnConverters(Object event) {
+  protected String writeLoopOnConverters(E event) {
     StringBuffer buf = new StringBuffer(128);
     Converter c = head;
     while (c != null) {

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java	Mon Jan  8 23:16:27 2007
@@ -19,13 +19,13 @@
  * 
  * @author Ceki Gulcu
  */
-public class CyclicBufferAppender extends AppenderBase {
+public class CyclicBufferAppender<E> extends AppenderBase<E> {
 
-  CyclicBuffer cb;
+  CyclicBuffer<E> cb;
   int maxSize = 512;
 
   public void start() {
-    cb = new CyclicBuffer(maxSize);
+    cb = new CyclicBuffer<E>(maxSize);
     super.start();
   }
 
@@ -35,7 +35,7 @@
   }
 
   @Override
-  protected void append(Object eventObject) {
+  protected void append(E eventObject) {
     if (!isStarted()) {
       return;
     }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/ListAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/ListAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/ListAppender.java	Mon Jan  8 23:16:27 2007
@@ -14,12 +14,11 @@
 
 import ch.qos.logback.core.AppenderBase;
 
-public class ListAppender extends AppenderBase {
+public class ListAppender<E> extends AppenderBase<E> {
 
-  public List list = new ArrayList();
+  public List<E> list = new ArrayList<E>();
   
-  @SuppressWarnings("unchecked")
-  protected void append(Object o) {
-    list.add(o);
+  protected void append(E e) {
+    list.add(e);
   }
 }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java	Mon Jan  8 23:16:27 2007
@@ -27,7 +27,7 @@
  * @author Ceki G&uuml;lc&uuml;
  * @since  1.3
  * */
-public class RollingFileAppender extends FileAppender {
+public class RollingFileAppender<E> extends FileAppender<E> {
   File activeFileCache;
   TriggeringPolicy triggeringPolicy;
   RollingPolicy rollingPolicy;
@@ -109,7 +109,7 @@
      This method differentiates RollingFileAppender from its super
      class.
   */
-  protected void subAppend(Object event) {
+  protected void subAppend(E event) {
     // The roll-over check must precede actual writing. This is the 
     // only correct behavior for time driven triggers. 
     if (triggeringPolicy.isTriggeringEvent(activeFileCache, event)) {

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachable.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachable.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachable.java	Mon Jan  8 23:16:27 2007
@@ -18,11 +18,11 @@
  * 
  * @author Ceki G&uuml;lc&uuml;
  */
-public interface AppenderAttachable {
+public interface AppenderAttachable<E> {
   /**
    * Add an appender.
    */
-  public void addAppender(Appender newAppender);
+  public void addAppender(Appender<E> newAppender);
 
   /**
    * Get an iterator for appenders contained in the parent object.
@@ -32,13 +32,13 @@
   /**
    * Get an appender by name.
    */
-  public Appender getAppender(String name);
+  public Appender<E> getAppender(String name);
 
   /**
    * Returns <code>true</code> if the specified appender is in list of
    * attached attached, <code>false</code> otherwise.
    */
-  public boolean isAttached(Appender appender);
+  public boolean isAttached(Appender<E> appender);
 
   /**
    * Detach all previously added appenders.
@@ -48,7 +48,7 @@
   /**
    * Detach the appender passed as parameter from the list of appenders.
    */
-  boolean detachAppender(Appender appender);
+  boolean detachAppender(Appender<E> appender);
 
   /**
    * Detach the appender with the name passed as parameter from the list of

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java	Mon Jan  8 23:16:27 2007
@@ -20,15 +20,15 @@
  * 
  * @author Ceki G&uuml;lc&uuml;
  */
-public class AppenderAttachableImpl implements AppenderAttachable {
+public class AppenderAttachableImpl<E> implements AppenderAttachable<E> {
 
-  final private List<Appender> appenderList = new ArrayList<Appender>();
+  final private List<Appender<E>> appenderList = new ArrayList<Appender<E>>();
 
   /**
    * Attach an appender. If the appender is already in the list in won't be
    * added again.
    */
-  public void addAppender(Appender newAppender) {
+  public void addAppender(Appender<E> newAppender) {
     // Null values for newAppender parameter are strictly forbidden.
     if (newAppender == null) {
       throw new IllegalArgumentException("Cannot null as an appener");
@@ -41,14 +41,14 @@
   /**
    * Call the <code>doAppend</code> method on all attached appenders.
    */
-  public int appendLoopOnAppenders(Object o) {
+  public int appendLoopOnAppenders(E e) {
     int size = 0;
-    Appender appender;
+    Appender<E> appender;
 
     size = appenderList.size();
     for (int i = 0; i < size; i++) {
-      appender = (Appender) appenderList.get(i);
-      appender.doAppend(o);
+      appender = (Appender<E>) appenderList.get(i);
+      appender.doAppend(e);
     }
     return size;
   }
@@ -70,16 +70,16 @@
    * Return the appender with that name if in the list. Return null otherwise.
    * 
    */
-  public Appender getAppender(String name) {
+  public Appender<E> getAppender(String name) {
     if (name == null) {
       return null;
     }
 
     int size = appenderList.size();
-    Appender appender;
+    Appender<E> appender;
 
     for (int i = 0; i < size; i++) {
-      appender = (Appender) appenderList.get(i);
+      appender = appenderList.get(i);
 
       if (name.equals(appender.getName())) {
         return appender;

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/AbstractAppenderTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/AbstractAppenderTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/AbstractAppenderTest.java	Mon Jan  8 23:16:27 2007
@@ -19,14 +19,14 @@
 
 
 
-abstract public class AbstractAppenderTest extends TestCase {
+abstract public class AbstractAppenderTest<E> extends TestCase {
   
   AbstractAppenderTest(String arg) {
     super(arg);
   }
   
-  abstract protected AppenderBase getAppender();
-  abstract protected AppenderBase getConfiguredAppender();
+  abstract protected AppenderBase<E> getAppender();
+  abstract protected AppenderBase<E> getConfiguredAppender();
 
   public void testNewAppender() {
     // new appenders should be inactive
@@ -45,11 +45,12 @@
   }
   
   public void testNoStart() {
-    AppenderBase appender = getAppender();
+    AppenderBase<E> appender = getAppender();
     Context context = new ContextBase();
     appender.setContext(context);
     appender.setName("doh");
-    appender.doAppend(new Object());
+    // is null OK?
+    appender.doAppend(null);
     StatusChecker checker = new StatusChecker(context.getStatusManager());
     //StatusPrinter.print(context.getStatusManager());
     assertTrue(checker.containsMatch("Attempted to append to non started appender \\[doh\\]."));

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/ConsoleAppenderTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/ConsoleAppenderTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/ConsoleAppenderTest.java	Mon Jan  8 23:16:27 2007
@@ -23,7 +23,7 @@
 import ch.qos.logback.core.util.TeeOutputStream;
 
 
-public class ConsoleAppenderTest extends AbstractAppenderTest {
+public class ConsoleAppenderTest extends AbstractAppenderTest<Object> {
 
   TeeOutputStream tee;
   PrintStream original;
@@ -52,28 +52,29 @@
     System.setOut(original);
   }
 
-  protected AppenderBase getAppender() {
-    return new ConsoleAppender();
-  }
-
-  protected AppenderBase getConfiguredAppender() {
-    ConsoleAppender ca = new ConsoleAppender();
-    ca.setLayout(new NopLayout());
+  @Override
+  protected AppenderBase<Object> getAppender() {
+    return new ConsoleAppender<Object>();
+  } 
+
+  protected AppenderBase<Object> getConfiguredAppender() {
+    ConsoleAppender<Object> ca = new ConsoleAppender<Object>();
+    ca.setLayout(new NopLayout<Object>());
     ca.start();
     return ca;
   }
 
   public void testBasic() {
-    ConsoleAppender ca = (ConsoleAppender) getAppender();
-    ca.setLayout(new DummyLayout());
+    ConsoleAppender<Object> ca = (ConsoleAppender<Object>) getAppender();
+    ca.setLayout(new DummyLayout<Object>());
     ca.start();
     ca.doAppend(new Object());
     assertEquals(DummyLayout.DUMMY, tee.toString());
   }
   
   public void testOpen() {
-    ConsoleAppender ca = (ConsoleAppender) getAppender();
-    DummyLayout dummyLayout = new DummyLayout();
+    ConsoleAppender<Object> ca = (ConsoleAppender<Object>) getAppender();
+    DummyLayout<Object> dummyLayout = new DummyLayout<Object>();
     dummyLayout.setFileHeader("open");
     ca.setLayout(dummyLayout);
     ca.start();
@@ -82,8 +83,8 @@
     assertEquals("open"+Layout.LINE_SEP+DummyLayout.DUMMY, tee.toString());
   }
   public void testClose() {
-    ConsoleAppender ca = (ConsoleAppender) getAppender();
-    DummyLayout dummyLayout = new DummyLayout();
+    ConsoleAppender<Object> ca = (ConsoleAppender<Object>) getAppender();
+    DummyLayout<Object> dummyLayout = new DummyLayout<Object>();
     dummyLayout.setFileFooter("closed");
     ca.setLayout(dummyLayout);
     ca.start();
@@ -96,8 +97,8 @@
 
   
   public void testUTF16BE() throws UnsupportedEncodingException {
-    ConsoleAppender ca = (ConsoleAppender) getAppender();
-    ca.setLayout(new DummyLayout());
+    ConsoleAppender<Object> ca = (ConsoleAppender<Object>) getAppender();
+    ca.setLayout(new DummyLayout<Object>());
     String encodingName = "UTF-16BE";
     ca.setEncoding(encodingName);
     ca.start();

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppender.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppender.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppender.java	Mon Jan  8 23:16:27 2007
@@ -13,7 +13,7 @@
 
 import ch.qos.logback.core.WriterAppender;
 
-public class DummyAppender extends WriterAppender {
+public class DummyAppender<E> extends WriterAppender<E> {
 
   
   DummyAppender(Writer writer) {

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppenderTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppenderTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppenderTest.java	Mon Jan  8 23:16:27 2007
@@ -27,16 +27,16 @@
   }
   
   protected AppenderBase getConfiguredAppender() {
-    DummyAppender da = new DummyAppender(new StringWriter());
-    da.setLayout(new NopLayout());
+    DummyAppender<Object> da = new DummyAppender<Object>(new StringWriter());
+    da.setLayout(new NopLayout<Object>());
     da.start();
     return da;
   }
 
   public void testBasic() {
     StringWriter sw = new StringWriter();
-    DummyAppender da = new DummyAppender(sw);
-    da.setLayout(new DummyLayout());
+    DummyAppender<Object> da = new DummyAppender<Object>(sw);
+    da.setLayout(new DummyLayout<Object>());
     da.start();
     da.doAppend(new Object());
     assertEquals(DummyLayout.DUMMY, sw.getBuffer().toString());

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java	Mon Jan  8 23:16:27 2007
@@ -35,8 +35,8 @@
   }
 
   protected AppenderBase getConfiguredAppender() {
-    FileAppender appender = new FileAppender();
-    appender.setLayout(new NopLayout());
+    FileAppender<Object> appender = new FileAppender<Object>();
+    appender.setLayout(new NopLayout<Object>());
     appender.setFile("temp.log");
     appender.setName("temp.log");
     appender.setContext(new ContextBase());
@@ -45,8 +45,8 @@
   }
   
   public void test() {
-    FileAppender appender = new FileAppender();
-    appender.setLayout(new DummyLayout());
+    FileAppender<Object> appender = new FileAppender<Object>();
+    appender.setLayout(new DummyLayout<Object>());
     appender.setAppend(false);
     appender.setFile("temp.log");
     appender.setName("temp.log");

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/DummyLayout.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/DummyLayout.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/DummyLayout.java	Mon Jan  8 23:16:27 2007
@@ -11,11 +11,11 @@
 
 import ch.qos.logback.core.LayoutBase;
 
-public class DummyLayout extends LayoutBase {
+public class DummyLayout<E> extends LayoutBase<E> {
 
   public static final String DUMMY = "dummy"+LINE_SEP;
   
-  public String doLayout(Object event) {
+  public String doLayout(E event) {
     return DUMMY;
   }
 

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/NopLayout.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/NopLayout.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/layout/NopLayout.java	Mon Jan  8 23:16:27 2007
@@ -11,9 +11,9 @@
 
 import ch.qos.logback.core.LayoutBase;
 
-public class NopLayout extends LayoutBase {
+public class NopLayout<E> extends LayoutBase<E> {
   
-  public String doLayout(Object event) {
+  public String doLayout(E event) {
     return "";
   }
 }

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java	Mon Jan  8 23:16:27 2007
@@ -20,18 +20,18 @@
 import ch.qos.logback.core.util.StatusPrinter;
 
 
-abstract public class AbstractPatternLayoutBaseTest extends TestCase {
+abstract public class AbstractPatternLayoutBaseTest<E> extends TestCase {
 
   public AbstractPatternLayoutBaseTest(String arg0) {
     super(arg0);
   }
 
-  abstract public PatternLayoutBase getPatternLayoutBase();
-  abstract public Object getEventObject();
+  abstract public PatternLayoutBase<E> getPatternLayoutBase();
+  abstract public E getEventObject();
   abstract public Context getContext();
-  
+   
   public void testUnStarted() {
-    PatternLayoutBase plb = getPatternLayoutBase();
+    PatternLayoutBase<E> plb = getPatternLayoutBase();
     Context context = new ContextBase();
     plb.setContext(context);
     String s = plb.doLayout(getEventObject());
@@ -46,7 +46,7 @@
    * method is called before being started.
    */
   public void testConverterStart() {
-    PatternLayoutBase plb = getPatternLayoutBase();
+    PatternLayoutBase<E> plb = getPatternLayoutBase();
     plb.setContext(getContext());
     plb.getInstanceConverterMap().put("EX", ExceptionalConverter.class.getName());
     plb.setPattern("%EX");
@@ -57,7 +57,7 @@
   }
 
   public void testStarted() {
-    PatternLayoutBase plb = getPatternLayoutBase();
+    PatternLayoutBase<E> plb = getPatternLayoutBase();
     Context context = new ContextBase();
     plb.setContext(context);
     String s = plb.doLayout(getEventObject());
@@ -68,7 +68,7 @@
 
   public void testNullPattern() {
     //System.out.println("testNullPattern");
-    PatternLayoutBase plb = getPatternLayoutBase();
+    PatternLayoutBase<E> plb = getPatternLayoutBase();
     Context context = new ContextBase();
     plb.setContext(context);
     plb.start();

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java	Mon Jan  8 23:16:27 2007
@@ -18,7 +18,7 @@
 
 
 
-public class SamplePatternLayout extends PatternLayoutBase {
+public class SamplePatternLayout<E> extends PatternLayoutBase<E> {
 
   Map<String, String> converterMap = new HashMap<String, String>();
 
@@ -31,7 +31,7 @@
     return converterMap;
   }
 
-  public String doLayout(Object event) {
+  public String doLayout(E event) {
     return writeLoopOnConverters(event);
   }
 

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java	Mon Jan  8 23:16:27 2007
@@ -22,8 +22,8 @@
   }
   
 
-  public PatternLayoutBase getPatternLayoutBase() {
-    return new SamplePatternLayout();
+  public PatternLayoutBase<Object> getPatternLayoutBase() {
+    return new SamplePatternLayout<Object>();
   }
 
   public Object getEventObject() {
@@ -31,7 +31,7 @@
   }
   
   public void testOK() {
-    PatternLayoutBase plb = getPatternLayoutBase();
+    PatternLayoutBase<Object> plb = getPatternLayoutBase();
     Context context = new ContextBase();
     plb.setContext(context);
     plb.setPattern("x%OTT");

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/RenamingTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/RenamingTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/RenamingTest.java	Mon Jan  8 23:16:27 2007
@@ -32,7 +32,7 @@
  */
 public class RenamingTest extends TestCase {
 
-  Layout layout;
+  Layout<Object> layout;
   Context context = new ContextBase();
 
   public RenamingTest(String arg0) {
@@ -41,7 +41,7 @@
 
   protected void setUp() throws Exception {
     super.setUp();
-    layout = new EchoLayout();
+    layout = new EchoLayout<Object>();
 
     File target = new File(Constants.TEST_DIR_PREFIX + "output/test.log");
     target.mkdirs();
@@ -54,7 +54,7 @@
 
   public void testRename() throws Exception {
 
-    RollingFileAppender rfa = new RollingFileAppender();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setLayout(layout);
     rfa.setContext(context);
     rfa.setFile(Constants.TEST_DIR_PREFIX + "output/test.log");

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeBasedRollingTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeBasedRollingTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeBasedRollingTest.java	Mon Jan  8 23:16:27 2007
@@ -67,8 +67,8 @@
     // We purposefully use the \n as the line separator.
     // This makes the regression test system independent.
     Context context = new ContextBase();
-    Layout layout = new DummyLayout();
-    RollingFileAppender rfa = new RollingFileAppender();
+    Layout<Object> layout = new DummyLayout<Object>();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setLayout(layout);
     rfa.setContext(new ContextBase());
 
@@ -98,8 +98,8 @@
   public void test2() throws Exception {
     Context context = new ContextBase();
 
-    DummyLayout layout = new DummyLayout();
-    RollingFileAppender rfa = new RollingFileAppender();
+    DummyLayout<Object> layout = new DummyLayout<Object>();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setName("ROLLING");
     rfa.setLayout(layout);
     rfa.setContext(context);
@@ -172,8 +172,8 @@
    */
   public void test3() throws Exception {
     Context context = new ContextBase();
-    DummyLayout layout = new DummyLayout();
-    RollingFileAppender rfa = new RollingFileAppender();
+    DummyLayout<Object> layout = new DummyLayout<Object>();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setLayout(layout);
     rfa.setContext(context);
     rfa.setFile(Constants.TEST_DIR_PREFIX + "output/sbr-test3.log");

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/TimeBasedRollingTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/TimeBasedRollingTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/TimeBasedRollingTest.java	Mon Jan  8 23:16:27 2007
@@ -48,7 +48,7 @@
 
   static final String DATE_PATTERN = "yyyy-MM-dd_HH_mm_ss";
 
-  EchoLayout layout = new EchoLayout();
+  EchoLayout<Object> layout = new EchoLayout<Object>();
   Context context = new  ContextBase();
   
   public TimeBasedRollingTest(String name) {
@@ -83,7 +83,7 @@
    */
   public void test1() throws Exception {
 
-    RollingFileAppender rfa = new RollingFileAppender();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setContext(context);
     rfa.setLayout(layout);
 
@@ -130,7 +130,7 @@
    * No compression, with stop/restart, file option left blank
    */
   public void test2() throws Exception {
-    RollingFileAppender rfa1 = new RollingFileAppender();
+    RollingFileAppender<Object> rfa1 = new RollingFileAppender<Object>();
     rfa1.setContext(context);
     rfa1.setLayout(layout);
 
@@ -165,7 +165,7 @@
 
     rfa1.stop();
 
-    RollingFileAppender rfa2 = new RollingFileAppender();
+    RollingFileAppender<Object> rfa2 = new RollingFileAppender<Object>();
     rfa2.setContext(context);
     rfa2.setLayout(layout);
 
@@ -193,7 +193,7 @@
    * With compression, file option left blank, no stop/restart
    */
   public void test3() throws Exception {
-    RollingFileAppender rfa = new RollingFileAppender();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setContext(context);
     rfa.setLayout(layout);
 
@@ -245,7 +245,7 @@
    * Without compression, file option set, with stop/restart
    */
   public void test4() throws Exception {
-    RollingFileAppender rfa1 = new RollingFileAppender();
+    RollingFileAppender<Object> rfa1 = new RollingFileAppender<Object>();
     rfa1.setContext(context);
     rfa1.setLayout(layout);
     rfa1.setFile(Constants.TEST_DIR_PREFIX + "output/test4.log");
@@ -283,7 +283,7 @@
 
     rfa1.stop();
 
-    RollingFileAppender rfa2 = new RollingFileAppender();
+    RollingFileAppender<Object> rfa2 = new RollingFileAppender<Object>();
     rfa2.setContext(context);
     rfa2.setLayout(layout);
     rfa2.setFile(Constants.TEST_DIR_PREFIX + "output/test4.log");
@@ -313,7 +313,7 @@
    * No compression, file option set, without stop/restart
    */
   public void test5() throws Exception {
-    RollingFileAppender rfa = new RollingFileAppender();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setContext(context);
     rfa.setLayout(layout);
     rfa.setFile(Constants.TEST_DIR_PREFIX + "output/test5.log");
@@ -360,7 +360,7 @@
    * With compression, file option set, no stop/restart,
    */
   public void test6() throws Exception {
-    RollingFileAppender rfa = new RollingFileAppender();
+    RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();
     rfa.setContext(context);
     rfa.setLayout(layout);
     rfa.setFile(Constants.TEST_DIR_PREFIX + "output/test6.log");



More information about the logback-dev mailing list