Sasvata (Shash) Chatterjee wrote:

Is there any backward incompatibility problems with 4.2, as related to 4.1.5?

If 4.2 is compatible with 4.1.5, I have no issues with that plan. If not, I'd suggest either to release bunch of components compiled against older stable version, and/or ensure that 4.2 is compatible with 4.1.5.


I don't know.

Actually, the changes are fairly minimal. Attached is the cleaned up diff (I removed license switch, changes in test/ directory, and some cosmetic changes) - it's failry small.


So, I do not have any objections to base all releases on the framework 4.2 
release.

Vadim


On Keel, we too are on 4.1.5. I can try rolling all the components back to 4.1.5 and see if all the tests run (assuming everything compiles), and I agree that would be a good baseline to start. In theory, the second field changing means 4.2.x should be backward-compatible with 4.1.x, I don't know what will happen in practice. We can then turn around and baseline on 4.2 right after that, so we can see the changes between 4.1.5. Of course, somebody might pipe up and tell us before that :-)

Shash
diff -ur 
avalon-framework-4.1.5/api/src/java/org/apache/avalon/framework/Enum.java 
excalibur-framework-4.2.0/api/src/java/org/apache/avalon/framework/Enum.java
--- avalon-framework-4.1.5/api/src/java/org/apache/avalon/framework/Enum.java   
2003-09-12 19:30:36.000000000 -0400
+++ 
excalibur-framework-4.2.0/api/src/java/org/apache/avalon/framework/Enum.java    
    2004-05-16 02:09:08.000000000 -0400
@@ -106,7 +67,7 @@
  *
  *
  * @author <a href="mailto:[email protected]";>Avalon Development Team</a>
