avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-logkit/src/test/org/apache/log/test LoggerListenerTestCase.java
Date Thu, 06 Feb 2003 22:19:35 GMT
bloritsch    2003/02/06 14:19:35

  Modified:    src/java/org/apache/log Hierarchy.java
               src/test/org/apache/log/test LoggerListenerTestCase.java
  Log:
  remove the getLoggerListeners and use identity check on remove
  
  Revision  Changes    Path
  1.25      +1 -17     avalon-logkit/src/java/org/apache/log/Hierarchy.java
  
  Index: Hierarchy.java
  ===================================================================
  RCS file: /home/cvs/avalon-logkit/src/java/org/apache/log/Hierarchy.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Hierarchy.java	6 Feb 2003 21:15:49 -0000	1.24
  +++ Hierarchy.java	6 Feb 2003 22:19:35 -0000	1.25
  @@ -217,22 +217,6 @@
           }
       }
   
  -    public synchronized LoggerListener[] getLoggerListeners()
  -    {
  -        LoggerListener[] listeners = null;
  -
  -        if ( null == m_loggerListener )
  -        {
  -            listeners = new LoggerListener[] {};
  -        }
  -        else
  -        {
  -            listeners = new LoggerListener[] {m_loggerListener};
  -        }
  -
  -        return listeners;
  -    }
  -
       /**
        * Remove the LoggerListener associated with hierarchy.  Perform this
        * step before adding a new one if you want to change it.
  @@ -243,7 +227,7 @@
       {
           if ( null == loggerListener ) throw new NullPointerException( "loggerListener"
);
   
  -        if ( null != m_loggerListener && m_loggerListener.equals( loggerListener
) );
  +        if ( null != m_loggerListener && m_loggerListener == loggerListener );
           {
               m_loggerListener = null;
           }
  
  
  
  1.4       +1 -7      avalon-logkit/src/test/org/apache/log/test/LoggerListenerTestCase.java
  
  Index: LoggerListenerTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-logkit/src/test/org/apache/log/test/LoggerListenerTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LoggerListenerTestCase.java	6 Feb 2003 21:15:49 -0000	1.3
  +++ LoggerListenerTestCase.java	6 Feb 2003 22:19:35 -0000	1.4
  @@ -95,16 +95,10 @@
           final RecordingLoggerListener listener = new RecordingLoggerListener();
   
           hierarchy.addLoggerListener( listener );
  -
  -        assertEquals( 1, hierarchy.getLoggerListeners().length );
  -
           hierarchy.removeLoggerListener( listener );
  -
  -        assertEquals( 0, hierarchy.getLoggerListeners().length );
  -
           hierarchy.addLoggerListener( listener );
   
  -        assertEquals( 1, hierarchy.getLoggerListeners().length );
  +        // If no exceptions have been thrown, we are in business!
       }
   
       public void testPriorityInheritance()
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-cvs-help@jakarta.apache.org


Mime
View raw message