- * @version CVS $Revision: 1.24 $ $Date: 2003/04/07 08:31:15 $
+ * @version CVS $Revision: 1.28 $ $Date: 2004/02/11 14:34:24 $
  */
 public abstract class Enum
 {
@@ -151,26 +112,36 @@
 
     /**
      * Tests for equality. Two Enum:s are considered equal
-     * if they have the same class names and the same names.
-     * Identity is tested for first, so this method runs fast.
+     * if they are of the same class and have the same names.
      * The method is also declared final - I (LSutic) did this to
      * allow the JIT to inline it easily.
      *
-     * @param other the other object
+     * @param o the other object
      * @return the equality status
      */
-    public final boolean equals( final Object other )
+    public final boolean equals( Object o )
     {
-        if( null == other )
-        {
+        if( this == o )
+            return true;
+        if( !(o instanceof Enum) )
             return false;
-        }
-        else
-        {
-            return other == this
-                || ( other.getClass().getName().equals( 
this.getClass().getName() )
-                && m_name.equals( ( (Enum)other ).m_name ) );
-        }
+
+        final Enum enum = (Enum)o;
+
+        if( !getClass().equals( enum.getClass() ) )
+            return false;
+        if( m_name != null ? !m_name.equals( enum.m_name ) : enum.m_name != 
null )
+            return false;
+
+        return true;
+    }
+
+    public int hashCode()
+    {
+        int result;
+        result = (m_name != null ? m_name.hashCode() : 0);
+        result = 29 * result + getClass().hashCode();
+        return result;
     }
 
     /**
@@ -178,10 +149,10 @@
      *
      * @return a hash code value for this object
      */
-    public int hashCode()
+    /*public int hashCode()
     {
-        return m_name.hashCode();
-    }
+        return m_name.hashCode() ^ this.getClass().getName().hashCode();
+    }*/
 
     /**
      * Retrieve the name of this Enum item, set in the constructor.
diff -ur 
avalon-framework-4.1.5/api/src/java/org/apache/avalon/framework/Version.java 
excalibur-framework-4.2.0/api/src/java/org/apache/avalon/framework/Version.java
--- 
avalon-framework-4.1.5/api/src/java/org/apache/avalon/framework/Version.java    
    2003-09-12 19:30:36.000000000 -0400
+++ 
excalibur-framework-4.2.0/api/src/java/org/apache/avalon/framework/Version.java 
    2004-05-16 02:09:06.000000000 -0400
@@ -87,7 +48,7 @@
  * </ul>
  *
  * @author <a href="mailto:[email protected]";>Avalon Development Team</a>
- * @version CVS $Revision: 1.30 $ $Date: 2003/07/12 16:49:55 $
+ * @version CVS $Revision: 1.33 $ $Date: 2004/02/11 14:34:24 $
  */
 public final class Version
     implements Comparable, Serializable
@@ -105,11 +66,15 @@
      * @return the new Version object
      * @throws NumberFormatException if an error occurs
      * @throws IllegalArgumentException if an error occurs
+     * @throws NullPointerException if the provided string is <code>null</code>
      * @since 4.1
      */
     public static Version getVersion( final String version )
         throws NumberFormatException, IllegalArgumentException
     {
+        if( version == null )
+            throw new NullPointerException( "version" );
+
         final StringTokenizer tokenizer = new StringTokenizer( version, "." );
         final String[] levels = new String[ tokenizer.countTokens() ];
         for( int i = 0; i < levels.length; i++ )
@@ -199,6 +164,9 @@
      */
     public boolean equals( final Version other )
     {
+        if( other == null )
+            return false;
+
         boolean isEqual = ( getMajor() == other.getMajor() );
         
         if ( isEqual )
@@ -284,6 +252,9 @@
      */
     public boolean complies( final Version other )
     {
+        if( other == null )
+            return false;
+
         if( other.m_major == -1 )
         {
             return true;
@@ -322,11 +293,15 @@
 
     /**
      * Compare two versions together according to the
-     * Comparable interface.
+     * [EMAIL PROTECTED] Comparable} interface.
      * 
      * @return number indicating relative value (-1, 0, 1)
      */
     public int compareTo(Object o) {
+        if( o == null )
+            throw new NullPointerException( "o" );
+
+
         Version other = (Version)o;
         int val = 0;
 
diff -ur 
avalon-framework-4.1.5/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java
 
excalibur-framework-4.2.0/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java
--- 
avalon-framework-4.1.5/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java
    2003-09-12 19:30:36.000000000 -0400
+++ 
excalibur-framework-4.2.0/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java
 2004-05-16 02:09:06.000000000 -0400
@@ -62,17 +23,17 @@
  * This is the default <code>Configuration</code> implementation.
  *
  * @author <a href="mailto:[email protected]";>Avalon Development Team</a>
- * @version CVS $Revision: 1.36 $ $Date: 2003/08/29 18:49:36 $
+ * @version CVS $Revision: 1.43 $ $Date: 2004/02/11 14:34:25 $
  */
 public class DefaultConfiguration
     extends AbstractConfiguration
-    implements Serializable
+    implements MutableConfiguration, Serializable
 {
     /**
      * An empty (length zero) array of configuration objects.
      */
     protected static final Configuration[] EMPTY_ARRAY = new Configuration[ 0 
];
-
+    
     private final String m_name;
     private final String m_location;
     private final String m_namespace;
@@ -81,7 +42,22 @@
     private ArrayList m_children;
     private String m_value;
     private boolean m_readOnly;
-
+    
+    /**
+     * Shallow copy constructor, suitable for craeting a writable clone of
+     * a read-only configuration. To modify children, use 
<code>getChild()</code>, 
+     * <code>removeChild()</code> and <code>addChild()</code>.
+     * 
+     * @param config the <code>Configuration</code> to copy
+     * @throws ConfigurationException if an error occurs when copying
+     */
+    public DefaultConfiguration( Configuration config ) throws 
ConfigurationException
+    {
+        this( config.getName(), config.getLocation(), config.getNamespace(), 
+            ( (config instanceof AbstractConfiguration) ? 
((AbstractConfiguration)config).getPrefix() : "") );
+        addAll( config );
+    }
+    
     /**
      * Create a new <code>DefaultConfiguration</code> instance.
      * @param name a <code>String</code> value
@@ -90,7 +66,7 @@
     {
         this( name, null, "", "" );
     }
-
+    
     /**
      * Create a new <code>DefaultConfiguration</code> instance.
      * @param name a <code>String</code> value
@@ -100,7 +76,7 @@
     {
         this( name, location, "", "" );
     }
-
+    
     /**
      * Create a new <code>DefaultConfiguration</code> instance.
      * @param name config node name
@@ -111,18 +87,18 @@
      * elements with a longer namespace string. Should not be null; use "" if 
no
      * namespace.
      * @since 4.1
-    */
+     */
     public DefaultConfiguration( final String name,
-                                 final String location,
-                                 final String ns,
-                                 final String prefix )
+        final String location,
+        final String ns,
+        final String prefix )
     {
         m_name = name;
         m_location = location;
         m_namespace = ns;
         m_prefix = prefix;  // only used as a serialization hint. Cannot be 
null
     }
-
+    
     /**
      * Returns the name of this configuration element.
      * @return a <code>String</code> value
@@ -131,7 +107,7 @@
     {
         return m_name;
     }
-
+    
     /**
      * Returns the namespace of this configuration element
      * @return a <code>String</code> value
@@ -148,11 +124,11 @@
         {
             throw new ConfigurationException
                 ( "No namespace (not even default \"\") is associated with the 
"
-                  + "configuration element \"" + getName()
-                  + "\" at " + getLocation() );
+                + "configuration element \"" + getName()
+                + "\" at " + getLocation() );
         }
     }
-
+    
     /**
      * Returns the prefix of the namespace
      * @return a <code>String</code> value
@@ -169,12 +145,12 @@
         {
             throw new ConfigurationException
                 ( "No prefix (not even default \"\") is associated with the "
-                  + "configuration element \"" + getName()
-                  + "\" at " + getLocation() );
+                + "configuration element \"" + getName()
+                + "\" at " + getLocation() );
         }
-
+        
     }
-
+    
     /**
      * Returns a description of location of element.
      * @return a <code>String</code> value
@@ -183,7 +159,7 @@
     {
         return m_location;
     }
-
+    
     /**
      * Returns the value of the configuration element as a <code>String</code>.
      *
@@ -201,7 +177,7 @@
             return defaultValue;
         }
     }
-
+    
     /**
      * Returns the value of the configuration element as a <code>String</code>.
      *
@@ -217,11 +193,11 @@
         else
         {
             throw new ConfigurationException( "No value is associated with the 
"
-                                              + "configuration element \"" + 
getName()
-                                              + "\" at " + getLocation() );
+                + "configuration element \"" + getName()
+                + "\" at " + getLocation() );
         }
     }
-
+    
     /**
      * Return an array of all attribute names.
      * @return a <code>String[]</code> value
@@ -237,7 +213,7 @@
             return (String[])m_attributes.keySet().toArray( new String[ 0 ] );
         }
     }
-
+    
     /**
      * Return an array of <code>Configuration</code>
      * elements containing all node children.
@@ -255,7 +231,7 @@
             return (Configuration[])m_children.toArray( new Configuration[ 0 ] 
);
         }
     }
-
+    
     /**
      * Returns the value of the attribute specified by its name as a
      * <code>String</code>.
@@ -269,7 +245,7 @@
     {
         final String value =
             ( null != m_attributes ) ? (String)m_attributes.get( name ) : null;
-
+        
         if( null != value )
         {
             return value;
@@ -277,12 +253,12 @@
         else
         {
             throw new ConfigurationException(
-               "No attribute named \"" + name + "\" is "
-               + "associated with the configuration element \""
-               + getName() + "\" at " + getLocation() );
+                "No attribute named \"" + name + "\" is "
+                + "associated with the configuration element \""
+                + getName() + "\" at " + getLocation() );
         }
     }
-
+    
     /**
      * Return the first <code>Configuration</code> object child of this
      * associated with the given name.
@@ -304,7 +280,7 @@
                 }
             }
         }
-
+        
         if( createNew )
         {
             return new DefaultConfiguration( name, "<generated>" + 
getLocation(), m_namespace, m_prefix );
@@ -314,7 +290,7 @@
             return null;
         }
     }
-
+    
     /**
      * Return an array of <code>Configuration</code> objects
      * children of this associated with the given name.
@@ -334,7 +310,7 @@
         {
             final ArrayList children = new ArrayList();
             final int size = m_children.size();
-
+            
             for( int i = 0; i < size; i++ )
             {
                 final Configuration configuration = 
(Configuration)m_children.get( i );
@@ -343,11 +319,11 @@
                     children.add( configuration );
                 }
             }
-
+            
             return (Configuration[])children.toArray( new Configuration[ 0 ] );
         }
     }
-
+    
     /**
      * Append data to the value of this configuration element.
      *
@@ -357,7 +333,7 @@
     public void appendValueData( final String value )
     {
         checkWriteable();
-
+        
         if( null == m_value )
         {
             m_value = value;
@@ -367,7 +343,7 @@
             m_value += value;
         }
     }
-
+    
     /**
      * Set the value of this <code>Configuration</code> object to the 
specified string.
      *
@@ -376,10 +352,50 @@
     public void setValue( final String value )
     {
         checkWriteable();
-
+        
         m_value = value;
     }
-
+    
+    /**
+     * Set the value of this <code>Configuration</code> object to the 
specified int.
+     *
+     * @param value a <code>int</code> value
+     */
+    public void setValue( final int value )
+    {
+        setValue( String.valueOf( value ) );
+    }
+    
+    /**
+     * Set the value of this <code>Configuration</code> object to the 
specified long.
+     *
+     * @param value a <code>long</code> value
+     */
+    public void setValue( final long value )
+    {
+        setValue( String.valueOf( value ) );
+    }
+    
+    /**
+     * Set the value of this <code>Configuration</code> object to the 
specified boolean.
+     *
+     * @param value a <code>boolean</code> value
+     */
+    public void setValue( final boolean value )
+    {
+        setValue( String.valueOf( value ) );
+    }    
+    
+    /**
+     * Set the value of this <code>Configuration</code> object to the 
specified float.
+     *
+     * @param value a <code>float</code> value
+     */
+    public void setValue( final float value )
+    {
+        setValue( String.valueOf( value ) );
+    }    
+    
     /**
      * Set the value of the specified attribute to the specified string.
      *
@@ -389,14 +405,68 @@
     public void setAttribute( final String name, final String value )
     {
         checkWriteable();
-
-        if( null == m_attributes )
+        
+        if( null != value )
         {
-            m_attributes = new HashMap();
+            if( null == m_attributes )
+            {
+                m_attributes = new HashMap();
+            }
+            m_attributes.put( name, value );
+        }
+        else
+        {
+            if( null != m_attributes )
+            {
+                m_attributes.remove( name );
+            }
         }
-        m_attributes.put( name, value );
     }
-
+    
+    /**
+     * Set the value of the specified attribute to the specified int.
+     *
+     * @param name name of the attribute to set
+     * @param value an <code>int</code> value
+     */
+    public void setAttribute( final String name, final int value )
+    {
+        setAttribute( name, String.valueOf( value ) );
+    }
+    
+    /**
+     * Set the value of the specified attribute to the specified long.
+     *
+     * @param name name of the attribute to set
+     * @param value an <code>long</code> value
+     */
+    public void setAttribute( final String name, final long value )
+    {
+        setAttribute( name, String.valueOf( value ) );
+    }
+    
+    /**
+     * Set the value of the specified attribute to the specified boolean.
+     *
+     * @param name name of the attribute to set
+     * @param value an <code>boolean</code> value
+     */
+    public void setAttribute( final String name, final boolean value )
+    {
+        setAttribute( name, String.valueOf( value ) );
+    }
+    
+    /**
+     * Set the value of the specified attribute to the specified float.
+     *
+     * @param name name of the attribute to set
+     * @param value an <code>float</code> value
+     */
+    public void setAttribute( final String name, final float value )
+    {
+        setAttribute( name, String.valueOf( value ) );
+    }
+    
     /**
      * Add an attribute to this configuration element, returning its old
      * value or <b>null</b>.
@@ -409,15 +479,15 @@
     public String addAttribute( final String name, String value )
     {
         checkWriteable();
-
+        
         if( null == m_attributes )
         {
             m_attributes = new HashMap();
         }
-
+        
         return (String)m_attributes.put( name, value );
     }
-
+    
     /**
      * Add a child <code>Configuration</code> to this configuration element.
      * @param configuration a <code>Configuration</code> value
@@ -425,15 +495,15 @@
     public void addChild( final Configuration configuration )
     {
         checkWriteable();
-
+        
         if( null == m_children )
         {
             m_children = new ArrayList();
         }
-
+        
         m_children.add( configuration );
     }
-
+    
     /**
      * Add all the attributes, children and value
      * from specified configuration element to current
@@ -444,12 +514,12 @@
     public void addAll( final Configuration other )
     {
         checkWriteable();
-
+        
         setValue( other.getValue( null ) );
         addAllAttributes( other );
         addAllChildren( other );
     }
-
+    
     /**
      * Add all attributes from specified configuration
      * element to current configuration element.
@@ -459,7 +529,7 @@
     public void addAllAttributes( final Configuration other )
     {
         checkWriteable();
-
+        
         final String[] attributes = other.getAttributeNames();
         for( int i = 0; i < attributes.length; i++ )
         {
@@ -468,7 +538,7 @@
             setAttribute( name, value );
         }
     }
-
+    
     /**
      * Add all child <code>Configuration</code> objects from specified
      * configuration element to current configuration element.
@@ -478,14 +548,14 @@
     public void addAllChildren( final Configuration other )
     {
         checkWriteable();
-
+        
         final Configuration[] children = other.getChildren();
         for( int i = 0; i < children.length; i++ )
         {
             addChild( children[ i ] );
         }
     }
-
+    
     /**
      * Remove a child <code>Configuration</code> to this configuration element.
      * @param configuration a <code>Configuration</code> value
@@ -493,14 +563,14 @@
     public void removeChild( final Configuration configuration )
     {
         checkWriteable();
-
+        
         if( null == m_children )
         {
             return;
         }
         m_children.remove( configuration );
     }
-
+    
     /**
      * Return count of children.
      * @return an <code>int</code> value
@@ -511,10 +581,10 @@
         {
             return 0;
         }
-
+        
         return m_children.size();
     }
-
+    
     /**
      * Make this configuration read-only.
      *
@@ -523,7 +593,7 @@
     {
         m_readOnly = true;
     }
-
+    
     /**
      * heck if this configuration is writeable.
      *
@@ -538,7 +608,123 @@
                 ( "Configuration is read only and can not be modified" );
         }
     }
-
+    
+    /**   
+     * Returns true iff this DefaultConfiguration has been made read-only.   
+     */   
+    protected final boolean isReadOnly()   
+    {   
+        return m_readOnly;   
+    }   
+    
+    /**   
+     * Convenience function to convert a child to a mutable configuration.   
+     * If the child is-a MutableConfiguration, and it isn't a read-only 
DefaultConfiguration   
+     * (which isn't really mutable), the child is cast to MutableConfiguration 
and returned.   
+     * If not, the child is replaced in the m_children array with a new 
writable DefaultConfiguration   
+     * that is a shallow copy of the child, and the new child is returned.   
+     */   
+    private MutableConfiguration toMutable( Configuration child ) throws 
ConfigurationException   
+    {   
+        if (child instanceof MutableConfiguration &&   
+            !( child instanceof DefaultConfiguration && 
((DefaultConfiguration) child).isReadOnly() ))   
+        {   
+            // Child is already mutable - return it.   
+            return (MutableConfiguration) child;   
+        }   
+        
+        // Child isn't mutable. (This is a mutating operation, so let's check  
 
+        // if we're writable.)   
+        checkWriteable();   
+        
+        DefaultConfiguration config = new DefaultConfiguration( child );   
+        
+        // Replace the old child.   
+        for( int i = 0; i < m_children.size(); i++)   
+        {   
+            if( m_children.get(i) == child )   
+            {   
+                m_children.set( i, config );   
+                break;   
+            }   
+        }   
+        
+        return config;   
+    }   
+    
+    public MutableConfiguration getMutableChild( final String name ) throws 
ConfigurationException   
+    {   
+        return getMutableChild( name, true );   
+    }   
+    
+    public MutableConfiguration getMutableChild( final String name, boolean 
autoCreate ) throws ConfigurationException   
+    {   
+        Configuration child = getChild( name, false );   
+        if( child == null )   
+        {   
+            // No child. Create?   
+            
+            if( autoCreate )   
+            {   
+                DefaultConfiguration config = new DefaultConfiguration( name, 
"-" );   
+                addChild( config );   
+                return config;   
+            }   
+            else   
+            {   
+                return null;   
+            }   
+        }   
+        
+        // Child exists   
+        return toMutable( child );   
+    }   
+    
+    public MutableConfiguration[] getMutableChildren() throws 
ConfigurationException   
+    {   
+        if( null == m_children )   
+        {   
+            return new MutableConfiguration[ 0 ];   
+        }   
+        else   
+        {   
+            final ArrayList children = new ArrayList();   
+            final int size = m_children.size();   
+            
+            for( int i = 0; i < size; i++ )   
+            {   
+                final Configuration configuration = 
(Configuration)m_children.get( i );   
+                children.add( toMutable( configuration ) );   
+            }   
+            
+            return (MutableConfiguration[])children.toArray( new 
MutableConfiguration[ 0 ] );   
+        }   
+    }   
+    
+    public MutableConfiguration[] getMutableChildren( final String name ) 
throws ConfigurationException   
+    {   
+        if( null == m_children )   
+        {   
+            return new MutableConfiguration[ 0 ];   
+        }   
+        else   
+        {   
+            final ArrayList children = new ArrayList();   
+            final int size = m_children.size();   
+            
+            for( int i = 0; i < size; i++ )   
+            {   
+                final Configuration configuration = 
(Configuration)m_children.get( i );   
+                if( name.equals( configuration.getName() ) )   
+                {   
+                    children.add( toMutable( configuration ) );   
+                }   
+            }   
+            
+            return (MutableConfiguration[])children.toArray( new 
MutableConfiguration[ 0 ] );   
+        } 
+    }
+    
     /**
      * Compare if this configuration is equal to another.
      *
@@ -551,7 +737,7 @@
         if( !( other instanceof Configuration ) ) return false;
         return ConfigurationUtil.equals( this, (Configuration) other );
     }
-
+    
     /**
      * Obtaine the hashcode for this configuration.
      *
diff -ur 
avalon-framework-4.1.5/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfigurationBuilder.java
 
excalibur-framework-4.2.0/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfigurationBuilder.java
--- 
avalon-framework-4.1.5/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfigurationBuilder.java
     2003-09-12 19:30:36.000000000 -0400
+++ 
excalibur-framework-4.2.0/impl/src/java/org/apache/avalon/framework/configuration/DefaultConfigurationBuilder.java
  2004-05-16 02:09:06.000000000 -0400
@@ -100,7 +64,7 @@
  * </p>
  *
  * @author <a href="mailto:[email protected]";>Avalon Development Team</a>
- * @version CVS $Revision: 1.30 $ $Date: 2003/06/16 16:53:00 $
+ * @version CVS $Revision: 1.33 $ $Date: 2004/04/03 23:55:54 $
  */
 public class DefaultConfigurationBuilder
 {
@@ -291,4 +255,19 @@
             return m_handler.getConfiguration();
         }
     }
+
+    /**
+     * Sets the <code>EntityResolver</code> to 
+     * be used by parser. Useful when dealing with xml
+     * files that reference external entities.
+     * 
+     * @param resolver implementation of <code>EntityResolver</code>
+     */
+    public void setEntityResolver( final EntityResolver resolver )
+    {
+        synchronized( this )
+        {
+            m_parser.setEntityResolver( resolver );
+        }
+    }
 }
diff -ur 
avalon-framework-4.1.5/impl/src/java/org/apache/avalon/framework/logger/LogKit2AvalonLoggerAdapter.java
 
excalibur-framework-4.2.0/impl/src/java/org/apache/avalon/framework/logger/LogKit2AvalonLoggerAdapter.java
--- 
avalon-framework-4.1.5/impl/src/java/org/apache/avalon/framework/logger/LogKit2AvalonLoggerAdapter.java
     2003-09-12 19:30:36.000000000 -0400
+++ 
excalibur-framework-4.2.0/impl/src/java/org/apache/avalon/framework/logger/LogKit2AvalonLoggerAdapter.java
  2004-05-16 02:09:06.000000000 -0400
@@ -66,7 +26,7 @@
  * components.
  *
  * @author <a href="mailto:[email protected]";>Avalon Development Team</a>
- * @version CVS $Revision: 1.8 $ $Date: 2003/03/12 12:08:46 $
+ * @version CVS $Revision: 1.11 $ $Date: 2004/02/11 14:34:26 $
  * @since 4.1.4
  */
 public final class LogKit2AvalonLoggerAdapter
@@ -76,7 +36,7 @@
      * The Avalon Logger that we re-route to.
      */
     private final Logger m_logger;
-
+    
     /**
      * Create a Logkit [EMAIL PROTECTED] org.apache.log.Logger} instance that
      * redirects to an Avalon [EMAIL PROTECTED] 
org.apache.avalon.framework.logger.Logger} instance.
@@ -91,9 +51,30 @@
         final LogKit2AvalonLoggerAdapter target =
             new LogKit2AvalonLoggerAdapter( logger );
         logKitLogger.setLogTargets( new LogTarget[ ] { target } );
+        
+        if ( logger.isDebugEnabled() )
+        {
+            logKitLogger.setPriority( Priority.DEBUG );
+        }
+        else if ( logger.isInfoEnabled() )
+        {
+            logKitLogger.setPriority( Priority.INFO );
+        }
+        else if ( logger.isWarnEnabled() )
+        {
+            logKitLogger.setPriority( Priority.WARN );
+        }
+        else if ( logger.isErrorEnabled() )
+        {
+            logKitLogger.setPriority( Priority.ERROR );
+        }
+        else if ( logger.isFatalErrorEnabled() )
+        {
+            logKitLogger.setPriority( Priority.FATAL_ERROR );
+        }
         return logKitLogger;
     }
-
+    
     /**
      * Constructor for an Adaptor. Adapts to
      * specified Avalon Logger.
@@ -108,7 +89,7 @@
         }
         m_logger = logger;
     }
-
+    
     /**
      * Route a LogKit message to an avalon Logger.
      *

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to